|
Thank you, I checked InitInstance() and even InitApplication() and can't find anything that would possibly correct this. Any other thoughts? I really appreciate your guidence.
Thanks
Garry
|
|
|
|
|
I created an app that minimizes when it opens and this is what I found.
BOOL CMyApp::InitInstance()
{
...
...
...
if (!ProcessShellCommand(cmdInfo))
return FALSE;
m_pMainWnd->ShowWindow(SW_SHOWMINIMIZED);
m_pMainWnd->UpdateWindow();
return TRUE;
}
Change or add m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED); to the above code.
|
|
|
|
|
Did you overlook the m_pMainWnd->ShowWindow(SW_SHOWMINIMIZED) statement in the InitInstance() method?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Below is my initInstance Function. There is no :"m_pMainWnd->ShowWindow(SW_SHOWMINIMIZED)". Is there another place it could possibly be? Thank you for your patience!
Garry
BOOL CCustomerApp::InitInstance()
{
// InitCommonControls() is required on Windows XP if an application
// manifest specifies use of ComCtl32.dll version 6 or later to enable
// visual styles. Otherwise, any window creation will fail.
InitCommonControls();
CWinApp::InitInstance();
// Initialize OLE libraries
if (!AfxOleInit())
{
AfxMessageBox(IDP_OLE_INIT_FAILED);
return FALSE;
}
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need
// Change the registry key under which our settings are stored
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings(4); // Load standard INI file options (including MRU)
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(IDR_CustomerTYPE,
RUNTIME_CLASS(CCustomerDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CCustomerView));
AddDocTemplate(pDocTemplate);
// create main MDI Frame window
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
m_pMainWnd = pMainFrame;
// call DragAcceptFiles only if there's a suffix
// In an MDI app, this should occur immediately after setting m_pMainWnd
// Enable drag/drop open
m_pMainWnd->DragAcceptFiles();
// Enable DDE Execute open
EnableShellOpen();
RegisterShellFileTypes(TRUE);
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line. Will return FALSE if
// app was launched with /RegServer, /Register, /Unregserver or /Unregister.
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// The main window has been initialized, so show and update it
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
return TRUE;
}
|
|
|
|
|
Was this created with Visual Studio 6? Have you looked at the project's frame-related classes to see if they are adjusting the window's size? Since it is an MDI application, have you looked at the CChildFrame::ActivateFrame() method?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Yes, I did check them. this program is being compiled in VS.Net. Is .Net different enough from 6.0 that there would be something else to consider?
Garry
|
|
|
|
|
Zenix2 wrote:
Is .Net different enough from 6.0 that there would be something else to consider?
Since I do not use .NET, I cannot say.
You might want to create three projects, A and B and C, with one being initially minimized, one being initially maximized, and one being the default settings. Then compare the files to see where the difference is.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Good thought, thank you! It makes sense. I appreciate all your time.
Garry
|
|
|
|
|
Anyone can explain me what is the concept of data class. How it is different then the normal class.
|
|
|
|
|
I've never heard the term "data class" before but it sounds like it might be a struct .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
|
Hi All
I like to put my MFC MDI application into a dll. There will not be any supporting exes. Needs to bring the UI through some function call from dll.
I appreciate if anybody can help me with this.
|
|
|
|
|
Have you ever written a DLL in C++?
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Hi!
How can I create an owner draw progress bar in Win32 SDK(no MFC)?
|
|
|
|
|
Check the articles on this site. I believe there are one or two on this topic.
__________________________________________
a two cent stamp short of going postal.
|
|
|
|
|
Well maybe i'm crazy but when i want ot use the Windows SDK i find the Windows SDK DOCUMENTATION helpful
Progress Control
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Hello!
I wanna load the picture data from a tif or bmp pciture.
I have tried it with ifstream but when i read the file und "cout" the characters there are only smileys ...???
I have a picture, and i have to read the "Text" hwo crates the picture, because i have to put pics together and it shuold work when i crate a new header an insert the picture data in the right position...
That means i need a function who writes all the picture data out in a File or an char or int array or what ever....
Important is only that i can read and work with these datas in my application.
I hope you have understand what i mean and you can help me!
Thanks!
Greetings Ronny
|
|
|
|
|
|
I am calling CreateProcessWithLogonW to spawn a new process in WinXP and it takes about 45 seconds on my computer to load the new process....any idea why this is happening....??
It takes about 2 to 3 seconds for the same call to spawn a new process on Win 2000 machine.
|
|
|
|
|
ARe you spwaning the same process (exe) on both OS?
Kuphryn
|
|
|
|
|
Yes...it seems that the exe is not taking the time...it is the CreateProcessWithLogonW call that is taking the time....
|
|
|
|
|
How different are the login profiles of both accounts ? (i.e., the one on winXP and the one on win2K)
If one has more processes under HKCU->...->Run, then its normal that is requires more time.
Just a thought
DarkByte
|
|
|
|
|
It is a good thought indeed but for my case the user on both XP and 2000 are newly created standard users. They have been created from the User Management console in both OS.
|
|
|
|
|
I made a very simple class, and when the default destructor is called, i get a debug assertion failure. (i'm using VC++ SP5)
if i call a function like this
void Testfunction()
{
uImage test;
test.Create(100);
}
the function exits properly, with the default destructor deleting the arrays successfully, however,if i call a function like this, that is without allocating the arrays,
void Testfunction()
{
uImage test;
}
The function exits with a Debug Assertion Failure, _CrtIsValidHeapPointer
What i'm confused is that, i'm trying to do cleanup in the destructor by deleting all the dynamic arrays. Although i havent created the arrays, there should be no problem coz i checked whether the pointers are NULL or not (when performing delete). So, why is there a debug assertion?
My class header is
#ifndef UIMAGE_H
#define UIMAGE_H
class uImage
{
private:
int *R;
int *G;
int *B;
public:
uImage();
~uImage();
void Create(int x);
};
#endif
My Class is
#include "StdAfx.h"
#include "uImage.h"
uImage::uImage()
{
}
uImage::~uImage()
{
if(R!=NULL) delete R;
if(G!=NULL) delete G;
if(B!=NULL) delete B;
}
void uImage::Create(int x)
{
R=new int[x];
G=new int[x];
B=new int[x];
}
|
|
|
|
|
uus99 wrote:
if(R!=NULL) delete R;
if(G!=NULL) delete G;
if(B!=NULL) delete B;
Should be:
if(R!=NULL) delete [] R;
if(G!=NULL) delete [] G;
if(B!=NULL) delete [] B; The differences between delete and delete [] were discussed here about a week ago. Search this forum for that thread.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|