| | |
Problem while using function from loaded dll
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: May 2007
Posts: 70
Reputation:
Solved Threads: 1
O.k guys the reason for the new thread because no one understood the previous thread even I didn't understand what I wrote lol!
Now listen to my problem.
I wrote an exe file that loads a dll and than uses a function from inside of the dll!
BUT!! my exe crashes while in runtime!! (runtime error)
Here is my exe code
I think that the problem comes when I am calling the hello function..
Anyone has any ideas how to solve it??
Here is my dll source for more info
help anyone??
It should work!!!
please help!!
Now listen to my problem.
I wrote an exe file that loads a dll and than uses a function from inside of the dll!
BUT!! my exe crashes while in runtime!! (runtime error)
Here is my exe code
C++ Syntax (Toggle Plain Text)
/*Typedef the hello function*/ typedef void (*pfunc)(); /*Windows handle*/ HINSTANCE HandleDLL; /*A pointer to a function*/ pfunc hello; /*LoadLibrary*/ HandleDLL = LoadLibrary("message.dll"); if (HandleDLL != 0) printf("MESSAGE library loaded!\n"); else printf("MESSAGE library failed to load!\n"); /*GetProcAddress*/ hello = (pfunc)GetProcAddress(HandleDLL,"hello"); /*Call the function*/ hello();
I think that the problem comes when I am calling the hello function..
Anyone has any ideas how to solve it??
Here is my dll source for more info
C++ Syntax (Toggle Plain Text)
#if BUILDING_DLL # define DLLIMPORT __declspec (dllexport) #else /* Not BUILDING_DLL */ # define DLLIMPORT __declspec (dllimport) #endif /* Not BUILDING_DLL */ DLLIMPORT void hello() { MessageBox (0, "Hello from injected DLL!\n", "Hi", MB_ICONINFORMATION); }
help anyone??
It should work!!!
please help!!
![]() |
Similar Threads
- Unknown problem - Program exits during debugging (C++)
- Visual C++ Debugging Problem (C++)
- Help with automatic update problem and more (Viruses, Spyware and other Nasties)
- dllRegisterServer problem (C++)
- working with dll (Visual Basic 4 / 5 / 6)
- [C++/Win32] Plugin System Problem (C++)
- About:Blank troubles and ad/spyware questions (don't worry, it isn't a Hijack log :)) (Viruses, Spyware and other Nasties)
- more "home search assistent" fun... (Viruses, Spyware and other Nasties)
- startpage.4.ao browser hijacker / would like it out my system (Viruses, Spyware and other Nasties)
Other Threads in the C++ Forum
- Previous Thread: Waiting till another exe file finishes
- Next Thread: Number Sorting
Views: 240 | Replies: 0
| Thread Tools | Search this Thread |
Tag cloud for C++
6 api application array arrays based beginner binary c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete developer display dll dynamiccharacterarray email encryption error file format forms fstream function functions game generator givemetehcodez graph iamthwee ifstream image input int java lib list loop looping loops map math matrix memory multiple newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg search simple sort sorting spoonfeeding string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets





