
Beginner Q: MFC App without window?
If you're going to return FALSE from OnInitInstance, all your
processing needs to be done before that time.
Here's what I'd do:
In InitInstance create a CFrameWnd derived window, set m_pMainWnd to
point to it, and return TRUE.
In the window's WM_CREATE handler, start a background thread to do the
processing.
Just before the bg thread exits, post a WM_CLOSE message to the
window, which will shut down the app.
Well, actually, that's only what I'd do if I couldn't avoid using the
OCX altogether, which would be my first choice. A dll API in a
console app would be much better.
On Wed, 15 Dec 1999 13:19:55 +0100, "Matthias Steinbart"
Quote:
>Hello,
>I need to create an MFC app with no window. What the app is going to do is
>backing up data from a magnetical disk to a jukebox. Now I have tried a bit
>around and choosen the following model. I do a normal MFC Single Doc app
>without doc/view support (to avoid of the commandline processing and other
>{*filter*} side effects). In the InitInstance I do all my processing and then I
>return FALSE to indicate we're done.
>The problem with this is that I'm using an OCX and eventhough I can create
>the OCX window successfully, not returning from the InitInstance causes,
>that I can't call functions of the OCX.
>How should I design the app so that there is no window, but I can use the
>ocx?
>Thanks in advance,
>Matthias
Don Grasberger
(remove --- from address to e-mail)