|
Hi all,
I'm just imported a new dialog resource (and associated code) into an existing project. When I call the DoModal() function to display the dialog, it generates an entry on the windows taskbar. Why? and how can I stop this? Thanks in advance.
Brian Summers
System Programmer
|
|
|
|
|
|
I believe so...here is the constructor...
CPartitionsDlg::CPartitionsDlg(CWnd* pParent /*=NULL*/)
: CDialog(CPartitionsDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CPartitionsDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
// m_hIcon = AfxGetApp()->LoadIcon(IDR_PARTITION);
}
|
|
|
|
|
bsummers wrote:
I believe so...here is the constructor...
CPartitionsDlg::CPartitionsDlg(CWnd* pParent /*=NULL*/)
Ok, CPartionsDlg constructor accepts a CWnd * as a parent window. But are you passing a CWnd * as a parent window when constructing the object? Please show the line where you declare the CPartitionsDlg variable on which you call the DoModal method.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Here it is....
// Call the Partition Dialog.
CPartitionsDlg part;
part.DoModal();
Should be calling the default constructor.
Brian
|
|
|
|
|
Yes, that's calling the default constructor with no parameter, so the constructor instantiates the parameter with the default value, which is NULL .
Try passing some window as a parameter to the constructor and see if that fixes your problem. Something like:
If that code is inside a method of some class derived from a CWnd :
CPartitionsDlg part(this);
part.DoModal();
Otherwise:
CPartitionsDlg part(AfxGetMainWnd());
part.DoModal();
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Jose Lamas Rios wrote:
Try passing some window as a parameter to the constructor and see if that fixes your problem.
No luck. This didn't fix the problem.
Brian
|
|
|
|
|
May sound obvious but is the 'Application Window' property of the dialog resource set to false?
Tim C
|
|
|
|
|
I tried looking at the dialog properties and Don't see an 'Application Window' setting. I'm on Visual 6.0.
Brian
|
|
|
|
|
|
Thanks Tim that did the trick
I have to manually edit the resource file, but that did the trick. Thanks for all the help everyone!
Brian
|
|
|
|
|
Is it a dialog-based application? If so then what you describe is normal behavior.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Tim C has lead me to a link that solved the problem. Thank you everyone for your help.
Sincerely,
Brian Summers
|
|
|
|
|
I need to open a web browser form my application
I use 'ShellExecute()' to open the web browser and connect a URL,
but it seems that can't use POST method
How do I open a web browser with POST in c++?
Thanks in advance
José Manuel Dorado Pardo
|
|
|
|
|
|
Hi,
I'm trying to use some of the functions I was using in an MFC application in a console application. I've created a console application with Visual Studio.Net 2003.
Looks like I am missing some header(s). however i cannot find out which. I have added and tried all the header files i can think of.
These are my include files:
//----------------------------------------
#pragma once
#include <fstream>
#include <string>
#include <iostream>
#include <winnt.h>
#include <CommCtrl.h>
#include <windef.h>
#include <PrSht.h>
#include <initguid.h>
#include <stdio.h>
#include <windows.h>
#include <setupapi.h>
#include <devguid.h>
#include <regstr.h>
// my include files
// ...
#include "stdafx.h"
using namespace std;
//----------------------------------------
output:
*******************************************
... \Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\SetupAPI.h(56) : error C2143: syntax error : missing ';' before ...
... \Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\CommCtrl.h(30) : error C2501: 'HRESULT' : missing storage-class or type specifiers
... \Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\PrSht.h(97) : error C2065: 'CALLBACK' : undeclared identifier
... \Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\PrSht.h(97) : error C2501: 'UINT' : missing storage-class or type specifiers
...
...
*******************************************
It looks so strange.
I will be very happy if someone can suggest a solution.
Thanks in advance
|
|
|
|
|
caykahve wrote:
I'm trying to use some of the functions I was using in an MFC application in a console application
Using MFC in a console application ???? It is simply impossible to do that. MFC are (in majority) wrapper classes around the Win32 API thus it is purely a Win32 application.
|
|
|
|
|
I'm trying to use only some of the functions that i had used in my mfc application. this was only to show that they could be compiled.
i am using a win32 console project now.
|
|
|
|
|
|
cedric moonen wrote:
It is simply impossible to do that.
It is simply very easy to do that. What makes you think it is impossible?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Can you use the Win32 API in a console application ?? This seems something really strange to me. Or at least I never heard about that
|
|
|
|
|
cedric moonen wrote:
Can you use the Win32 API in a console application ??
Of course, that is a very common thing to do. Why would you think functions like lstrcpy() , ZeroMemory() , RegOpenKeyEx() , and CopyFile() would be limited to just GUI-based applications?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Mmmhh, yes for that I agree... But everything related to window management cannot be used in console application, am I right ? And so, a big part of the MFC cannot be used neither.
But ok, it doesn't mean that nothing can be used...
|
|
|
|
|
cedric moonen wrote:
But everything related to window management cannot be used in console application, am I right ?
Correct.
cedric moonen wrote:
And so, a big part of the MFC cannot be used neither.
I guess that depends on your definition of "big part." Here is a map of the MFC library that I use. I would not say that a "big part" of the classes were windows-specific. Of the 129 classes shown, about 94 of them can be used in console and GUI applications.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Notice anything pecular about your post? I'll give you a hint: we can't see the names of the header files. Either check the "Do not treat <'s as HTML tags" checkbox, or use the < and > located above the smileys.
That said, you might want to include windows.h before any of the others.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|