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

C / C++ / MFC

 
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 
Now I am writing like this.

int main(int argc, char **argv)
{
/* get handle to dll */
HINSTANCE hGetProcIDDLL = LoadLibrary(TEXT("C:\\Users\\DasmahapatraS\\Projects\\Bhagavan_Cadem\\RevolutionProj\\debug\\RevolutionProj.dll"));
typedef BOOL (* pICFUNC)(HINSTANCE, LPCSTR);
pICFUNC lpfnGetProcessID = (pICFUNC)GetProcAddress((HMODULE) hGetProcIDDLL,"runAppli");
///* The actual call to the function contained in the dll */
BOOL intMyReturnVal = lpfnGetProcessID((HMODULE) hGetProcIDDLL, "runAppli");
/* Release the Dll */
FreeLibrary(hGetProcIDDLL);
return 0;
}

//////////////////////////////////////////////////////////////////////////////////////////////////////
BOOL __declspec(dllexport) runAppli(HWND hwnd, LPCSTR lpAppName)
{
// Only needed if resources are accessed
//AFX_MANAGE_STATE(AfxGetStaticModuleState());
::ShowWindow(hwnd, SW_SHOW);
UNREFERENCED_PARAMETER(lpAppName);
return true;
}

Somebody suggested this piece of code. But nothing is appearing with this. My mainwindow of the dll application is not coming.
Can u tell me whats wrong still in this. Thanks a lot for your help. Sujan
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 
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 

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.