Click here to Skip to main content
15,899,679 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: pasing byte arrays to functions Pin
App_23-Oct-11 9:09
App_23-Oct-11 9:09 
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 
Dear Friends

I have a mfc application which I already converted to a dll. now I want to launch that application from another win32 client application. So how I can achieve this. Any h elp would be highly appreciated.

check my code snippet.



//in App.h header

extern "C" __declspec(dllexport) void runAppli();

//in App.cpp

__declspec(dllexport) void runAppli(HWND hWnd)

{

AFX_MANAGE_STATE(AfxGetStaticModuleState());

}

//In the client console



int main(int argc, char **argv)

{

typedef void (*EntryPointfuncPtr)(int argc, const char * argv );

HINSTANCE LoadMe;

LoadMe = LoadLibrary(L"C:\\Users\\DasmahapatraS\\Projects\\Bhagavan_Cadem\\RevolutionProj\\debug\\RevolutionProj.dll");

if (LoadMe != 0)

printf("LoadMe library loaded!\n");

else

printf("LoadMe library failed to load!\n");

EntryPointfuncPtr LibMainEntryPoint;

LibMainEntryPoint = (EntryPointfuncPtr)GetProcAddress(LoadMe,"runAppli");

return 0;

}



I am not able to launch with this code. Please tell me whats going wrong... My application is appearing and disappearing from the screen.



Thanks a lot for any help. Sujan
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 
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 

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.