Beginner Q: MFC App without window? 
Author Message
 Beginner Q: MFC App without window?

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



Sun, 02 Jun 2002 03:00:00 GMT  
 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)



Sun, 02 Jun 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. MFC app without app window

2. CListCtrl as child window of a SDI app without MFC Doc/View

3. dialog based mfc app that starts without showing the main window

4. Two Qs on MFC in VC.NET

5. How to make a MDI App without MFC ???

6. Why I can't distribute MFC ODBC app to a machine without Visual Studio

7. Book for MFC without using App Wizards

8. H: writing an MFC app without AppWizard

9. writing an MFC app without AppWizard

10. Re : Terminate MFC App without User Intervention

11. How to get the Window Class ID for a window in a MFC App

12. How to: display output to a DOS window from MFC Windows App

 

 
Powered by phpBB® Forum Software