我在编写线程的时候,出现的问题!!请帮我看看!!(39分)

  • 主题发起人 主题发起人 fxh7622
  • 开始时间 开始时间
F

fxh7622

Unregistered / Unconfirmed
GUEST, unregistred user!
我的代码是这样的:<br>tagTheadClient = record &nbsp; &nbsp; //强制下机使用的结构<br>&nbsp; &nbsp; pCardID:Pchar;<br>&nbsp; &nbsp; pComputerIP: &nbsp; Pchar; &nbsp; &nbsp;//要强制机器的IP<br>&nbsp; &nbsp; AConn: &nbsp; &nbsp; &nbsp; &nbsp; TADOConnection;<br>&nbsp; end;<br>&nbsp; TTheadMsg = tagTheadClient;<br>&nbsp; PTheadMsg = ^tagTheadClient;<br>.....<br>tMsg:TTheadMsg;<br>tMsg.pComputerIP:=Pchar(ComName);<br>tMsg.AConn:=ConnectADO;<br>tMsg.pCardID:=Pchar(RefView.Items.Item.Caption);<br>tTHandle:=createthread(nil,0,@ForceDownNet,tMsg,0,tDword);<br><br>线程的实现函数是这样的:<br>procedure ForceDownNet(pMsg:TTheadMsg);<br>var<br>&nbsp; ItemList:TListItem;<br>&nbsp; ReFlag:Integer;<br>&nbsp; SQL:String;<br>&nbsp; //GetMsg:TTheadMsg;<br>begin<br>&nbsp; //GetMsg:=pMsg;<br>&nbsp; ReFlag:=DownPCIP(pMsg.pComputerIP);<br>end;<br><br>可是我再线程中设置断点的时候总是提示说pMsg.pComputerIP为空。这是为什么呢???<br>&nbsp;
 
把断点放在前面<br>tMsg:TTheadMsg;<br>tMsg.pComputerIP:=Pchar(ComName);<br>tMsg.AConn:=ConnectADO;<br>tMsg.pCardID:=Pchar(RefView.Items.Item.Caption);<br>tTHandle:=createthread(nil,0,@ForceDownNet,tMsg,0,tDword);<br><br>ip赋值成功了吗?
 
pComputerIP: &nbsp; string;<br><br>tTHandle:=createthread(nil,0,@ForceDownNet,@tMsg{应该传指针},0,tDword);
 
后退
顶部