ShellExecute

torhu no at spam.invalid
Tue Feb 12 16:30:10 PST 2008


Sergey Gromov wrote:
  > Thanks.  I did know what the specs were saying, I was just wondering if
> I missed something.  I also know that it does work without `export'---
> because I've tried.  Is it a left-over from an earlier versions of the 
> language ?  The example-driven programmers keep copying this code 
> around, making it sort of common practice...
> 

I guess you're supposed to use it where you'd use __declspec(dllimport) 
in C, but it I'm not sure why it works anyway for functions.  It's 
possible that it's not needed since a function prototype can never be a 
definiton.  So it's safe for the linker to resolve it to a function in 
the import library (.lib).  Unless the function is defined in another 
module you're linking with.  Not sure what happens then, maybe you just 
get that function instead of the one in the dll.

It's needed when linking to variables that are in a DLL, though.  If you 
don't add it, even variable declarations with the 'extern' storage class 
will turn into definitions.


More information about the Digitalmars-d-learn mailing list