C++ problem, please help if you can

Post general discussions on using our drivers to write your own software here
Post Reply
KillerIdiot
User
User
Posts: 2
Joined: Tue May 23, 2006 7:25 pm

C++ problem, please help if you can

Post by KillerIdiot »

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
#include
#include

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);
}

Sarah

Post by Sarah »

Hi

Which unit do you have? Is it the PS2202? This is not compatible with writing your own software. The PS2104 and PS2105 are compatible however.

Best Regards

KillerIdiot
User
User
Posts: 2
Joined: Tue May 23, 2006 7:25 pm

Post by KillerIdiot »

Thank you very much... that was my problem...

Post Reply