mIRC Homepage
Posted By: AdmWiggin Calling an mIRC DLL in Delphi - 24/02/04 03:00 AM
Hello. I am trying to run a function out of an mIRC DLL in Delphi (it is an mIRC Function), and here is what i have so far(this part works)... it is the actual running of this function that is giving me problems :tongue: :
Code:
function nameiwant(mWnd, aWnd: HWND; var data, parms: PChar; show, nopause:boolean): integer; external 'path\dllname.dll' name 'actualname';
i go to call it in many different ways, and they all compile just fine, but result in an error crazy

Can anyone help me? confused
Posted By: starbucks_mafia Re: Calling an mIRC DLL in Delphi - 24/02/04 04:19 PM
What sort of error? You mean mIRC says the function doesn't exist, or that it crashes mIRC?
Posted By: AdmWiggin Re: Calling an mIRC DLL in Delphi - 24/02/04 09:55 PM
Ok, I get the impression that you misunderstood me.

here goes :
I have an mIRC Dll... it is already compiled etc.

I am trying to use a function out of that DLL in a Delphi program.

I have tried many things, but it all comes up with an invalid write of address.

the above code is my definition code in Delphi (defining the function), it is just how i call it that I am wondering... Thanks in advance...
Posted By: Raccoon Re: Calling an mIRC DLL in Delphi - 25/02/04 05:17 AM
Try removing the path to the dll, just specifying the dll.
You may have declared the export or params wrong.

Post a link to the DLL you are attempting to use.
Posted By: starbucks_mafia Re: Calling an mIRC DLL in Delphi - 25/02/04 01:18 PM
Ahh I see. Sorry, I didn't even take in the external declaration te first time round.

Well, I don't have much experience using the external declaration, but presumably the problem is that you haven't defined your function as using the stdcall calling convention.
Posted By: AdmWiggin Re: Calling an mIRC DLL in Delphi - 25/02/04 01:31 PM
well, i would post a link, but... well... i dont have a link to post crazy

someone else had the dll in their script, and i just used it...

it is a very common dll in MSN Messenger scripts :
ssl.dll

im beary confused! crazy
edit:
here is my current code (with stdcall put in there grin):
Code:
function msnp(mWnd, aWnd: HWND; var data, parms: PChar; show, nopause:boolean): integer; stdcall; external 'MSN\ssl.dll' name 'msnp8';

function ssl(data2: PChar): String;
var data,parms: PChar;
    mWnd,aWnd: HWND;
    show,nopause: boolean;
begin
  data := pchar(username + ' > ' + pword + ' > ' + data2);
  parms := '';
  mWnd := Chatting.Handle;
  aWnd := mWnd;
  show := false;
  nopause := true;
  msnp(mWnd,aWnd,data,parms,show,nopause);
  ssl := string(data);
end;
'username' and 'pword' are predefined to be the username and password of the user.
Chatting is my main form.
Posted By: tidy_trax Re: Calling an mIRC DLL in Delphi - 25/02/04 02:05 PM
if your main purpose of editing/creating a dll is for the SSL, you can use the Microsoft.XMLHTTP COM object.
Posted By: AdmWiggin Re: Calling an mIRC DLL in Delphi - 25/02/04 02:15 PM
Oh thank you! grin

/me is very happy grin
^_^
Posted By: tidy_trax Re: Calling an mIRC DLL in Delphi - 25/02/04 02:17 PM
yw smile
© mIRC Discussion Forums