I would like to learn if there are any .NET (in preference C#) examples available, or at least wrapped libraries? Thank you fo ryour prompt answer.
Hi wjw,
What kind of library do you need?
I just created a class with methods translated from the Declare subs/functions in the VB6 demo:
static class PCGU
{
[DllImport("FGULink.dll")]
public static extern void OpenGen();
[DllImport("FGULink.dll")]
public static extern void CloseGen();
[DllImport("FGULink.dll")]
public static extern void StartGen();
[DllImport("FGULink.dll")]
public static extern void StopGen();
[DllImport("FGULink.dll")]
public static extern void SetGen(int func, float freq, float ampl, float offset);
[DllImport("FGULink.dll")]
public static extern void SetSweep(
float freq1, float freq2, float ampl, float offset, float time, int form);
[DllImport("FGULink.dll")]
public static extern void SetLibWave(
float freq, float ampl, float offset, int filter, string pointer);
[DllImport("FGULink.dll")]
public static extern bool GenReady();
[DllImport("FGULink.dll")]
public static extern int GenStatus();
[DllImport("FGULink.dll")]
public static extern void ShowGen(bool status);
[DllImport("FGULink.dll")]
public static extern void AttOn(bool att);
}
Using the methods is straigtforward, e.g.:
{
PCGU.OpenGen();
//... add code here to wait for loading completion (test GenStatus())
PCGU.SetSweep(20.123F, 450.456F, 3.1F, 1.2F, 12F, 2);
MessageBox.Show("StartGen?");
PCGU.StartGen();
MessageBox.Show("Stop?");
PCGU.StopGen();
//...
PCGU.CloseGen();
return;
}
Hope this can help,
Alain
You will have to create your own .NET wrappers around the dll’s used by PCGU1000. Like iaorana did, through marshaling and P/Invoke. Shouldn’t be too hard