|
Anybody know where I can find a good example of creating docking windows in strait C? Cristi Posea has excellant source for MFC (http://www.codeproject.com/docking/sizecbar.asp), but I'd like to know what's going on underneath, and MFC source is kind of a pain to step through.
Thanks in advance,
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|
Hello,
How can we create controls on the fly and then place them in the client area of a window?
Any suggestions would be appreciated.
|
|
|
|
|
|
I'm using SHFileOperation to delete folders, as shown in the following code. However, there seems to be a problem with spurious "file in use" errors when I call this function on most folders in my system. These directories don't have any special properties that I can see via browsing, so I can't understand when the command fails.
Is there some catch or trick in this? Win2K, SP1, VC++ 6.
Thanks -
Jim
// Get the path
TCHAR szOldPath[_MAX_PATH];
ZeroMemory(szOldPath, sizeof(szOldPath)); // SHFileOperation requires a double-null terminator
SHGetPathFromIDList(m_pidl, szOldPath);
// Set up the file op
SHFILEOPSTRUCT fileOp;
fileOp.hwnd = AfxGetMainWnd()->GetSafeHwnd();
fileOp.wFunc = FO_DELETE;
fileOp.pFrom = szOldPath;
fileOp.pTo = "\0\0"; // NULL;
fileOp.fFlags = FOF_ALLOWUNDO | FOF_NOCONFIRMATION;
fileOp.fAnyOperationsAborted = FALSE;
fileOp.hNameMappings = NULL;
fileOp.lpszProgressTitle = NULL;
return(SHFileOperation(&fileOp) == 0);
|
|
|
|
|
I found the problem...
.. I had neglected to call Release() on an IEnumIDList that had been created to look at the folder contents. This marked the folder as in use. That was a fun one to trrack down!
|
|
|
|
|
How can I add resource(bitmap) from bmp file in my program so as the user will insert a path to his picture(bmp file) and the program will set it on the dialog form of oneself ???
|
|
|
|
|
|
Hi all.
If anybody have any news about VC++ 7.0, please tell me ...
About:
1- What is new in VC++ 7.0 ???
2- Why we must use of it instead VC++ 6.0 ???
And all other things about it ...
Thanks
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
ATL 3 now becoms ATL 7... It includes new features like Aggregation accros process boundaries. I didn't had the chance to experiment with it yet...
Another thing is of-course the ease of work with VC7... The user interface includes filetabs, code collapsing, and so on...
But I think the biggest change will be the managed extensions you can use (If this is an advantage, I have yet to find out)...
|
|
|
|
|
Hello,
I’m trying to write 3 strings out to a text file but I need each string to be on a separate line.. Here is what I have tried..
CFile fileEditText;
if(fileEditText.Open("c:\\text.txt",
CFile::modeCreate + CFile::modeWrite))
{
//Write out the full string
fileEditText.Write(
strFirstline+"\n\r"+strSecondline+"\n\r"+strThird+"\n\r",length.GetLength());
//Close the file
fileEditText.Close();
}
I've tried every combo of "\n" "\r" etc..
It still writes out the 3 strings in one continuous line in the text file..
Any help would be appreciated.
THANKS,
Rob
|
|
|
|
|
It's \r\n, not \n\r. You can also use CStdioFile, and then put just \n in your strings. CStdioFile::WriteString() automagically converts \n to \r\n for you.
--Mike--
http://home.inreach.com/mdunn/
#include "buffy_sig"
|
|
|
|
|
Is Easy.
CStdioFile fileEditText;
if(fileEditText.Open((LPCTSTR)("c:\\text.txt", CFile::modeCreate | CFile::modeWrite))
{
strFirstline += '\n';
fileEditText.WriteString(strFirstline);
strSecondline += '\n';
fileEditText.WriteString(strSecondline);
strThird += '\n';
fileEditText.WriteString(strThird);
fileEditText.Flush();
fileEditText.Close();
}
Cheers!!!!
Carlos Antollini.
|
|
|
|
|
Thanks!!!
|
|
|
|
|
Can anyone tell me how to remove the standard MDI window list in a CMDIFrameWnd ???
|
|
|
|
|
Ensure that your menu has none of the following items:
ID_WINDOW_NEW
ID_WINDOW_ARRANGE
ID_WINDOW_CASCADE
ID_WINDOW_TILE_HORZ
ID_WINDOW_TILE_VERT
ID_WINDOW_SPLIT
MFC searches through your menu (in CMDIChildWnd::OnUpdateFrameMenu) and uses the rightmost popup containing one of these items as Window menu - the one that gets the window list.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
I don't even have a Window menu... MFC places it on the bottom of my second-last menu... Even if this menu's name is "Test" for example... and my menu items names "Test1", "Test2", ... The Window list is put always on the bottom of them...
|
|
|
|
|
Do you understand the difference between menu item name and menu item ID? Changing the names will not help. If you have menu containing items with identifiers like ID_WINDOW_xxx, the window list will be appended. You have to change menu item identifiers.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
I do! I don't have a menu which has an ID that starts with ID_WINDOW_ ... As a matter of fact, MFC puts the window list on the "Test" menu's bottom... Which has the ID's: ID_TEST_TEST1 and ID_TEST_TEST2. My Child windows are created through the CMDIChildWnd class' Create method...
CSettingsDlg m_settDlg; // Derived from CMDIChildWnd
m_settDlg.Create(AfxRegisterWndClass(0, 0, (HBRUSH)COLOR_WINDOW), title, WS_CHILD | WS_VISIBLE | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU, r);
m_settDlg.ShowWindow(SW_SHOW);
|
|
|
|
|
Put the breakpoint in the line 871 of the file WINMDI.CPP located in vc98\mfc\src directory. The line contains this code:
return hMenuPop;
If your programs stops there, it means one of the following:
1) your menu has some ID_WINDOW_xxx id.
2) your ID_TEST ids have the same value as ID_WINDOW_xxx ones.
If breakpoints is not hit and you can see window list in your menu, something strange is going on...
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
The debugger doesn't even stop at the start of this function... It is never executed! And my ID-values are different I think I'm going crazy here
|
|
|
|
|
Did you override CMDIFrameWnd::OnUpdateFrameMenu or CMDIChildWnd::OnUpdateFrameMenu in your program? Or maybe you're explicitly calling CMDIFrameWnd::MDISetMenu?
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Nope, non of these three... If you have a few seconds time, I have send you a VERY small test-case (created within a few minutes from scratch using the MFC wizard) by mail (If you're upset for this, I'm sorry, but I'm quite desperate)...
|
|
|
|
|
OK, that was easy. Your app doesn't use doc/view architecture. To disable window menu, override OnCreateClient in your CMainFrame class, and put the following code inside:
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
return CreateClient(lpcs, NULL);
}
Just pass NULL as second parameter to CreateClient - this means that you don't want the Window menu.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Wow, Thanks !!!! I couldn't find this anywhere in the MSDN help files...
|
|
|
|
|
Can you please tell me how to hide/delete the window popup menu from the main menu if I am working with Doc/ View application? Thats really urgent, I am using the code like
CMenu *menuVault = this->GetMenu();
::DeleteMenu(menuVault->GetSafeHmenu(),9,MF_BYPOSITION);//9 is the position of Wondows menu
::DrawMenuBar(::AfxGetMainWnd()->m_hWnd);,
everything seems to be ok but menu bar is not getting refreshed or redrawn..... what could be worng????
Never complain,never explain,just do your work.
|
|
|
|