Given two processes, how can they share memory? Processes and thread are very similar but they differ in the way they share their resources. Processes are independent and have its own address space. If two independent processes want to communicate they do this by using the following techniques 1.Message Passing 2.Sockets 3. named pipes
How to restrict only one instance of a class object to be created? Create a Named Mutex. HANDLE hMutex=CreateMutex(TRUE,_T(“NamedMutex”))
How do I dynamically change the mainframe menu? CMenu newMenu; newMenu.LoadMenu (IDR_MENU1); AfxGetMainWnd()->SetMenu( &newMenu ); AfxGetMainWnd()->DrawMenuBar(); newMenu.Detach ();
Re: How to restrict only one instance of a class object to be created? And check the Mutex existence for each of your instance launch and dont allow it to launch if it exists.
Re: How to restrict only one instance of a class object to be created? This answer is sutable for restrict only one instance of a process, if u want make singleton class make custructor as private
Re: Given two processes, how can they share memory? simple one Use memory-mapped files to share data memory between processes
Re: What is the difference between ANSI Code and UNICODE ? ----------------- This is exactly true. A small correction in the above would be 'ANSI code represents 8bits( one byte) data where UNICODE represents 16bits (2 bytes) data for supporting universal languages.
Re: Given two processes, how can they share memory? to add one more techniques, if it is a windows based application, the simplest one is to use WM_COPYDATA message
1. What is the base class for MFC Framework ? CObject is the base class for almost all of the MFC classes.
Re: How to handle RTTI in MFC ? RTTI in MFC can be done using RUNTIME_CLASS Macro in conjunction with CObject's IsKindOf member function. The argument to IsKindOf is a CRuntimeClass object, which you can get using the RUNTIME_CLASS macro with the name of the class.
Re: What is a message map, and what is the advantage of a message map over virtual functi Message Maps, maps the user action in to the appropriate MFC class functions to handle it. The MFC Class which can handle message should be member of CCmdTarget, (i.e) it should be hierarchically derived from CCmdTarget. The BEGIN_MESSAGE_MAP macro at the start of the message map specifies two class names as its arguments: BEGIN_MESSAGE_MAP(CMyView, CView) The first argument names the class to which the message map belongs. The second argument provides a connection with the immediate base class — CView here — so the framework can search its message map, too. The message handlers provided in a base class are thus inherited by the derived class. This is very similar to normal virtual member functions without needing to make all handler member functions virtual which is an advantage since overhead of creating VTable is eliminated. If no handler is found in any of the base-class message maps, default processing of the message is performed. If the message is a command, the framework routes it to the next command target. If it is a standard Windows message, the message is passed to the appropriate default window procedure.
Re: Name the Synchronization objects ? Some additin to Que - Why we need 4 types of synchronization objects ? What is the exact diff between these?
Re: What is CSingleDocTemplate? What is the diff between SDI/MDI and Dialog based app? Is Dialog based app support Doc/View Arc?
Re: How to restrict only one instance of a class object to be created? delcare the structure function as private create a static instance as private a static function return the point to the instance like class MyClass { public: ~MyClass(); static MyClass* GetInstance(){static MyClass instance; return &instance} private: MyClass(); };