i have a problem when i run a dll two times.
Mirc close itself, when I start the second run befor the first one was finshed.
an simple example:
I wrote the the following dll just for testing. You can download this dll
here.
the source code you can see here (its written in delphi6):
ibrary test;
uses
SysUtils,
Windows,
Forms;
{$R *.res}
type
TLoadInfo = packed record
mVersion: DWORD;
mHwnd: HWND;
mKeep: Boolean;
end;
PLoadInfo = ^TLoadInfo;
procedure Delay(ATime: Cardinal);
var Start: Cardinal;
begin
Start := GetTickCount;
repeat
Application.ProcessMessages;
until GetTickCount - Start > ATime;
end;
procedure LoadDll(LoadInfo: PLoadInfo); stdcall; export;
begin
LoadInfo.mKeep := FALSE;
end;
procedure UnloadDll(mTimeOut: integer); stdcall; export;
begin
end;
function teststuff(mWnd: hWnd; aWnd: hWnd; Data: PChar; Parms: PChar; Show: Boolean; NoPause: Boolean): integer; export; stdcall;
begin
delay(2000);
result:=1;
end;
exports
LoadDll,
UnloadDll,
teststuff;
begin
end.
when i progress '/dll test.dll teststuff nothing' two times (or more) in two seconds (cause 'delay(2000);') then mIRC will output an error and close itself.
anyone knows how i can use a dll while the same dll is in progress?
thx anyway .. Frank