Click here to Skip to main content
15,892,059 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: pasing byte arrays to functions Pin
jkirkerx23-Oct-11 9:13
professionaljkirkerx23-Oct-11 9:13 
GeneralRe: pasing byte arrays to functions Pin
Richard MacCutchan23-Oct-11 9:35
mveRichard MacCutchan23-Oct-11 9:35 
AnswerRe: working with byte arrays Pin
jschell24-Oct-11 8:36
jschell24-Oct-11 8:36 
GeneralRe: working with byte arrays Pin
jkirkerx24-Oct-11 10:47
professionaljkirkerx24-Oct-11 10:47 
GeneralRe: working with byte arrays Pin
jschell25-Oct-11 7:57
jschell25-Oct-11 7:57 
GeneralRe: working with byte arrays Pin
jkirkerx25-Oct-11 8:27
professionaljkirkerx25-Oct-11 8:27 
Questiondll from win32 console. Pin
appollosputnik22-Oct-11 4:35
appollosputnik22-Oct-11 4:35 
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 

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.