Click here to Skip to main content
15,895,192 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Close documents problem Pin
_Flaviu22-Nov-11 2:43
_Flaviu22-Nov-11 2:43 
AnswerRe: Close documents problem Pin
Stefan_Lang22-Nov-11 3:50
Stefan_Lang22-Nov-11 3:50 
GeneralRe: Close documents problem Pin
_Flaviu22-Nov-11 9:17
_Flaviu22-Nov-11 9:17 
GeneralRe: Close documents problem Pin
_Flaviu22-Nov-11 9:24
_Flaviu22-Nov-11 9:24 
GeneralRe: Close documents problem Pin
Stefan_Lang22-Nov-11 21:59
Stefan_Lang22-Nov-11 21:59 
GeneralRe: Close documents problem Pin
_Flaviu23-Nov-11 2:46
_Flaviu23-Nov-11 2:46 
GeneralRe: Close documents problem Pin
_Flaviu23-Nov-11 20:25
_Flaviu23-Nov-11 20:25 
QuestionMainWindow of dll how to launch from client exe Pin
appollosputnik21-Nov-11 16:06
appollosputnik21-Nov-11 16:06 
Dear Friends I have two mfc application. One is a dll and the other one is a client exe application. From the exe application I am trying to load the dll and launch the mainwindow of the dll.

For that in dll.....I have the view class there in view implementation file i am declaring a view pointer, like the code below

[code]
//RevolutionProjView.cpp file
CRevolutionProjView *view;
CRevolutionProjView::CRevolutionProjView()
{
view = this;
}

// The I am creating an extern C function by name runAppli like below.

extern "C" BOOL __declspec(dllexport) runAppli(void)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
view->ShowWindow(SW_SHOW);
return true;
}

[/code]

Now I have exe applicatioln where I want to launch the mainwindow of the dll above is given below.

[code]
void CClientRevProjDlg::OnBnClickedButton1()
{

typedef VOID (*MYPROC)(void);
HINSTANCE hinstLib;
MYPROC ProcAdd;
BOOL fFreeResult, fRunTimeLinkSuccess = FALSE;

hinstLib = LoadLibrary(L"C:\\Users\\DasmahapatraS\\Projects\\Bhagavan_Cadem\\RevolutionProj_OrthoGraphic\\debug\\RevolutionProj.dll");
if (hinstLib != NULL)
{
ProcAdd = (MYPROC) GetProcAddress(hinstLib, "runAppli");
if (fRunTimeLinkSuccess = (ProcAdd != NULL))
(ProcAdd) ();
fFreeResult = FreeLibrary(hinstLib);
}
if (! fRunTimeLinkSuccess)
printf("message via alternative method\n");

}
[/code]

With this my application mainwindow is appearing but immediately its crashing. Can anyone tell me whats going wrong. How can I launch the mainwindow of the dll ?? Please help me. Thanks Sujan
AnswerRe: MainWindow of dll how to launch from client exe Pin
Richard MacCutchan21-Nov-11 21:29
mveRichard MacCutchan21-Nov-11 21:29 
GeneralRe: MainWindow of dll how to launch from client exe Pin
appollosputnik22-Nov-11 5:11
appollosputnik22-Nov-11 5:11 
GeneralRe: MainWindow of dll how to launch from client exe Pin
Richard MacCutchan22-Nov-11 6:18
mveRichard MacCutchan22-Nov-11 6:18 
QuestionBALANCED merge sort Pin
sadas232341s21-Nov-11 10:40
sadas232341s21-Nov-11 10:40 
QuestionCalculating Megabytes from ULONG Pin
jkirkerx21-Nov-11 8:18
professionaljkirkerx21-Nov-11 8:18 
AnswerRe: Calculating Megabytes from ULONG Pin
Richard Andrew x6421-Nov-11 9:11
professionalRichard Andrew x6421-Nov-11 9:11 
GeneralRe: Calculating Megabytes from ULONG Pin
jkirkerx21-Nov-11 10:07
professionaljkirkerx21-Nov-11 10:07 
GeneralRe: Calculating Megabytes from ULONG Pin
David Crow21-Nov-11 10:30
David Crow21-Nov-11 10:30 
GeneralRe: Calculating Megabytes from ULONG Pin
jkirkerx21-Nov-11 10:53
professionaljkirkerx21-Nov-11 10:53 
GeneralRe: Calculating Megabytes from ULONG Pin
jkirkerx21-Nov-11 11:09
professionaljkirkerx21-Nov-11 11:09 
AnswerRe: Calculating Megabytes from ULONG Pin
CPallini21-Nov-11 9:50
mveCPallini21-Nov-11 9:50 
GeneralRe: Calculating Megabytes from ULONG Pin
jkirkerx21-Nov-11 10:09
professionaljkirkerx21-Nov-11 10:09 
AnswerRe: Calculating Megabytes from ULONG Pin
Chuck O'Toole21-Nov-11 14:48
Chuck O'Toole21-Nov-11 14:48 
GeneralRe: Calculating Megabytes from ULONG Pin
jkirkerx21-Nov-11 15:57
professionaljkirkerx21-Nov-11 15:57 
GeneralRe: Calculating Megabytes from ULONG Pin
Stefan_Lang22-Nov-11 3:26
Stefan_Lang22-Nov-11 3:26 
GeneralRe: Calculating Megabytes from ULONG Pin
jkirkerx22-Nov-11 7:00
professionaljkirkerx22-Nov-11 7:00 
QuestionCScrollBar size Pin
Omar.Pessoa21-Nov-11 4:40
Omar.Pessoa21-Nov-11 4:40 

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.