hello, I want to know what is the difference between debug mode and release mode. I started adn finished my project in release mode, how would it be different if it was done in debug mode. Thanks,
karmendra_js
Posts
-
DEBUG AND RELEASE MODE -
SchedulerI need to create a scheduler which does a function (display message) at the specified time. and it should be able to run at the background in the system try. How can i do this. A link or code snippet will be useful. I already have a SDI application and i have the display message function in it i need to call at scheduled time and it should be able to minimize to system tray. Thanks,
-
dbt.hhere is an strange problem. i included a header file Now i used some of the structures defined in it. when i right click on structure name and click goto definition it take me to dbt.h and show the definition. but when i build the application it gives error saying undefined refrence for the same structure. Why is this happening. What is the solution. Thanks
-
Exiting an applicationI want to exit an application programatically i will use exit(0); But some how i feel if i do this with MFC application, its not a good thing. Can anyone tell me is it a safe way to exit an MFC application. If any other approach is there plz let me know. Thanks a lot
-
abstract base classHow about making the constructor protected. If you do that it will be accessed only in derived class. Note: I never tried to do so. Why do you try and let me know too. Regards
-
protected, public and privateI just got a lil confussed here. I want to access a variable using the object of the class.
classXYZ objectname= new classXYZ(); objectname.variablename=100;
so which access specifier is best for variablename. Thanks. -
ListCtrlI want to do it programatically. It is in LVS_REPORT style. What you are saying is for ListBoxCtrl. Thanks
-
Globals and namespaceI am using some object refrence and boolean variables, these are declared golbally. I know this isn't a good practice but, it is required. I want to know Can i use nampespace to store these globals and is it of any importance. Also I don't know how to create and use namespace. Can you help me plz.
-
ListCtrlHi, I want to disable multiple row select in a list control. It should select only one row at a time how can i do this. Thanks
-
Convert CString to LPCTSTRI am really sorry Mr. toxcct. Usually i search for article and i search in forum. But this time i didnot find anything in message search (LPCTSTR and LPCSTR string miss match). And its my mistake that i just overlooked the thread below. And i am happy that first reply of those threads posted by Rage helped me. Thanks and Sorry:rose: :)
-
Convert CString to LPCTSTRhi, Can you plz tell me how to Convert CString to LPCTSTR. Thanks a lot.:rose:
-
How to activate OnFileNew()?well friend, i will not go in detail of message handling, but i will concentrate on your basic problem of Starting a new document whenever you click File->New. When you use App Wizard and create a single document app, it automatically does it for you. And if you wnat to do something else on file->new (like automatically saving the previous file without prompting etc anything) then you and Message handler using the Class Wizard to your Mainframe or any view class. Hope that make things clearer, if not make post.:rose: hey did you forget to rate? Plz rate my reply.
-
file handlingthanks for your suggestions, still i have some things to clarify. I have just 256 addresses so i will go with rewriting the file. But to do this i need to save the rest of the file temporarily, what do you think the data structure i have to use to do this. Thanks again.
-
file handlingi am saving some data to file(CStdio class) in the following format. Address1-Description1 Address2-Description2 Address3-Description3 When ever i want to retrive data i search for the address and get the description. Now when i change the description, it is required that i replace the old description with the new one. One way is to re create the whole file again the only change of new description. This is really inefficient. Can you tell me some nice logic to do this Thanks a lot
-
Diff between CFile and CStdioFilehi, Can you tell me what is the Diff between CFile and CStdioFile. when to use each of these. Thanks.
-
Modeless dialog communicating with parent dialogwell if u don't know much threading then you are same as i was a month back. For threading search codeproject articles ( i don't have collection of it to tell you). any way i will paste my code here if you can make sense out of it.
//defined in CMainFrame class DlgProgress *dlglocprog; //this type of threading is used forcalling a member function in a seperate thread //This thread function calls a member function FunctionClients of class MainFrm DWORD WINAPI PseudoThreadFunction( IN LPVOID vThreadParm ) { CMainFrame* pThreadParam = ( CMainFrame* ) vThreadParm; pThreadParam->FunctionClients(); return 1; } //This Funnction will call PseudoThreadFunction() as a new thread. bool CMainFrame::ExecuteLocateThread(void) { HANDLE hThread = NULL; DWORD dwThreadID = 0; int nTimeout = 5000; try { hThread = CreateThread( NULL, // Pointer to thread security attributes 0, // Initial thread stack size, in bytes PseudoThreadFunction, this, // The argument for the new thread is a pointer to your MyThread 0, // Creation flags &dwThreadID ); // Pointer to returned thread identifier } catch( CException* /* pException */ ) { return false; } bool bFinished = false; do { DWORD dwWaitResult = MsgWaitForMultipleObjects( 1, & hThread, FALSE, nTimeout, QS_ALLEVENTS | QS_SENDMESSAGE); switch ( dwWaitResult ) { case WAIT_OBJECT_0 : case WAIT_ABANDONED_0 : { bFinished = true; break; } case WAIT_OBJECT_0 + 1 : // message(s) in queue { MSG msg; while ( ::PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE ) == TRUE ) if ( !AfxGetApp( )->PumpMessage( ) ) { ::PostQuitMessage( 0 ); } break; } default : { bFinished = true; } } } while ( ! bFinished ); return true; } void CMainFrame::FunctionClients(void) { for(unsigned short addr=1;addr<256;addr++) { vi_Progress=addr; dlglocprog->IncrementProgress();//Increments the progress value and updates the message Sleep(10); } dlglocprog->EndDialog(0);//ShowWindow(SW_HIDE);//DestroyWindow();// b_LocateProgress=false; } void CMainFrame::OnClientoptionsLocateallactiveclients() { // TODO: Add your command handler code here if(!b_LocateProgress) { b_LocateProgress=true; dlglocprog = new CLocateProgress(); dlglocprog->Create(IDD_LOCATING_CLIENTS); dlglocprog->ShowWindow(SW_SHOW); dlglocprog->Ce
-
Modeless dialog communicating with parent dialoghey buddy you need not do all this. just Change the ID of the static message from IDC_STATIC to anything else (IDC_TEXT). now go to class wizard and add a CString variable (msg) for IDC_TEXT. now when ever you want to update it just say
UpdateData(true); msg="new messgae" UpdateData(false);
:) Tell me if it works, yaa don't forget to rate it.
-
Modeless dialog communicating with parent dialoghi, I am not an expert but i have experinced through your knid of problem. here when you create the dialog box, you see there is an option redraw in its properties. Try executing it after changing the redraw property to no redraw. If then also it doesn't work, following is the solution (This is what i used). what i did was i created the modeless dialog box in the main thread and started a new thread. this new thread will do the work i wanted and then it calls the incrementprogress function of the dialog box class. Now the problem here is in the thread the dilog object wont be visible. to do this 1. easiest, you can delare the dialog object golbal. 2. recomended, you pass the object reference(this pointer) to the thread parameters. Tell me if it works, an ya don't forget to rate it.:-D
-
file filteringi wnat to create a file to store a list of ids and name. the logic should be such that when i give id it should return name. so what kind of storage format i should go for to make my retrival easy.
-
Serializing Data to fileoh god i am really sorry, I found the error. When i inserted the serialization using the class wizard it inserted the code as follows
if (ar.IsStoring()) { // storing code ar >> m_strName; ar >> m_nIndex; } else { // loading code ar << m_strName; ar << m_nIndex; }
note IsStoring there. and in the article the same function is as follows
if (ar.IsLoading()) // If you are loading data from the disk { ar >> m_strName; ar >> m_nIndex; } else // If you are storing data to the disk { ar << m_strName; ar << m_nIndex; }
note IsLoading here. My mistake was i used the wrong indirection. Make a note of it and never do such a stupid mistake. I wasted 5 hours on this. :((