|
Post by Dangermouse on May 16, 2004 10:12:17 GMT -5
Firstly take a look at zone.ni.com/devzone/conceptd.nsf/webmain/3A1F4B7CBC68B636862567CC004D5CCAThese are some of the steps i noted; 1) create a new win32 dll project 2) you need to protoype your functions 3) You need to add ' extern "C" ' before the function and prototype otherwise the compiler changes the name of your functions 4) read /help /dll in mirc (explains the return numbers) 5) Create a def file as the SAME NAME as your cpp and project name eg, mircdll is my project, mircdll.cpp is my main file, and mircdll.def is my def file 6) in the def file, have something like /* THe word after LIBRARY is the name of your project */ LIBRARY mircDLL EXPORTS /* Hello is the name of my function*/ hello @ 1 function2 @ 2 function3 @ 3 //..etc Compile, and all should be good ps these are my files :- mircdll.cpp br] #include "stdafx.h"
BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { return TRUE; }
/* THIS IS THE PROTOTYPE*/ extern "C" int __stdcall hello(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL show, BOOL nopause);
extern "C" int __stdcall hello(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL show, BOOL nopause) { lstrcpy(data, "hello"); return 3; }
mircdll.def LIBRARY mircDLL EXPORTS
hello @ 1
|
|
Pepper
New Member
meep meep...!
Posts: 444
|
Post by Pepper on May 16, 2004 15:23:32 GMT -5
@ 1?
w00t i use 24 :/
|
|