mIRC Home    About    Download    Register    News    Help

Print Thread
#115924 31/03/05 02:53 PM
Joined: Mar 2005
Posts: 3
S
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Mar 2005
Posts: 3
hey

im trying to make a dll pkugin for mirc 6.16 using vc.net 2003
here's a code i wrote:

#include <windows.h>

extern "C" __declspec(dllexport) int procname(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL show, BOOL nopause)
{
MessageBox(mWnd,"Mirc DLL","Mirc DLL",0);
return 1;
}

when i try to load procname using /dll mydll.dll procname it shows the messahe box but after i click ok to close it mirc crushes...
any idea why?

#115925 31/03/05 06:12 PM
Joined: Apr 2004
Posts: 871
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
You forgot __stdcall smile


Saturn, QuakeNet staff
#115926 01/04/05 04:05 PM
Joined: Mar 2005
Posts: 3
S
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Mar 2005
Posts: 3
if i add __stdcall it doesnt get exported properly.. mirc says it cant find the procedure...

#115927 01/04/05 04:20 PM
Joined: Apr 2005
Posts: 17
D
Pikka bird
Offline
Pikka bird
D
Joined: Apr 2005
Posts: 17
I've not made many mIRC dll's but in my experience i've always had problems when not using a .def file, if you add a .def file..

Code:
LIBRARY	mydll
EXPORTS
procname


And change the main code to

Code:
#include &lt;windows.h&gt;

int __stdcall procname(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL show, BOOL nopause)
{
  MessageBox(mWnd,"Mirc DLL","Mirc DLL",0);
  return 1;
} 


You shouldn't have any crashing problems

#115928 01/04/05 06:14 PM
Joined: Mar 2005
Posts: 3
S
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Mar 2005
Posts: 3
thanks, works great


Link Copied to Clipboard