Click here to Skip to main content
15,884,819 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: dll from win32 console. Pin
Chris Losinger22-Oct-11 5:22
professionalChris Losinger22-Oct-11 5:22 
GeneralRe: dll from win32 console. Pin
appollosputnik22-Oct-11 6:09
appollosputnik22-Oct-11 6:09 
GeneralRe: dll from win32 console. Pin
Chris Losinger22-Oct-11 6:17
professionalChris Losinger22-Oct-11 6:17 
AnswerRe: dll from win32 console. Pin
Richard MacCutchan22-Oct-11 6:19
mveRichard MacCutchan22-Oct-11 6:19 
GeneralRe: dll from win32 console. Pin
appollosputnik22-Oct-11 8:27
appollosputnik22-Oct-11 8:27 
GeneralRe: dll from win32 console. Pin
Richard MacCutchan22-Oct-11 21:37
mveRichard MacCutchan22-Oct-11 21:37 
GeneralRe: dll from win32 console. Pin
appollosputnik22-Oct-11 22:24
appollosputnik22-Oct-11 22:24 
GeneralRe: dll from win32 console. Pin
Stephen Hewitt22-Oct-11 23:25
Stephen Hewitt22-Oct-11 23:25 
LoadLibrary[^] returns a HMODULE, not HINSTANCE. Alter the DLL loading to look like this:
HMODULE hDll = LoadLibrary(_T("C:\\Users\\DasmahapatraS\\Projects\\Bhagavan_Cadem\\RevolutionProj\\debug\\RevolutionProj.dll"));


Secondly, lose the cast like this (since you're now using the correct type above):
typedef BOOL (*PFUNC)(HINSTANCE, LPCSTR);
PFUNC pProc = (PFUNC)GetProcAddress(hDll, "runAppli");

Note also that I've added a _T (same as TEXT) which you left out.

Now a guess at the cause of your problems: GetProcAddress[^] is failing because you're using the wrong function name by ignoring name mangling[^]. Change the DLL like this:
extern "C" BOOL __declspec(dllexport) runAppli(HWND hwnd, LPCSTR lpAppName)

Steve


modified 23-Oct-11 6:01am.

GeneralRe: dll from win32 console. Pin
appollosputnik22-Oct-11 23:50
appollosputnik22-Oct-11 23:50 
GeneralRe: dll from win32 console. Pin
Stephen Hewitt23-Oct-11 0:03
Stephen Hewitt23-Oct-11 0:03 
GeneralRe: dll from win32 console. Pin
appollosputnik23-Oct-11 0:03
appollosputnik23-Oct-11 0:03 
GeneralRe: dll from win32 console. Pin
Stephen Hewitt23-Oct-11 0:07
Stephen Hewitt23-Oct-11 0:07 
GeneralRe: dll from win32 console. Pin
appollosputnik23-Oct-11 0:14
appollosputnik23-Oct-11 0:14 
GeneralRe: dll from win32 console. Pin
appollosputnik23-Oct-11 0:25
appollosputnik23-Oct-11 0:25 
GeneralRe: dll from win32 console. Pin
appollosputnik23-Oct-11 0:37
appollosputnik23-Oct-11 0:37 
GeneralRe: dll from win32 console. Pin
Stephen Hewitt23-Oct-11 0:52
Stephen Hewitt23-Oct-11 0:52 
GeneralRe: dll from win32 console. Pin
appollosputnik23-Oct-11 1:05
appollosputnik23-Oct-11 1:05 
GeneralRe: dll from win32 console. Pin
Stephen Hewitt23-Oct-11 1:12
Stephen Hewitt23-Oct-11 1:12 
GeneralRe: dll from win32 console. Pin
appollosputnik23-Oct-11 1:13
appollosputnik23-Oct-11 1:13 
GeneralRe: dll from win32 console. Pin
appollosputnik23-Oct-11 1:47
appollosputnik23-Oct-11 1:47 
GeneralRe: dll from win32 console. Pin
Stephen Hewitt23-Oct-11 2:17
Stephen Hewitt23-Oct-11 2:17 
GeneralRe: dll from win32 console. Pin
appollosputnik23-Oct-11 1:12
appollosputnik23-Oct-11 1:12 
GeneralRe: dll from win32 console. Pin
Richard MacCutchan23-Oct-11 1:59
mveRichard MacCutchan23-Oct-11 1:59 
GeneralRe: dll from win32 console. Pin
appollosputnik23-Oct-11 4:37
appollosputnik23-Oct-11 4:37 
GeneralRe: dll from win32 console. Pin
Richard MacCutchan23-Oct-11 5:06
mveRichard MacCutchan23-Oct-11 5:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.