|
After further review, I realized that other people using the Docking control bars were also haveing this same problem, with the docking control bar going under the status bar when it is on the bottom. Any one know of a way around this?
LOSTTWARE.com
|
|
|
|
|
It sames that u should initialize status bar before initializing ur docking views in CMainFrame::OnCreate().
I'm a student in China, and have been learning PC for 7 years. But till now, I'm still a learner.
|
|
|
|
|
Thank you, that worked.
LOSTTWARE.com
|
|
|
|
|
Is there anyway I can know when a file (whose name I know only) is opened or closed?
Using hooks or something...? Does windows maybe send a WM_CLOSEFILE message when you use windows API? I guess that wouldn't work incase someone used crt functions
ANyways...if anyone knows of a way I can get file status...i'd appreciate it...thanks
Cheers
The word of the day is legs, let's go back to my house and spread the word
|
|
|
|
|
You should try opening the file, by the error status you can determine all the things about the file.... if no error, you have the file opened, you can use it.
The World is getting smaller and so are the people.
|
|
|
|
|
I'll look into it, thanks
The word of the day is legs, let's go back to my house and spread the word
|
|
|
|
|
Take a look at ReadDirectoryChanges in MSDN.
With this function you can monitor a directory for file changes, and you can also receive info about which file has changed. Watch for FILE_NOTIFY_CHANGE_LAST_ACCESS
Peter Molnar
|
|
|
|
|
if you use ifstream try if ( YourFile.is_open() ) // bla bla bla
|
|
|
|
|
Ok, I've set up my dialog-based mfc app to start up the main window as a modeless dialog. Now in my OnInitDialog function, I need to be able to exit the entire program, depending on the outcome of a test I do. What would be the best way to do this?
Thanks,
Dave
|
|
|
|
|
Just return FALSE, you app will terminate before it is poped.
The World is getting smaller and so are the people.
|
|
|
|
|
|
char chr[100];
strcpy( chr, "oh,my god,give u a long word" );
chr[5] = '\0';
Joise is a C++ fun!
|
|
|
|
|
No - the array has been allocated on the stack, so there is no need to delete it (in fact deleting it is an error).
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
thx so much,i know it now
Joise is a C++ fun!
|
|
|
|
|
No it is not possible to have a leak, char[100] allocate memory on the stack, when you exit function memory will be simply popped.
In fact if you had allocated memory with:
a = malloc(100); a[1] = NULL; free(a);
you would not be leaking, de-allocator knows what size you allocated.
|
|
|
|
|
thx,i got it
Joise is a C++ fun!
|
|
|
|
|
Hi,
I am trying to change the dialog font programmatically. The dialog right now is created using a Resource file, and the font size and face is hard-coded. I would like to be able to change the font face and size in the OnInitDialog() function. So far this is what I have:
HFONT hFont;
LOGFONT lf;
CFont pFont;
short int fRedraw= FALSE;
memset(&lf, 0, sizeof(LOGFONT));
hFont = (HFONT) GetStockObject( SYSTEM_FONT );
GetObject(hFont, sizeof(lf), &lf);
pFont.CreateFontIndirect(&lf);
this->SetFont(&pFont, true);
SendMessageToDescendants(WM_SETFONT, (WPARAM)pFont.m_hObject, MAKELONG ((WORD) fRedraw, 0), TRUE);
This is changing the font size and face for the CONTROLS of the dialog. However, it does not change anything elose besides that.
I tried to do a this->SetFont, however, this does not help. I need the dialog itself to be resized accordingly, and also regular CText. When the font is changed in the resource file, I notice that the dialog size itself changes, however, this is not happening when I call SetFont or send a WM_SETFONT message.
Can anyone help me?
Thanks!!!
|
|
|
|
|
Do you want to change the main dialog of a dialog based app or a dialog that is part of a doc view app? Do you want to change the dialog after it is already created or have a different font at creation depending a factor such as screen resolution, etc.?
|
|
|
|
|
I've found the answer:
int CSimpleDialog::DoModal()
{
CDialogTemplate dlt;
int nResult;
// load dialog template
if (!dlt.Load(MAKEINTRESOURCE(CSimpleDialog::IDD))) return -1;
// set your own font, for example "Arial", 10 pts.
dlt.SetFont("Arial", 10);
// get pointer to the modified dialog template
LPSTR pdata = (LPSTR)GlobalLock(dlt.m_hTemplate);
// let MFC know that you are using your own template
m_lpszTemplateName = NULL;
InitModalIndirect(pdata);
// display dialog box
nResult = CDialog::DoModal();
// unlock memory object
GlobalUnlock(dlt.m_hTemplate);
return nResult;
}
|
|
|
|
|
hi,
i want to know any method to download the gdiplus documentation for C++. i just want to develope with gdi+ and i don't want to install the whole big platform SDK. i got all header files and library but not the documentation.
any help?
regards,
jim
|
|
|
|
|
Hi, does anybody know of a Windows Media COM interface that I could use to rip CDS. It seems this comes with Media Player these days, so I'm hopping there'll be an interface I can use.
Thanks.
Festina, vita breve est!
|
|
|
|
|
In another word, can I avoid using DSN to connect to an Oracle database? My office has all the securities configured that it requires Admin right to access the ODBC configuration dialog.
Elizabeth
|
|
|
|
|
No problems with ADO:
"Provider=msdaora;Data Source=dbsid;User ID=user;PASSWORD=flag;Persist Security Info=True;";
|
|
|
|
|
can anyone tell me to create a program that can tell the difference between to dates. Even leap years?
I really need help. I have been trying to do it for the past two weeks and I still get errors.
|
|
|
|
|
Helps to post exactly what you're having problems with.
|
|
|
|