Re: Using MFC dll from non-MFC application
There's a question about why doc/view would matter at all. But as pointed out, a document
template is not needed because there is no app to open files, and the others are
irrelevant.
The only reason I made it a doc/view was because the original program was.
After trying for while to make the doc/view work in a thread I dropped that
idea and went to a WinFrame and child window. But now I'm having trouble
with even that.
For testing purposed I created a simple non-doc/view app from the wizard and
converted it to a CWinThread. Here is how I call the thread from my hook
function:
void ViewPointCloud (void)
{
AFX_MANAGE_STATE (AfxGetStaticModuleState());
CViewPointCloudThread *pointCloudThread =
(CViewPointCloudThread*) AfxBeginThread
(RUNTIME_CLASS(CViewPointCloudThread));
WaitForSingleObject (pointCloudThread->m_hThread, INFINITE);
}
CViewPointClousThread is derived from CWinThread. The trouble I am having
is that I never come out of the WaitForSingleObject call after exiting the
GUI application. The other strange thing is that the GUI doesn't even seem
to appear until after I call the WaitForSingleObject function.
And stranger still, for debugging purposes I added an ExitInstance callback
(even though I didn't need it) and added a breakpoint. But that is never
reached.
Joe, In the "For What It's Worth Department", I discovered your flounder mvp
tips site a year or so ago and visit there every so often. But where I work
they block everything under the sun - including your site. In this case
because they considered them to be "Personal Pages".
I had to file a special request to have your site unblocked (which was
granted) but I thought it was worthwhile.
Thank you again,
Jim