1.)Open VC++ and go to File > New.
Choose Win32 Dynamic-Link Library in the dialog that opens and change the path to C:\My DLLs\.
Enter your project name as HelloWorld And click on OK.
2.)In the new dialog that opens, choose An empty DLL project. and click on Finish.
3.)Click OK on the next dialog that opens :tongue:
4.)Go to File > New.
Choose C++ Source File and enter HelloWorld as a File name and click on OK.
5.)In the new window that opens, write this;
[color:blue]#include[/color] <windows.h>
[color:blue]#define[/color] Do(x) [color:blue]extern[/color] "C" [color:blue]int[/color] WINAPI x(HWND mWnd, HWND aWnd, [color:blue]char[/color] *data, [color:blue]char[/color] *parms, BOOL show, BOOL nopause)
[color:blue]#define[/color] Say(x) wsprintf(data,x); [color:blue]return[/color] 3;
Do(HelloWorld) {
Say("Hello World!");
}
6.)Go to File > New.
Choose Text File and enter HelloWorld.def as File name and click on OK.
7.)In the new window that opens, write this;
LIBRARY HelloWorld
EXPORTS
HelloWorld = _HelloWorld@24
8.)Press F7 or go to Build > Build HelloWorld.dll to compile the DLL.
Go to C:\My DLLs\HelloWorld\Debug\ to find your dll and put it in your mIRC folder.
From mIRC do
//echo -a $dll(HelloWorld.dll,HelloWorld,0)(or if you don't copy the DLL;
//echo -a $dll(C:\My DLLs\HelloWorld\Debug\HelloWorld.dll,HelloWorld,0))
Additional.)There are also several ways to optimize the filesize of the DLL, one is to go to Build > Configurations...
and choose Win32 Release, then pressing Close to choose it.
You can also enter;
#pragma check_stack(off)
#pragma comment(linker,"/OPT:NOWIN98")
at the top of the file somewhere.
And if it compiles to slowly, try adding;
#define WIN32_LEAN_AND_MEAN
somewhere at the top too.
Hope this helps!