Otóż tak jak w temacie. Mam problem z uruchomieniem okna MFC, który jest tworzony w bibliotece .dll. Wygląda to mniej więcej tak:
Aplikacja -> (Moja biblioteka) -> Tworzenie MFC(Wewnątrz DLL) -> Podmiana okna aplikacji, na te z MFC. Jednak! MFC ciągle freezuje mi aplikację. Kod zatrzymuje się tutaj:
CCommandLineInfo cmd;
MessageBox("#4");
ParseCommandLine(cmd); //Freez, i zatrzymanie aplikacji
MessageBox("R");
EnableShellOpen();
RegisterShellFileTypes(1);
Prawdopodobnie nie ma koment w CommandLineInfo, ale nie wiem dlaczego. Aplikacje robione za pomocą .exe działają inaczej niż te tworzone w celu uruchomienia za pomocą bibliotkeki.
Tak więc, czy ktoś może wie co jest przyczyną, że okno MFC nie chce się otworzyć? Szukałem już wszędzie, ale nic nie pomaga
Kod inicjacji (CWinApp::InitInstance)
BOOL CwelibApp::InitInstance()
{
Say::Box("OOFJD");
CWinApp::InitInstance();
EnableTaskbarInteraction(0);
SetRegistryKey((LPCTSTR)"Local AppWizard-Generated Applications");
LoadStdProfileSettings (1u);
InitContextMenuManager ();
InitKeyboardManager ();
InitTooltipManager ();
CMFCToolTipInfo ttParams;
ttParams.m_bBalloonTooltip = 0;
ttParams.m_bRoundedCorners = 0;
ttParams.m_bDrawIcon = 1;
ttParams.m_bDrawDescription = 1;
ttParams.m_bBoldLabel = 1;
ttParams.m_bDrawSeparator = 1;
ttParams.m_nMaxDescrWidth = 200;
ttParams.m_nGradientAngle = -1;
ttParams.m_clrFill = -1;
ttParams.m_clrFillGradient = -1;
ttParams.m_clrText = -1;
ttParams.m_clrBorder = -1;
ttParams.m_bVislManagerTheme = 1;
GetTooltipManager()->SetTooltipParams(AFX_TOOLTIP_TYPE_ALL,
RUNTIME_CLASS(CMFCToolTipCtrl), &ttParams);
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CMFCApplication2Doc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CMFCApplication2View));
if (!pDocTemplate)
return FALSE;
AddDocTemplate(pDocTemplate);
CCommandLineInfo cmd;
ParseCommandLine(cmd); //Kod zatrzymuje się w tym momencie i nic nie da się dalej zrobić ;_;
EnableShellOpen();
RegisterShellFileTypes(1);
if(!ProcessShellCommand(cmd)) {
Say::Error("o kierwa");
return FALSE;
}
ShowWindow (m_pMainWnd->m_hWnd, 5);
UpdateWindow (m_pMainWnd->m_hWnd);
DragAcceptFiles (m_pMainWnd->m_hWnd, 1);
return TRUE;
}