12-08-2006 02:20 AM
@7J1L1M wrote:
I finally found that if you put the correct files into the same directory as the DLL, then the "Call Library Function Node" automatically configures itself.
Are you refering to header files? Do you mean that if you have the header file in the same folder as the DLL, the the CLFN automatically configures the right structure for all the parameters? I had no idea it could do that. I know that in 8.2 a feature was introduced which can automatically configure and generate wrapper VIs, but I didn't know that previous versions could also adapt the CLFN.
In any case, you get the Windows header files if you have SDKs from Microsoft (VC++, etc.) or you can search for them online. Each page in the MSDN says at the end which header files are used for the function it displays.
As for the structure, attached is an example of how to call the Windows context menu functions. I think I found it in the LAVA forums.
12-08-2006 07:31 AM
Well, that and the lib file must be there too. But sometimes it works, and other times it doesn't. Is there a definite way to do this? Your popup menu example I have been trying to do for months. How did you manage to figure out the different clusters that Microsoft specified? Since the "put the header in the same directory" method does not always work, could you maybe help me understand Microsofts Windows API? That seems to be what I have the most problem with. Thanks.
7J1L1M
12-08-2006 07:49 AM
As I said, I did not write that example.
In any case, I don't see any "clusters" there, just standard parameters. The tricky part is the handle that in most cases you can just treat as a U32. You can't do anything with it other than passing it between functions, but that should be enough. The definitions of these functions are available in the MSDN where you can see what each function requires.
There are also threads and articles on working with DLLs both in this site and in the LAVA forums and you can search those to see how to work with DLLs. The real problems usually start when you have pointers to pointers and complex structures.