This is a discussion on Visual C++ Tips & Tricks within the C and C++ Programming forums, part of the Software Development category; Aligning Text... The following example draws text in a rectangle. Each line of text is centered (side to side), and ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#41
| |||
| |||
| Aligning Text... The following example draws text in a rectangle. Each line of text is centered (side to side), and the entire block of text is centered (top to bottom) in the rectangle. WCHAR string[] = L"Use StringFormat and RectF objects to center text in a rectangle.";bye thanks... ![]()
__________________ Karpagarajan. R Necessity is the mother of invention |
|
#42
| |||
| |||
| creating directory with user access persmission Hi friends, here I have given the code for creating directory with user access persmission. Very useful one. This code I got from Platform SDK -> Security section. #define _WIN32_WINNT 0x0500bye thanks
__________________ Karpagarajan. R Necessity is the mother of invention |
|
#43
| |||
| |||
| WM_MESSAGE => KILL_FOCUS Hi Buddies, here I am giving the solution for ActiveX control illegal closing of Internet explorer. I had found this problem in my activex which was used in web development. The IE was closed with the Illegal error closing message. When I try to find out the problem in debug mode, I had found that there was stack point in my variable assignment statement in VC++. The error happens because of the memory variable not been destroyed after the control was destroyed. The memory was not flushed after the activex control unloaded. I just check the flag in activex WM_MESSAGE => KILL_FOCUS. Hope it may help you in activex coding part. ........... bye thanks ![]()
__________________ Karpagarajan. R Necessity is the mother of invention |
|
#44
| |||
| |||
| Hi buddies, You can use the following steps to maintain the version in ATL activeX control. 1. Open your Visual C++ ATL project workspace in VC++ IDEby changing these two keys you can maintain your activex control versioning. .............. bye thanks ![]()
__________________ Karpagarajan. R Necessity is the mother of invention Last edited by Booom : 08-09-2007 at 05:44 AM. |
|
#45
| |||
| |||
| ASSERTION An assertion statement specifies a condition that you expect to hold true at some particular point in your program. If that condition does not hold true, the assertion fails, execution of your program is interrupted, and the Assertion Failed dialog box appears. MFC and C Run-Time Library Assertions When the debugger halts because of an MFC or C run-time library assertion, it navigates to the point in the source file where the assertion occurred (if the source is available). The assertion message appears in the Output window as well as the Assertion Failed dialog box. You can copy the assertion message from the Output window to a text window if you want to save it for future reference. The Output window may contain other error messages as well. Examine these messages carefully, because they provide clues to the cause of the assertion failure. _DEBUG Assertion statements compile only when _DEBUG is defined. When _DEBUG is not defined, the compiler treats assertions as null statements. Therefore, assertion statements have zero overhead in your final release program; you can use them liberally in your code without affecting the performance of your Release version and without having to use #ifdefs. ............... thanks ![]()
__________________ Karpagarajan. R Necessity is the mother of invention |
|
#46
| |||
| |||
| To enable debugging of a release build, change the following release build options in VC++ 1. On the Project menu, choose Settings. 2. Next to Settings for, select the configuration. 3. In the project tree, under Settings for, select a project. 4. Choose the C/C++ tab. 5. In the Category drop-down box, choose General. 6. In the Debug info drop-down box, choose Program Database. 7. In the Optimizations drop-down box, choose Disable (Debug). 8. On the Link tab, select the Generate Debug Info checkbox. These selections correspond to the /Od and /Zi options, which turn off optimizations and place debug information in the build. After doing this, rebuild and test your program. If the program works fine, it is still possible that you have a memory overwrite, but it is also possible that the optimizations are causing problems on a particular piece of code. ........... thanks bye ![]()
__________________ Karpagarajan. R Necessity is the mother of invention |
|
#47
| |||
| |||
| __uuidof Operator The __uuidof keyword retrieves the GUID attached to the expression. __uuidof ( expression ) The expression can be a type name, pointer, reference, or array of that type, a template specialized on these types, or a variable of these types. The argument is valid as long as the compiler can use it to find the attached GUID. A special case of this intrinsic is when either 0 or NULL is supplied as the argument. In this case, __uuidof will return a GUID made up of zeros. Use this keyword to extract the GUID attached to: An object by the uuid extended attribute. A library block created with the module attribute. The following code (compiled with ole32.lib) will display the uuid of a library block created with the module attribute: // expre_uuidof.cppIn cases where the library name is no longer in scope, you can use __LIBID_ instead of __uuidof. For example: StringFromCLSID(__LIBID_, &lpolestr); ................. thanks ![]()
__________________ Karpagarajan. R Necessity is the mother of invention |
|
#48
| |||
| |||
| From CString to char conversion... Void CStrtoChar() { CString str = " test "; char *p = new char [ str.GetLength () +1 ]; strcpy(p ,str); delete p; } ............... thanks ![]()
__________________ Karpagarajan. R Necessity is the mother of invention |
|
#49
| |||
| |||
| Check the image file as JPEG... Hi buddies, here is the code to check the given file format is JPEG. Useful one... Bitmap bm(L"Picture.dat");............. thanks ![]()
__________________ Karpagarajan. R Necessity is the mother of invention |
|
#50
| |||
| |||
| Disable mouse wheel scrolling Dear Visual C++ Friends, here is the trick To disable mouse wheel in comboBox (MFC) Use it in place of your combobox control, capture the mousewheel messages WM_MOUSEWHEEL and then don't forward them to the base class... .......... thanks ![]()
__________________ Karpagarajan. R Necessity is the mother of invention Last edited by Booom : 08-09-2007 at 05:45 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 01:25 AM |
| SAP Tips & Tricks | leoraja8 | Operating Systems | 0 | 03-29-2008 01:11 AM |
| Visual Studio Tips & Tricks | SaravananJ | C# Programming | 197 | 12-20-2007 04:25 AM |
| PHP Tips and Tricks | Sabari | PHP Programming | 20 | 12-18-2007 06:26 AM |
| .NET tricks & Tips | Karpagarajan | VB.NET Programming | 1 | 04-23-2007 09:17 AM |
Our Partners |