If you run an MDI application you would see a new empty document opened when you run the application. We can prevent the application to open such empty document by making a simple change in InitInstance( ) function as shown below:
BOOL CNoemptydocApp::InitInstance( )
{
// AppWizard generated code
CCommandLineInfo cmdInfo ;
cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing ;
ParseCommandLine ( cmdInfo ) ;
// [...]
How to prevent an MDI application to open a new document at startup?
How to enumerate network resources using VC++ ?
Microsoft Windows provides several functions (called WNet functions) that help us in implementing networking capabilities in our application. In this article we will see how to use the WNet functions to connect and disconnect the remote drive programmatically. We would also see how to enumerate the resources connected to the network.
Create a dialog-based [...]
Full Story »How to expand the Macros provided by MFC in your source code ?
MFC provides number of macros to us such as RGB, DECLARE_MESSAGE_MAP, BEGIN_MESSAGE_MAP etc. If we want to see what goes inside these macros we can see the expanded code of our program. For this, Select Project menu | Settings | Link tabs. In the ‘Project Options’ edit box delete all the options and type /EP [...]
Full Story »Windows Programming Questions
How would you find the brushes or fonts used by the system to draw menus, dialog boxes and text?
How would you start a new thread?
Afxbeginthread – for worker thread only global fuction passed as parameter
For ui thread , a class derived from CWinThread passed as parameter
When should an application call _beginthread rather than CreateThread?
If apliation [...]