objects and call external [message #29273] |
Tue, 12 February 2002 12:15  |
Gert
Messages: 11 Registered: December 2001
|
Junior Member |
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 5.50.4912.300" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT size=2>hi,</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>I try to use a call_external in an object method like
this:</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT face="Times New Roman" size=2>pro MCP2000__DEFINE<BR> struct =
{MCP2000, hComm: 0l, status: 0l}<BR>end<BR></FONT></DIV>
<DIV><FONT face="Times New Roman" size=2>function MCP2000::Init<BR>self.hComm =
0l<BR>return, 1<BR>end<BR></FONT></DIV>
<DIV><FONT face="Times New Roman" size=2>function
MCP2000::InitPort<BR> self.status=call_external('D:\Cpp\SerCommDll\Debug\SerCommDl l.dll','InitPortDll',$ <BR> /PORTABLE,'COM1',self.hComm
,/UNLOAD)<BR>return, self.status<BR>end<BR></FONT></DIV>
<DIV><FONT size=2>the idea is here that self.hComm contains a valid handle, but
it doesnt - it stays zero.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>However, this works</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT face="Times New Roman" size=2>function MCP2000::InitPort</FONT></DIV>
<DIV><FONT face="Times New Roman"
size=2>Temp=0l<BR> self.status=call_external('D:\Cpp\SerCommDll\Debug\SerCommDl l.dll','InitPortDll',$ <BR>
/PORTABLE,'COM1',Temp,/UNLOAD)</FONT></DIV>
<DIV><FONT face="Times New Roman" size=2>self.hComm=0l<BR>return,
self.status<BR>end</FONT></DIV>
<DIV><FONT face="Times New Roman"></FONT> </DIV>
<DIV><FONT size=2>any ideas what goes wrong in the first
function????</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Gert</FONT></DIV>
<DIV><FONT size=2></FONT><FONT size=2></FONT> </DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2></FONT> </DIV></BODY></HTML>
|
|
|