Microsoft own MSDN would be able to help, writing an ActiveX dll, or control would be easier, unless you plan on sticking it into a language that cant use OCX(activeX) <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href=
</a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
hi,<br><br>Writing dlls are very simple,<br><br>In VC create a Win32 application, go to setting and in the linker options add "/dll" (without quotes) and your file will get linked as a dll not an exe. <br><br>now include a new file with an .c or .cpp extension and add it to the project. also add a .def file.<br><br>Theory says you need to have a DllMain like WinMain but you don't need one. Dll is a binary file with functions. so add your functions in a dll. open the .def file and you need to set up the exports section.<br><br>This is how you will do it.<br>in .def file<br><br>Exports <br> FunctionOne<br> FunctionTwo<br><br><br>that's all. Click on Build all , you will be able to create a dll. remember "/dll" option in link setting. <br><br>Now you need to call the dll in a client.(exe file)<br><br>this is a sample code, so change it to suit your needs.<br><br>HANDLE hMod ;<br>hMod = LoadLibrary("path of your dll(including filename)" ;<br><br>// Assuming signature of your FunctionOne(in dll) is like //this<br>// int FunctionOne(char *,char *) , it can be any way !!<br>// create a typedef for your function pointer<br><br>typedef int (FunctionOne *)(char *,char *) ;<br><br>// create an object of type FunctionOne to hold the address <br>// of your function in the dll<br><br>FunctionOne a ;<br><br>// Now load that pointer with the actual address of the //function<br>a = (FunctionOne)GetProcAddress(hMod,"FunctionOne" ;<br><br>// now a is loaded with the address of the dll<br>// call a<br><br>// remember FunctionOne takes two char pointers<br>int nRet = a("hello","World" ;<br><br><br> <p>GuruPrasad Belthur<br><a href=mailto:belthurgp@yahoo.com>belthurgp@yahoo.com</a><br><a href=
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.