Yes you can, you should have an header file and a source file. Header file contains the prototypes and the source file the definitions.
Could you correct my code, please ?
g-man122 hasn't added any friends yet.
16 April 2010 - 03:58 AM
Yes you can, you should have an header file and a source file. Header file contains the prototypes and the source file the definitions.
15 April 2010 - 03:04 PM
#include "Windows.h" #include <iostream> extern "C" { __declspec (dllexport) int SendMsg() { return 101001; } BOOL WINAPI DllMain (HMODULE hModule, DWORD state, LPVOID lpReserved) { if (state == DLL_PROCESS_ATTACH) { MessageBoxA(NULL,"Hi","Hi",MB_OK); CreateThread (0,0,(LPTHREAD_START_ROUTINE)SendMsg,0,0,0); } return TRUE; } }
15 April 2010 - 02:57 PM
oh yes, and to just use cout, add using namespace std; or else you are going to have to add it to all your cout statements
Let me try again with a code example...
this is the better way#include <iostream> using namespace std; int main() { cout<<"Hello world"<<endl; }this is the annoying way (at least to me)#include <iostream> int main() { std::cout<<"Hello world"<<std::endl; }
15 April 2010 - 02:50 PM
Microsoft's one. (from Visual C++ 2008)what compiler are you using to build the DLL?
15 April 2010 - 02:22 PM
read this also
dllexport, dllimport