mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2003
Posts: 33
Ameglian cow
OP Offline
Ameglian cow
Joined: Nov 2003
Posts: 33
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


--------------------
I may be insane, but I enjoy it!
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
What sort of error? You mean mIRC says the function doesn't exist, or that it crashes mIRC?


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Nov 2003
Posts: 33
Ameglian cow
OP Offline
Ameglian cow
Joined: Nov 2003
Posts: 33
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...


--------------------
I may be insane, but I enjoy it!
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
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.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
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.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Nov 2003
Posts: 33
Ameglian cow
OP Offline
Ameglian cow
Joined: Nov 2003
Posts: 33
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.

Last edited by AdmWiggin; 25/02/04 01:39 PM.

--------------------
I may be insane, but I enjoy it!
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
if your main purpose of editing/creating a dll is for the SSL, you can use the Microsoft.XMLHTTP COM object.


New username: hixxy
Joined: Nov 2003
Posts: 33
Ameglian cow
OP Offline
Ameglian cow
Joined: Nov 2003
Posts: 33
Oh thank you! grin

/me is very happy grin
^_^


--------------------
I may be insane, but I enjoy it!
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
yw smile


New username: hixxy

Link Copied to Clipboard