C# project for Visual Studio 2010
Posted: 11 October 2012 09:26 AM   [ Ignore ]
New Member
Rank
Total Posts:  2
Joined  2012-10-11

Hello.

I just downloaded the SDK from the main page (file CL-Eye-Platform-SDK-1.4.0.0230.exe), but I can’t run the Winforms sample from Visual Studio 2010 Express, and I’m getting this exception:

A call to PInvoke function ‘calib!CLEyeWinFormTest.Program::CLEyeGetCameraUUID’ has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.

(The exception is thrown when the code hits the mentioned function, but I suspect it will also be thrown in any other call to unmanaged code)

Running the sample from Visual Studio 2008 Express seems to work fine, but seeing the nature of the above exception, I don’t know if it just silently failing or if it’s running fine. How can I fix this so it runs from VS2010?

Another thing is, even when I copied the project to another folder, the .dll is running from the SDK\bin folder. However, I can’t find anywhere (through the VS 2k8 GUI, at least) where it’s set to look for the .dll in that folder. Where can I fix this too?

Thanks for reading and for making this library! smile

Profile
 
 
Posted: 12 October 2012 12:29 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  585
Joined  2009-09-17

Please make sure your project is built with x86/win32 option. Also take a look at .net samples included with the SDK.

HardDisk - 11 October 2012 09:26 AM

Hello.

I just downloaded the SDK from the main page (file CL-Eye-Platform-SDK-1.4.0.0230.exe), but I can’t run the Winforms sample from Visual Studio 2010 Express, and I’m getting this exception:

A call to PInvoke function ‘calib!CLEyeWinFormTest.Program::CLEyeGetCameraUUID’ has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.

(The exception is thrown when the code hits the mentioned function, but I suspect it will also be thrown in any other call to unmanaged code)

Running the sample from Visual Studio 2008 Express seems to work fine, but seeing the nature of the above exception, I don’t know if it just silently failing or if it’s running fine. How can I fix this so it runs from VS2010?

Another thing is, even when I copied the project to another folder, the .dll is running from the SDK\bin folder. However, I can’t find anywhere (through the VS 2k8 GUI, at least) where it’s set to look for the .dll in that folder. Where can I fix this too?

Thanks for reading and for making this library! smile

Profile
 
 
Posted: 15 October 2012 04:59 AM   [ Ignore ]   [ # 2 ]
New Member
Rank
Total Posts:  2
Joined  2012-10-11

I am trying to use the .NET sample included with the SDK. More specifically, the Winforms one.

And yes, in the configuration manager it is set to x86.

Any clues about the .dll path?

Profile
 
 
Posted: 16 October 2012 08:53 AM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  585
Joined  2009-09-17

The path to ‘bin’ directory in the SDK is added to the global path during the installation. You can remove it manually.

Profile
 
 
 
 


RSS 2.0     Atom Feed