Front Panel DLL Crash


I am am trying to get the Front Panel DLL working for the first time. I have an xem3001 board along with Visual Studio 2005. I made a simple command line program (via the wizard) and then trie dthe following code:

// okTest.cpp : Defines the entry point for the console application.

#include “stdafx.h”
#include “okCUsbFrontPanel.h”

int _tmain(int argc, _TCHAR* argv])
int NumDevices;

okCUsbXEM3001v2 *xem = new okCUsbXEM3001v2();

NumDevices = xem->GetDeviceCount();

printf("NumDevices: %i",NumDevices);

    delete xem;

IN the Linker properties, the follow is set:
Ignore Specfic Libraries : libc;libcmt;libcd;libcmtd;msvcrtd

I have also put the okFrontPanel.lib and okFrontPanel.dll in the same folder as the debug executable.

When I run the program, The debugger halts with a break point and I get the message:

"The output window may have more diagnostic information
HEAP[okTest.exe]: Invalid Address specified to RtlFreeHeap( 00380000, 0038AD00 )
Windows has triggered a breakpoint in okTest.exe.

This may be due to a corruption of the heap, and indicates a bug in okTest.exe or any of the DLLs it has loaded.

The output window may have more diagnostic information"

Any Ideas?
-Eli Hughes


I am experiences the very same behaviour.

I have also got this strange error message in runtime:
Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.

And this is for my very first application just trying to open my XEM3001v2.

Any ideas any one?



The program you have included is making C++ calls to the class library, not the DLL. Are you linking with the library (as is indicated by your code) or are you trying to dynamically link to the DLL (as would be indicated by the first line of your post) ?

The library was built for VS.NET and may not be compatible with VS 2005. We are in the process of a new release which will concentrate more on the DLL and hopefully provide better compatibility for the three versions of VS in widespread use (6, .NET, 2005).