regarding ShellExecuteEx()
My program makes use of the function ShellExecuteEx().
Now, from msdn, the requirements for this function are:
Minimum DLL Version: shell32.dll version 3.51 or later
Similarly, my program also calls the function: WSASetLastError()
from msn, the requirements for this function are:
DLL:
Requires Ws2_32.dll.
Does this mean I will have to bundle these two .dll files along with my application so that users can run my application ?
or, will these two .dll files be present in C:\WINDOWS\SYSTEM32 for most systems ?
Thanks !!!
# 1 Re: regarding ShellExecuteEx()
You need not to distribute any of these DLLs as they would be present in target' computer.
But I suggest you using 'CreateProcess' instead of 'ShellExecute[Ex], so that you can avoid linking (and thus reducing binary size). ShellExecute calls CreateProcess internally.
Also, I wonder why only WSASetLastError is used? What about other WSA* functions (specifically WSAStartup).
# 2 Re: regarding ShellExecuteEx()
Here is some info:
http://msdn2.microsoft.com/en-us/library/ms649534.aspx
BTW, there may be legal rights involved with redistribution of system dlls. In 99% of the cases, you probably aren't allowed to distribute any of these.
You have to look for redistributable rights explicitly ( for e.g. Visual Studio provides packages to install the required binaries and these are redistributable ). GDI32 dll can be redistributed on Win2k, but not on platforms above it, I beleive. Also, when you do redistribute, there could be strict guidelines on where to drop these dlls. For commercial apps, it is always wise to check all these aspects