K8062 and Visual C++

I have been attempting to use K8062d.dll with Visual C++ 8. Below is the gist of my code, which executes but does not work. Am I missing something?
I should first point out that I have tested with the already compiled DMX_demo.exe program, which controls my lamps properly.

// Typedefs:
typedef void (__stdcall *PFNSTARTDEVICE)();
typedef void (__stdcall *PFNSETDATA)(DWORD dwChannel, DWORD dwData);
typedef void (__stdcall *PFNSETCHANNEL)(DWORD dwCount);
typedef void (__stdcall *PFNSTOPDEVICE)();

// Definitions:
PFNSTARTDEVICE StartDevice;
PFNSETDATA SetData;
PFNSETCHANNEL SetChannelCount;
PFNSTOPDEVICE StopDevice;

// Loading DLL
m_hK8062dDLL = LoadLibrary(“k8062d.dll”); // This is loading properly

// DLL function assignments - These appear to be assigned properly
StartDevice = (PFNSTARTDEVICE)GetProcAddress(m_hK8062dDLL, “StartDevice”);
SetData = (PFNSETDATA)GetProcAddress(m_hK8062dDLL, “SetData”);
SetChannelCount = (PFNSETCHANNEL)GetProcAddress(m_hK8062dDLL, “SetChannelCount”);
StopDevice = (PFNSTOPDEVICE)GetProcAddress(m_hK8062dDLL, “StopDevice”);

// Execution - Execute without error, but do nothing.
StartDevice();
SetChannelCount(32);
SetData(2, 250);

Thanks,

Don

Maybe you have not the K8062e.exe in the same folder as the DLL.

I do now…and it works great.

Thanks.

Thank you for the code snippet.
I put it to the VC++ 2008 Express and it works fine too.
Here is my whole program:

[code]#include
#include <windows.h>
#include
#include

typedef void (__stdcall *PFNSTARTDEVICE)();
typedef void (__stdcall *PFNSETDATA)(DWORD dwChannel, DWORD dwData);
typedef void (__stdcall *PFNSETCHANNEL)(DWORD dwCount);
typedef void (__stdcall *PFNSTOPDEVICE)();

// Definitions:
PFNSTARTDEVICE StartDevice;
PFNSETDATA SetData;
PFNSETCHANNEL SetChannelCount;
PFNSTOPDEVICE StopDevice;

HINSTANCE m_hK8062dDLL;
int init();
using namespace std;

int main(int)
{

int h = init();
StartDevice();
SetChannelCount(32);
SetData(2, 250);

cout << "Press Enter to \"CloseDevices\" and to \"FreeLibrary\"" << endl;
cin.get();
StopDevice();         	
FreeLibrary(m_hK8062dDLL);
return EXIT_SUCCESS;

}

int init()
{
// Loading DLL
m_hK8062dDLL = LoadLibrary(“k8062d.dll”); // This is loading properly

// DLL function assignments - These appear to be assigned properly
StartDevice = (PFNSTARTDEVICE)GetProcAddress(m_hK8062dDLL, “StartDevice”);
SetData = (PFNSETDATA)GetProcAddress(m_hK8062dDLL, “SetData”);
SetChannelCount = (PFNSETCHANNEL)GetProcAddress(m_hK8062dDLL, “SetChannelCount”);
StopDevice = (PFNSTOPDEVICE)GetProcAddress(m_hK8062dDLL, “StopDevice”);
return 0;

}[/code]