Test and Measurement Forum

C++ problem, please help if you can

Post general discussions on using our drivers to write your own software here

C++ problem, please help if you can

Postby KillerIdiot » Thu May 25, 2006 8:48 pm

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);
}
KillerIdiot
User
User
 
Posts: 2
Joined: Tue May 23, 2006 7:25 pm

Postby Sarah » Wed May 31, 2006 10:33 am

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
Sarah
 

Postby KillerIdiot » Wed Jun 07, 2006 8:25 pm

Thank you very much... that was my problem...
KillerIdiot
User
User
 
Posts: 2
Joined: Tue May 23, 2006 7:25 pm


Return to General Software Discussions

Who is online

Users browsing this forum: No registered users and 0 guests