Popup MsgBox without a parent to pass?
-
i have a function which vb is calling from my c++ dll.. the function takes a little while so i wanted to popup a dialog telling them to wait a bit.. im assuming that i cant popup a dialog from a dll as i am crashing when i tell the dialog to go modal:
INT_PTR CDialog::DoModal()
{
// can be constructed with a resource template or InitModalIndirect
ASSERT(m_lpszTemplateName != NULL || m_hDialogTemplate != NULL ||
m_lpDialogTemplate != NULL);// load resource as necessary LPCDLGTEMPLATE lpDialogTemplate = m\_lpDialogTemplate; HGLOBAL hDialogTemplate = m\_hDialogTemplate; HINSTANCE hInst = AfxGetResourceHandle(); <--- crashing here
is there a built in messagebox that doesnt have an ok or cancel that i can show and hide without needing a resource? i have a progresswnd that i got here from CP, but it crashes because i pass NULL for the parent.. is there a way to tell the parent that is calling the dll's function? or a way to pass a CWND pointer from VB into my function? thanks for ne tips! still a newb.. cut me some slack :P -dz
-
i have a function which vb is calling from my c++ dll.. the function takes a little while so i wanted to popup a dialog telling them to wait a bit.. im assuming that i cant popup a dialog from a dll as i am crashing when i tell the dialog to go modal:
INT_PTR CDialog::DoModal()
{
// can be constructed with a resource template or InitModalIndirect
ASSERT(m_lpszTemplateName != NULL || m_hDialogTemplate != NULL ||
m_lpDialogTemplate != NULL);// load resource as necessary LPCDLGTEMPLATE lpDialogTemplate = m\_lpDialogTemplate; HGLOBAL hDialogTemplate = m\_hDialogTemplate; HINSTANCE hInst = AfxGetResourceHandle(); <--- crashing here
is there a built in messagebox that doesnt have an ok or cancel that i can show and hide without needing a resource? i have a progresswnd that i got here from CP, but it crashes because i pass NULL for the parent.. is there a way to tell the parent that is calling the dll's function? or a way to pass a CWND pointer from VB into my function? thanks for ne tips! still a newb.. cut me some slack :P -dz
woops looks like i was crashin with the progress window because i left out the following in the begining of my dll's function:
AFX_MANAGE_STATE(AfxGetStaticModuleState());
woops! but for reference, is there a window built into mfc i can show and hide with no ok or cancel on it? thanks! still a newb.. cut me some slack :P -dz
-
woops looks like i was crashin with the progress window because i left out the following in the begining of my dll's function:
AFX_MANAGE_STATE(AfxGetStaticModuleState());
woops! but for reference, is there a window built into mfc i can show and hide with no ok or cancel on it? thanks! still a newb.. cut me some slack :P -dz
dazinith wrote: is there a window built into mfc i can show and hide with no ok or cancel on it? Nope. That would have made MFC more than just a wrapper class library, and (apparently) the MFC developers didn't want to work too hard. :-) Regards, Alvaro
Quitters never win. Winners never quit. But those who never win and never quit are idiots. -- despair.com