Question C++ declaration translation help

charliee1151

Member
Joined
Oct 22, 2013
Messages
6
Programming Experience
10+
Hello all,
I need help with a Declaration call in VB.Net (this time I'll try to get the code tags correct!)

This is the definition in C++:

BYTE WINAPI MyFunction(MyPtrType func,LPVOID pParam);

"pParam" is used in the program via the term "This", which I believe means the current thread?

MyPtrType is a TypeDef:
typedef void (WINAPI *MyPtrType)(unsigned char*,int, LPVOID);

I see that this code creates a custom pointer named "MyPtrType" that will point to a function that expects three
parameters and will return a VOID.

I would like to create the proper declaration in VB.net.
Private Declare Function MyFunction Lib "Foo" (By??? SomePointer AS MyPtrType, By??? ??? as ???)


"SomePointer" is actually a pointer to a function (or should it just be the name of that function?) that I must write also; the intent here is to create a call-back to that function
by using "MyFunction" to register that call-back. "MyFunction" is actually a DLL function that activates an
external device, passing it the name of the call-back.

What does VB.net use for the "this" definition?

I also need help with the TypeDef, particularly the LPVOID


This may not be enough information to answer this question. I will gladly provide more details is necessary.

Thanks
Charlie
 

Latest posts

Back
Top