Sorry, there is no .LIB file available for Dev-C++.
Here is a working code written in Dev-C++.
In this example there is used explicit DLL linking (no bneed for a .LIB file):
See: http://msdn.microsoft.com/en-us/library/784bt7z7.aspx
Copy the files FGU.exe. FGULINK.DLL and fgu1000.bit to the Dev-C++ project folder.
[code]#include
#include <windows.h>
#include
typedef void (__stdcall *PFN1)(int, float, float, float);
typedef void (__stdcall *PFN2)(float, float, float, float, float, int);
typedef void (__stdcall PFN3)(float, float, float, int, char);
typedef void (__stdcall *PFN4)();
typedef bool (__stdcall *PFN5)();
typedef int (__stdcall *PFN6)();
typedef void (__stdcall *PFN7)(bool);
// Definitions:
PFN1 SetGen; //void SetGen(int, float, float, float);
PFN2 SetSweep; //void SetSweep(float, float, float, float, float, int);
PFN3 SetLibWave; //void SetLibWave(float, float, float, int, char*);
PFN4 StartGen; //void StartGen();
PFN4 StopGen; //void StopGen();
PFN4 OpenGen; //void OpenGen();
PFN4 CloseGen; //void CloseGen();
PFN5 GenReady; //bool GenReady();
PFN6 GenStatus; //int GenStatus();
PFN7 ShowGen; //void ShowGen(bool);
PFN7 AttOn; //void AttOn(bool);
PFN7 LogSweep; //void LogSweep(bool);
HINSTANCE hDLL;
int init();
using namespace std;
int main(int)
{
if (!init())
{
cout << “DLL found - Press Enter to turn generator on” << endl;
cin.get();
OpenGen();
cout << "Press Enter to check the generator status" << endl;
cin.get();
int h = GenStatus();
cout << h << endl;
cout << "Press Enter to output 1kHz, 5Vpp, 0V offset sine wave" << endl;
cin.get();
SetGen(1, 1000, 5, 0);
cout << "Press Enter to close generator and free library" << endl;
cin.get();
CloseGen();
}
else
{
cout << "DLL not found" << endl;
cout << "Press Enter to free library" << endl;
cin.get();
}
FreeLibrary(hDLL);
return EXIT_SUCCESS;
}
int init()
{
// Loading DLL
hDLL = LoadLibrary(“fgulink.dll”);
if (hDLL != NULL)
{
// DLL function assignments
SetGen = (PFN1)GetProcAddress(hDLL, “SetGen”);
SetSweep = (PFN2)GetProcAddress(hDLL, “SetSweep”);
SetLibWave = (PFN3)GetProcAddress(hDLL, “SetLibWave”);
StartGen = (PFN4)GetProcAddress(hDLL, “StartGen”);
StopGen = (PFN4)GetProcAddress(hDLL, “StopGen”);
OpenGen = (PFN4)GetProcAddress(hDLL, “OpenGen”);
CloseGen = (PFN4)GetProcAddress(hDLL, “CloseGen”);
GenReady = (PFN5)GetProcAddress(hDLL, “GenReady”);
GenStatus = (PFN6)GetProcAddress(hDLL, “GenStatus”);
ShowGen = (PFN7)GetProcAddress(hDLL, “ShowGen”);
AttOn = (PFN7)GetProcAddress(hDLL, “AttOn”);
LogSweep = (PFN7)GetProcAddress(hDLL, “LogSweep”);
return 0;
}
return -1; // Error to load DLL
}[/code]