|
-
Jun 2nd, 2005, 08:39 AM
#1
Thread Starter
Not NoteMe
convert C# code to call DLL into C++ code
Not sure if this is in the correct place, since it's to do with C# and C++
I've got the following code:
Code:
[DllImport("camdll.dll")]
static extern void TiltCam (Int32 id, Int32 x, Int32 y);
I've also got a dll file.
I want to call this function in the dll file, but in a C++ application.
What i've got so far is this:
Code:
HMODULE hDll = LoadLibrary("camdll.dll");
FARPROC fpMoveCam = GetProcAddress(hDll, "TiltCam");
typedef void(__stdcall *fpMoveCamT)(INT32 id,INT32 x, INT32 y);
fpMoveCamT MoveCam = (fpMoveCamT)fpMoveCam;
//////////////////////////////////////////
MoveCam(1,500,500);
Is this a correct translation?
The reason that i ask is that it appears that i can call the function ok, but i sometimes get wierd errors, depending on the arguments, plus it doesn't do what its supposed to do.
Thanks a lot for any help, even if it's to say that there must be something else wrong, i'm really stuck with this one.
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe
"I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Have I helped you? Please Rate my posts. 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|