|
-
May 5th, 2020, 06:43 AM
#9
Re: How to use a _declspec(dllexport) in VB6?
 Originally Posted by wqweto
Yes, this might work if the check in the client code is NvOptimusEnablement != 0 because the first couple of instruction in the VB6 function prolog are definately *not* all zeroes.
Yep, that's what I was counting on - and it worked as expected ...
(I did test this with an RC5-CairoSurface in "D2D"-UploadMode on Win10)
And sure, defining a Zero behind the exported Symbol is not possible this way (using a procedure-def).
But that (exporting a Zero) is probably not what this export is meant to accomplish (for those who use it in C/C++).
Also experimented a bit, to export (from a *.bas-module):
- a normal Public Const NvOptimusEnablement As Long = 1
- as well as a normal Variable as: Public NvOptimusEnablement As Long
(along with the same *.vbp Linker-section)
... but this didn't work (an "unrecognized symbol" was thrown at me)
I've then tried to make it easier for the Linker, by explicitely specifying a *.def file, but "no cigar" either...
But the little Sub worked "well enough" (even without the *.def).
Olaf
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|