This is a discussion on Visual C++ Tips & Tricks within the C and C++ Programming forums, part of the Software Development category; How to get the sub menu handle? Here is the tips for getting the Sub menu handle... CMenu *m_lMenu; // A ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#11
| |||
| |||
| How to get the sub menu handle? Here is the tips for getting the Sub menu handle... CMenu *m_lMenu; // A pointer to the menu CPoint m_pPoint; // A copy of the mouse position // Copy the mouse position to a local variable m_pPoint = point; // Convert the position to a screen position ClientToScreen(&m_pPoint); // Get a pointer to the window menu m_lMenu - GetMenu(); // Get a pointer to the first submenu m_lMenu = m_lMenu->GetSubMenu(0); // Show the Popup Menu m_lMenu->TrackPopupMenu(TPM_CENTERALIGN + TPM_LEFTBUTTON, m_pPoint.x, m_pPoint.y, this, NULL); thanks ![]()
__________________ Karpagarajan. R Necessity is the mother of invention |
|
#12
| |||
| |||
| When i tried to create a dll in c using visual c++ compiler i received these errors, LNK2001: unresolved external symbol _main Debug/windll.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. The actual reason for the above problem is... The problem is creating a executable file hence the compiler is looking for the main method.. Inorder to create a DLL file u have to some manipulation in the project properties. i.e open project properties window and select the link tab. change the output file from exe to DLL and the "Project Options" text box change the "subsytem console" to "dll" After setting this in the project properties, the program was compiled successfully. thanks ![]()
__________________ Karpagarajan. R Necessity is the mother of invention Last edited by Booom : 08-09-2007 at 04:39 AM. |
|
#13
| |||
| |||
| hi, Do you know How to change the cursor in a form? Here is the simple tips for changing the cursor. Add the WM_SETCURSOR message handler . LRESULT OnSetCursor(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)thanks ![]()
__________________ Karpagarajan. R Necessity is the mother of invention |
|
#14
| |||
| |||
| The following code is used to convert the mouse pos to the client pos. Useful one. POINT point; GetCursorPos(&point); ScreenToClient(&point); If you find any tips and tricks, please post your idea here. ![]()
__________________ Karpagarajan. R Necessity is the mother of invention |
|
#15
| |||
| |||
| Compiler Problem My compiler(VC++ 6) never accepts cin >> str1 if str1 is declared as a string . the following program gives error. #include <iostream.h>Solutions : Change "#include <iostream.h>" to "#include <iostream>". Use the newer standard headers such as iostream, string and fstream instead of iostream.h, string.h and fstream.h. Mixing older and new style headers causes compilation problems such as I experienced. thanks ![]()
__________________ Karpagarajan. R Necessity is the mother of invention |
|
#16
| |||
| |||
| Here is one tip: You can view whitespace (tabs and spaces) in your source files by clicking advanced on the Edit menu and then clicking view Whitespace thanks ![]()
__________________ Karpagarajan. R Necessity is the mother of invention |
|
#17
| |||
| |||
| Hi, You can use Visual C++ debugger window in different situation. It is very useful one to trace your code errors. The Debugger windows support intelligent drag & Drop where the result depends on the drop location. For example, you can add a variable to the Watch Window by dragging it from the variables window or view the memory contents by dragging a variable to the memory window. thanks ![]()
__________________ Karpagarajan. R Necessity is the mother of invention Last edited by Booom : 08-09-2007 at 04:40 AM. |
|
#18
| |||
| |||
| About Macros When creating objects that derive directly or indirectly from CObject, such as CFrameWnd, you should let the compiler know that you want your objects to be dynamically created. To do this, use the DECLARE_DYNCREATE and the IMPLEMENT_DYNCREATE macros. The DECLARE_DYNCREATE macro is provided in the class' header file and takes as argument the name of your class. An example would be DECLARE_DYNCREATE(CTheFrame). Before implementing the class or in its source file, use the IMPLEMENT_DYNCREATE macro, passing it two arguments: the name of your class and the name of the class you derived it from.thanks ![]()
__________________ Karpagarajan. R Necessity is the mother of invention Last edited by Karpagarajan : 03-29-2007 at 01:16 PM. |
|
#19
| |||
| |||
| Marshalling Library and Vista Development with Visual C++ The latest Channel 9 video by the Visual C++ team has just been released. This video features Sarita Bafna, a PM on the libraries team, talking about a few of latest features which are previewed in the March CTP: MFC support for Vista IDE support for Vista Native-Managed Marshalling Library “MFC support for Vista” includes support for new Vista file dialogs, support for the new controls specifically for Vista and support for additional Windows messages (including some for XP) that had not previously been supported by MFC etc. The IDE Support for Vista includes support for the new controls and high quality graphics in the Resource Editor, support for enabling UAC for VC++ apps etc. The Native-Managed Marshalling Library supports marshalling strings between native-managed code and includes an extensibility model so you add support for your own types. This video includes a demonstration of the VC++ features to support Vista development. thanks ![]()
__________________ Karpagarajan. R Necessity is the mother of invention Last edited by Booom : 08-09-2007 at 04:40 AM. |
|
#20
| |||
| |||
| Tips1: The Compiler options /Yc and /Yu (Create and Use specific procompiled header) provide the most efficient precompiled header management. Tips2: By pressing F2 and Shift F2 to go to Next and previous source file Bookmark thanks
__________________ Karpagarajan. R Necessity is the mother of invention Last edited by Karpagarajan : 04-06-2007 at 04:05 AM. |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| C# .Net Tips & Tricks | oxygen | C# Programming | 85 | 01-08-2009 12:25 AM |
| SAP Tips & Tricks | leoraja8 | Operating Systems | 0 | 03-29-2008 12:11 AM |
| Visual Studio Tips & Tricks | SaravananJ | C# Programming | 197 | 12-20-2007 03:25 AM |
| PHP Tips and Tricks | Sabari | PHP Programming | 20 | 12-18-2007 05:26 AM |
| .NET tricks & Tips | Karpagarajan | VB.NET Programming | 1 | 04-23-2007 08:17 AM |
Our Partners |