Link to home
Start Free TrialLog in
Avatar of sbennetts
sbennetts

asked on

VB and pointers et al

This is something that's probably been covered time and time again.  I'm working with external DLLs that require pointers to byte array and also pointers to the equivalent of a DWORD.

I think I understand the pointer to a byte array, using the concept of ByRef and myArray(0) to pass to a DLL or return from a DLL, but what about a DWORD, how can I pass a pointer to my variable in VB and either pass my number to the DLL or get it to pass a response back into my variable?

If that makes any sense, I'll be very surprised.

Thanks
Simon
ASKER CERTIFIED SOLUTION
Avatar of AlexFM
AlexFM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sbennetts
sbennetts

ASKER

Is there a definitive list for this kind of thing?  It's something I always spend ages and ages on...
I usually find some API with parameters of required type and see how API viewer generated API declaration. For example, to see difference between DWORD and DWORD* you can compare GetComputerName and GetWindowText.
...but how does that tell you about the actual function call in the DLLs?
i.e. what they are expecting in...
Compare GetComputerName and GetWindowText API declarations in MSDN and generate their VB declarations using API Viewer. When Dll function has DWORD* parameter, you pass ByRef Integer. Dll gets DWORD* and may change this variable.
Many thanks
Simon