Hi Alberto,
First: thanks for this great program Winrad and also the dll mechanism to
customize it for different pieces of hardware.
As far as the calling conventions: the same way you use _stdcall in C++ I use
stdcall in Delphi.
Example:
extern "C"
int __stdcall __declspec(dllexport) StartHW(long LOfreq)
{
. Set here the frequency of the controlled hardware to LOfreq
return 0; // number of complex elements returned each
// invocation of the callback routine
}
function StartHW(Frequency: Longint): integer; stdcall;
begin
Result := 0;
end;
exports StartHW;
This works very well with all the functions/procedures I wrote:
InitHW, OpenHW, StartHW, StopHW, CloseHW, SetHWLO, GetHWLO, GetTune, GetMode,
ModeChanged, GetStatus, ShowGUI, HideGUI, IFLimitsChanged and TuneChanged.
The only problem is with the callback procedure and the only call I make is:
CallBackPtr(-1, 101, 0, nil);
The last parameter is a null pointer but as Cnt is -1 for a status change (LO
changed) I hope this does not cause any problem.
The reason I want to use the LO changed is because a little annoyance in Winrad:
On a fresh installation Winrad LO is set to 0 but I want to limit it.
On startup Winrad call InitHW, SetCallBack and ModeChanged.
When I select the Input for my dll Winrad call OpenHW, SetHWLO(0) to which I
send back a negative value and finally Winrad call TuneChanged(0).
When I click Start Winrad call StartHW. The displayed LO is 0 and the displayed
Tune is blank.
As soon I try to change the LO Winrad tries to change it (for example to 10) to
which I send back the negative value again. After that Winrad calls GetHWLO,
IFLimitsChanged and TuneChanged.
At this point what is displayed in Winrad is correct. As Winrad saves these
values upon exit the problem do not show up again.
I also should have said what I wish to accomplish:
I plan to acquire one of Tony's new toy: a SoftRock V9 with VHF converter which
can be used with Winrad and Fred's dll.
I also want to build a companion HDT (Hardware Defined Transmitter) and be able
to synchronize/control it within Winrad.
Jean-Claude PJ2BVU