I am attempting to call the routine tkcmdsetDDI_discover_pm3s from within a C++ MFC dialog based application using Visual Studio 2005. It should be very similar to the sample app in the sdk.
I can call init functions, and I can get the dll version numbers, but as soon as I try to call the discover_pm3s I get an exception error.
The only difference between this routine and the ones I can call is that it takes parameters, but I am passing the parameters exaclty as the sample code.
Has anyone else had this problem and can point me to where the problem lies?
Calling the discover routine using C++
-
- Paddler
- Posts: 2
- Joined: May 30th, 2006, 6:33 am
- Location: UK
Are you using Managed C++? What's the exception?
VB throws an exception on every function with parameters, due to the C calling convention used in the DLL (cdecl vs stdcall). I wouldn't expect that to be a problem with C++, but you might want to look into it.
Are you sending in proper parameters?Mike
VB throws an exception on every function with parameters, due to the C calling convention used in the DLL (cdecl vs stdcall). I wouldn't expect that to be a problem with C++, but you might want to look into it.
Are you sending in proper parameters?
Code: Select all
UINT16_T device_count;
tkcmdsetDDI_discover_pm3s(TKCMDSET_PM3_PRODUCT_NAME2, 0, &device_count);
-
- Paddler
- Posts: 2
- Joined: May 30th, 2006, 6:33 am
- Location: UK
Thanks Mike
The exception is actually 'invalid handle', looking at the call stack, it seems to have got lost in the kernel. I think that the calling convention must be wrong although I have specified cdecl and the parameters are correct.
I tried calling the dll through a managed c# project and that works fine.
I need to investigate this further...
Nick
The exception is actually 'invalid handle', looking at the call stack, it seems to have got lost in the kernel. I think that the calling convention must be wrong although I have specified cdecl and the parameters are correct.
I tried calling the dll through a managed c# project and that works fine.
I need to investigate this further...
Nick
I'm having the same problem. At first I thought it was the compilers fault(using Visual Studio 2008 instead of 2005). But now that I see you have the same problem I'm confused.
Im not using MFC but just a regular console application. Initialization of the dll works the same as in the sample application. When I call tkcmdsetDDI_discover_pm3s I get an exception saying 'invalid handle'
Did you solve the problem?
Bas
Im not using MFC but just a regular console application. Initialization of the dll works the same as in the sample application. When I call tkcmdsetDDI_discover_pm3s I get an exception saying 'invalid handle'
Did you solve the problem?
Bas
Pb with PM4 BUG Dll
I have the same pb . I have a PM4 et the function crash when i discover PM3 . but only in debug ! in release , it's OK. For resolve my probleme i discover only PM4 and it's ok in debug and release.
Excuse for my bad english.
Sensor
Excuse for my bad english.
Sensor