KillerIdiot User

Joined: 23 May 2006
Posts: 2
|
Posted: Thu May 25, 2006 8:48 pm Post subject: C++ problem, please help if you can |
|
|
For some reason, when i use the function to open the unit, it will not work, i even checked to make sure that the program provided is able to connect to the device. Here is my code, please tell me if there is anything i am missing:
#include <conio.h>
#include <iostream.h>
#include <windows.h>
short (*FPshortVOID)(void) = NULL;
void main()
{
short handle;
HINSTANCE dll;
dll = LoadLibrary("PS2000.dll");
FPshortVOID = (short (*)(void))GetProcAddress(dll,"ps2000_open_unit");
do{
handle = (*FPshortVOID)();
if(handle == -1)
{
cout << "Unit Did Not Initialize... Press Any Key To Retry\n";
getch();
}
else if(handle == 0)
{
cout << "No Unit Found... Press Any Key When Connected\n";
getch();
}
else
{
cout << "Initialized Correctly\n";
getch();
}
}while(handle <= 0);
} |
|