Page 1 of 1

what's wrong in this code ?

Posted: Fri Mar 14, 2008 4:09 pm
by univercom
please help me

Code: Select all

procedure Tfmain.SwitchtochClick(Sender: TObject);
var
chinfo: TChannelInfo;
e: PEPGInfo;
chid: integer;
begin
e := TV.Selected.Data;
chid := FindChId(e^.wSat, e^.wNetID, e^.wSID);
chinfo.dwSize := sizeof(TChannelInfo);
chinfo.wNID := e.wNetID;
chinfo.wSID := e.wSID;
chinfo.wSatPos := e.wSat;
chinfo.dwChId := chid;
if chid >= 0 then
begin
SendMessage(hwndDD, WM_MODULE_MSG, DDMODAPI_SET_CHANNEL_BY_CHID, Integer(@chinfo));
end;
end;

Posted: Wed Apr 02, 2008 4:06 am
by ScanMan
If my understandig of this code-fragment is correct, you do somewhere search a channel-ID and want to switch to this program with a little sendmessage ?
If yes, do it simply like this:

Code: Select all

SendMessage(hwndDD, WM_MODULE_MSG, DDMODAPI_SET_CHANNEL_BY_CHID, CHID);
When you are using this API-command, you simply have to handover the integer-value - NOT a pointer to a record !

Posted: Sat Mar 28, 2009 3:25 am
by univercom
thanx ScanMan now it works ..