wenn ich die funktion meiner dll mittels cmd aufrufe also rundll32 testdll.dll,HelloWorld
sagt er mir dass der eintrag HelloWorld nicht funzt und auch wenn ich meine dll in andere prozesse injecte wie zb notepad oder eigene progs passiert nichts oder sie stürzen ab.
benutze Windows Vista Home Premium 32bit und dev-c++
hier ist der code der dll
Code:
//dll.h
#ifndef _DLL_H_
#define _DLL_H_
#if BUILDING_DLL
# define DLLIMPORT __declspec (dllexport)
#else /* Not BUILDING_DLL */
# define DLLIMPORT __declspec (dllimport)
#endif /* Not BUILDING_DLL */
DLLIMPORT void HelloWorld(void);
class DLLIMPORT DllClass
{
public:
DllClass();
virtual ~DllClass(void);
private:
};
#endif /* _DLL_H_ */
Code:
#include "dll.h"
#include <windows.h>
DLLIMPORT void HelloWorld ()
{
MessageBox (0, "HelloWorld", "HelloWorld", MB_ICONINFORMATION);
}
BOOL APIENTRY DllMain (HINSTANCE hInst /* Library instance handle. */ ,
DWORD reason /* Reason this function is being called. */ ,
LPVOID reserved /* Not used. */ )
{
switch (reason)
{
case DLL_PROCESS_ATTACH:
HelloWorld();
break;
case DLL_PROCESS_DETACH:
HelloWorld();
break;
case DLL_THREAD_ATTACH:
HelloWorld();
break;
case DLL_THREAD_DETACH:
HelloWorld();
break;
}
/* Returns TRUE on success, FALSE on failure */
return TRUE;
}






.
