mIRC Homepage
Posted By: theunforgiven Opensource/Sample DLL - 10/01/03 02:18 AM
are there any dlls out there that compile in VC++ that i can just check out to figure out how MIRC dlls work? sorry if this has been asked 1000 times. i tried a search but the hits seemed useless :-/
Posted By: pDude Re: Opensource/Sample DLL - 10/01/03 03:32 AM
Take a look at the links that GrimZ posted in the topic 'Memory-mapped file and SendMessage' in this forum.

/ pDude
Posted By: Nimue Re: Opensource/Sample DLL - 10/01/03 03:45 AM
Necroman has a tutorial at http://necroman.wot.net/dllhelp.htm which may be usefull to you.
Posted By: Collective Re: Opensource/Sample DLL - 10/01/03 12:37 PM
There are also alot of useful opensource DLLs here.
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;
Code:
[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;
Code:
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!
Posted By: Necroman Re: Opensource/Sample DLL - 10/01/03 06:15 PM
Most good DLLs on scripting sites are open-source, which is wonderful for learning and sharing ideas. I'm sure you can get a lot of useful tricks just by looking at the code.

Your specific questions are welcome - we like to solve puzzles here smile
Posted By: J0ke Re: Opensource/Sample DLL - 10/01/03 06:29 PM
Where can I find tutorial about c++ socket connection or an opensource dll. I want to make dll for downloading files. Some info would be useful.
Posted By: Necroman Re: Opensource/Sample DLL - 10/01/03 09:18 PM
look here
© mIRC Discussion Forums