Problemimi aşağıda ayrıntılı bir şekilde anlatmaya çalıştım. Umarım anlaşılmışımdır. Herkese çok teşekkürler.
Dlldeki Record Tanımlaması;
Kod: Tümünü seç
typedef struct _tagCommParam
{
char ip[16];
int port;
byte commType;
int timeout;
}
COMPARAM;
Kod: Tümünü seç
PComParam = ^TComParam;
TComParam = record
ip:string[16];
port:SmallInt;
commType:Byte;
timeout:SmallInt;
end;
Kod: Tümünü seç
int DeviceMatch(COMPARAM *comParam)
Kod: Tümünü seç
function DeviceMatch(HInst:THandle; cParam:PComParam) : Integer;
var
MyFunct : function (cParam:PComParam) : Integer; cdecl;
begin
Result := RET_FAIL;
try
MyFunct:=GetProcAddress(HInst,'DeviceMatch');
if Assigned(MyFunct) Then
Result := MyFunct(cParam);
except
end;
end;
Kod: Tümünü seç
var PPrm :TComParam; aPPrm:PComParam;
PPrm := ip:'192.168.0.30';port:9001;comtype:1;timeout:30 ;
aPPrm := Addr(PPrm); =>$18F518:ip:'192.168.0.30';port:9001 $2329;comtype:1;timeout:30 $1E
ok := DeviceMatch(aPPrm)=0;
Dosyada "Port:" parametresi 9001 ve "TO:" parametresi de 30 yazması gerekirken yukarıdaki gibi çıktı veriyor.DeviceMatch IP:192.168.0.30 Port :589889536 TO: 538436638 ComType :1
Acaba bu durum nasıl düzeltilir. Yardımcı olabilecek misiniz? İyi çalışmalar,kolay gelsin...