DoModal()

L

Lucian Popescu

Hello,

I wonder how do you display a modal dialog? I tryed this:

.....
HWND hWnd;
CVisioApplication app;
if (!SUCCEEDED(GetApp(app)))
return VAORC_SUCCESS;
if(!SUCCEEDED(app.WindowHandle32((long*)&hWnd)))
return VAORC_SUCCESS;


COptionDialog optionDialog;
optionDialog.SetParent(CWnd::FromHandle(hWnd));
optionDialog.DoModal();
......

And I allways get a "Unhandled exception in Visio.exe (MFC42D.DLL):
0xC0000005: Access violation."

I just want to display a Option dialog.

/thanx in advance

/Lucian

ps here is the GetApp(app) function:

HRESULT TransferAddon::GetApp(CVisioApplication& vsoApp)
{
if (m_vsoApp.IsSet() || VAO_SUCCESS ==
vaoGetObjectWrap(m_vsoApp))
{
vsoApp = m_vsoApp;
return NOERROR;
}

return E_FAIL;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

DropMany method 0

Top