Have a look here http://www.flounder.com/workerthreads.htm[^]
Mario M 0
Posts
-
make dialog responsive even if it is running a time consuming calculation -
Swap file on RAM disk?I have 1 GB RAM too and i reduced the swap file to 0. so 0 fragmentation. Now i don't wait for hard disk, hard disk does wait for me :laugh: . Try it, your computer looks faster. Swap file on windows should be forbidden. Make me :zzz:
-
How can I display a "save" dialog like GetFileNameFromBrowse does?how can i display a save dialog with the same w2000 style, like explorer or notepad does? is there any function like GetFileNameFromBrowse. It looks easy and why not for save.
TCHAR szFile[_MAX_PATH]=_T(""); // buffer for file name TCHAR *szFilters=_T("Files (*.fil)\0*.fil\0All\0*.*\0"); TCHAR *szTitle=_T("Open"); GetFileNameFromBrowse(GetSafeHwnd(), szFile, sizeof(szFile), NULL, NULL, szFilters, szTitle)
Thanks.
-
How to get a view the size of a formview?I need a view get the size of a formview, not the form size to the view. I know the second option is using RecalcLayout and ResizeParentToFit, and the first option how? Thanks.
-
Error using GetOpenFileName in debug version, and not in releaseoh my God what a silly bug :wtf: some hours later i find the solution :-D, there was an uninitialited variable
char szFile[512]="";
-
Error using GetOpenFileName in debug version, and not in releaseIm trying this code in a dialog with only a button when you push it this code is executed:
void CBorradlgDlg::OnButton1() { // TODO: Add your control notification handler code here OPENFILENAME ofn; // common dialog box structure char szFile[512]; // buffer for file name char title[]="Title openfilename"; // Initialize OPENFILENAME //ZeroMemory(&ofn, sizeof(ofn)); ofn.lStructSize = sizeof(ofn); ofn.hwndOwner = GetSafeHwnd(); ofn.lpstrFile = szFile; ofn.nMaxFile = sizeof(szFile); ofn.lpstrFilter = "Object\0*.obj\0All\0*.*\0Text\0*.TXT\0"; ofn.nFilterIndex = 1; ofn.lpstrFileTitle = NULL; ofn.nMaxFileTitle = 0; ofn.lpstrInitialDir = NULL; ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; ofn.hInstance=0; ofn.lpstrCustomFilter=NULL; ofn.nMaxCustFilter=0; ofn.lpstrTitle=(LPSTR)title; ofn.nFileOffset=0; ofn.nFileExtension=0; ofn.lpstrDefExt=".obj"; ofn.lCustData=0L; ofn.lpfnHook=NULL; ofn.lpTemplateName=NULL; // Display the Open dialog box. if(GetOpenFileName( &ofn ) != TRUE) { DWORD Errval=CommDlgExtendedError(); switch(Errval) { case CDERR_DIALOGFAILURE: AfxMessageBox("CDERR_DIALOGFAILURE "); break; case CDERR_FINDRESFAILURE: AfxMessageBox("CDERR_FINDRESFAILURE "); break; case CDERR_NOHINSTANCE: AfxMessageBox("CDERR_NOHINSTANCE "); break; case CDERR_INITIALIZATION: AfxMessageBox("CDERR_INITIALIZATION "); break; case CDERR_NOHOOK :AfxMessageBox("CDERR_NOHOOK "); break; case CDERR_LOCKRESFAILURE: AfxMessageBox("CDERR_LOCKRESFAILURE "); break; case CDERR_NOTEMPLATE: AfxMessageBox("CDERR_NOTEMPLATE "); break; case CDERR_LOADRESFAILURE: AfxMessageBox("CDERR_LOADRESFAILURE "); break; case CDERR_STRUCTSIZE: AfxMessageBox("CDERR_STRUCTSIZE "); break; case CDERR_LOADSTRFAILURE: AfxMessageBox("CDERR_LOADSTRFAILURE "); break; case FNERR_BUFFERTOOSMALL: AfxMessageBox("FNERR_BUFFERTOOSMALL "); break; case CDERR_MEMALLOCFAILURE: AfxMessageBox("CDERR_MEMALLOCFAILURE "); break; case FNERR_INVALIDFILENAME: AfxMessageBox("FNERR_INVALIDFILENAME "); break; case CDERR_MEMLOCKFAILURE: AfxMessageBox("CDERR_MEMLOCKFAILURE "); break; case FNERR_SUBCLASSFAILURE:AfxMessageBox("FNERR_SUBCLASSFAILURE "); break; } } }
Debug version throws CDERR_INITIALIZATION error :confused: Release version works fine :) where is the error? Im using XP VC6 SP5 Thanks.
-
How to make and MDI child window resizeable for a concrete sizeThanks, I handle WM_GETMINMAXINFO in CChildFrame::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI){ // TODO: ..... lpMMI->ptMinTrackSize.x = 200; lpMMI->ptMaxTrackSize.x = 500; } it works but now i have a problem :confused:, I size the window to the min pixel size I choose, all ok, but then I try to make the window bigger traking it the traking border of the window not appear. why this problem? I use XP.
-
How to make and MDI child window resizeable for a concrete sizeI want a MDI child window to be resizeable not less than 200 not bigger than 500 pix for example, and only height. When you size the window less than that 200 pix the application should make the window 200 height, when you size to 300 pix won´t do anything, and when it will be bigger than 500 size to 500. I think it should be done on OnSize function but i dont know how. Other option is let sizing window in this interval 200-500 and when reach it 200 or 500 stop sizing. help would be appreciate, thanks.