IT Community - Software Programming, Web Development and Technical Support

Visual C++ Tips & Tricks

This is a discussion on Visual C++ Tips & Tricks within the C and C++ Programming forums, part of the Software Development category; Hi, What is IDL stands for in ATL? ok Before that what is the ATL stands for? ATL is Active ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C and C++ Programming

Register FAQ Members List Calendar Mark Forums Read
  #61 (permalink)  
Old 08-22-2007, 07:09 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 299
Karpagarajan is on a distinguished road
Default Re: VC++ Tips & Tricks

Hi,

What is IDL stands for in ATL? ok Before that what is the ATL stands for?

ATL is Active Template Library. IDL is Interface Description Language.

It will be better to understand the meaning of the short name first.

thanks
__________________
Karpagarajan. R
Necessity is the mother of invention
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #62 (permalink)  
Old 08-29-2007, 05:13 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 299
Karpagarajan is on a distinguished road
Smile Re: Visual C++ Tips & Tricks

VC++ Resource Editor

When working with resources, use Close on the File menu to close the whole resource script and all resource windows. Use Close on the Window menu to close just one resource.

You can press Ctrl+7 to create a new accelerator-table resource.

thanks
__________________
Karpagarajan. R
Necessity is the mother of invention
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #63 (permalink)  
Old 08-30-2007, 01:33 AM
prince prince is offline
D-Web Trainee
 
Join Date: Aug 2007
Posts: 1
prince is on a distinguished road
Default Re: Visual C++ Tips & Tricks

hi All...i m new in this community....hoping ur valuable support


THANKS

Last edited by prince : 08-30-2007 at 01:42 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #64 (permalink)  
Old 08-30-2007, 02:12 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 299
Karpagarajan is on a distinguished road
Smile Re: Visual C++ Tips & Tricks

Hi Prince,

Welcome to our community. Here we can discuss about the VC++ and it's wonder features. May I know where are you from? And Which platform you are working on?

We will surely give our full support to you and lets get benefit from this community.

thanks
__________________
Karpagarajan. R
Necessity is the mother of invention
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #65 (permalink)  
Old 09-07-2007, 01:57 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 299
Karpagarajan is on a distinguished road
Smile Re: Visual C++ Tips & Tricks

Hi,

Here is the tips to change the color of the selection margin, to do so, Choose options from the tools menu and click format.In the colorbox, click selection margin and select colors you want.

thanks
__________________
Karpagarajan. R
Necessity is the mother of invention
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #66 (permalink)  
Old 09-07-2007, 10:29 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 299
Karpagarajan is on a distinguished road
Smile Re: Visual C++ Tips & Tricks

The TRACE statement

The TRACE macros have a few cousins - namely the TRACE0, TRACE1, TRACE2 and TRACE3 macros. These macros allow you to specify a format string (as in the normal TRACE macro), and either 0,1,2 or 3 parameters, without the need to enclose your literal format string in the _T() macro. For instance,

Quote:
TRACE(_T("This is trace statement number %d\n"), 1);
can be written

Quote:
TRACE1("This is trace statement number %d\n", 1);
thanks
__________________
Karpagarajan. R
Necessity is the mother of invention
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #67 (permalink)  
Old 09-08-2007, 07:05 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 299
Karpagarajan is on a distinguished road
Smile Re: Visual C++ Tips & Tricks

Converting between Generic types and ASCII

ATL provides a bunch of very useful macros for converting between different character format. The basic form of these macros is X2Y(), where X is the source format. Possible conversion formats are shown in the following table.

String Type Abbreviation
ASCII (LPSTR) A
WIDE (LPWSTR) W
OLE (LPOLESTR) OLE
Generic (LPTSTR) T
Const C
Thus, A2W converts an LPSTR to an LPWSTR, OLE2T converts an LPOLESTR to an LPTSTR, and so on.
There are also const forms (denoted by a C) that convert to a const string. For instance, A2CT converts from LPSTR to LPCTSTR.
When using the string conversion macros you need to include the USES_CONVERSION macro at the beginning of your function:
void foo(LPSTR lpsz)
{
USES_CONVERSION;

...
LPTSTR szGeneric = A2T(lpsz)
// Do something with szGeneric
...
}
thanks
__________________
Karpagarajan. R
Necessity is the mother of invention
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #68 (permalink)  
Old 09-10-2007, 12:56 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 299
Karpagarajan is on a distinguished road
Smile Re: Visual C++ Tips & Tricks

The inline keyword usage

The inline and __inline specifiers instruct the compiler to insert a copy of the function body into each place the function is called.
inline function_declarator;
__inline function_declarator; // Microsoft Specific
__forceinline function_declarator; // Microsoft Specific
The insertion (called inline expansion or inlining) occurs only if the compiler's cost/benefit analysis show it to be profitable. Inline expansion alleviates the function-call overhead at the potential cost of larger code size.
The __forceinline keyword overrides the cost/benefit analysis and relies on the judgment of the programmer instead. Exercise caution when using __forceinline. Indiscriminate use of __forceinline can result in larger code with only marginal performance gains or, in some cases, even performance losses (due to increased paging of a larger executable, for example).


thanks
__________________
Karpagarajan. R
Necessity is the mother of invention
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #69 (permalink)  
Old 09-22-2007, 03:52 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 299
Karpagarajan is on a distinguished road
Thumbs up Re: Visual C++ Tips & Tricks

Inserting a List View Item

Hi,

Here is the tips for adding an item to the listview control in VC++.
The InsertItem function is used to add an item to a list view control:

Inserting a List View Item
m_listItem.InsertItem( &listItem );
A pointer to an LV_ITEM structure is passed as the parameter to InsertItem. LV_ITEM data members are filled with data for the new item before it is inserted.

listItem.mask = LVIF_TEXT;
listItem.iItem = 0;
listItem.pszText = szText;
m_listCtrl.InsertItem( &listItem );
thanks
__________________
Karpagarajan. R
Necessity is the mother of invention
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #70 (permalink)  
Old 09-26-2007, 12:17 PM
SteveB44 SteveB44 is offline
D-Web Trainee
 
Join Date: Sep 2007
Posts: 2
SteveB44 is on a distinguished road
Default Re: Visual C++ Tips & Tricks

Does anyone know how to include a header file into Visual C++ .net windows form program
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #71 (permalink)  
Old 09-27-2007, 05:36 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 299
Karpagarajan is on a distinguished road
Thumbs up Re: Visual C++ Tips & Tricks

Hi Steve,
To include the header file into your the vc++.net project, you need to change the stdafx.h. Open the stdafx.h header file and include your header file like this
#include "myheader.h"
or
#include <myheader.h>
if you want to put the header file from your subfolders, use like this
#include "mysub\myheader.h"
Note that, if you want to include the header file only to your project, use the "stdafx.h", else open the related object header or source file and include your header file like this.
//MyForm.cpp

#include "mysub\myheader.h"
thanks
__________________
Karpagarajan. R
Necessity is the mother of invention
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #72 (permalink)  
Old 09-28-2007, 08:15 AM
SteveB44 SteveB44 is offline
D-Web Trainee
 
Join Date: Sep 2007
Posts: 2
SteveB44 is on a distinguished road
Default Re: Visual C++ Tips & Tricks

I can include standard header files like fstream into my stdafx.h folder, but when I try to include a header file I received from Flight Simulator X called SimConnect.h I get about 170 errors at compile time. The SimConnect.h header file works fine in C++, but when I go to Visual C++ it gives me the errors. I think there must be some incapability issues between C++ and Visual C++ but I am at a lose as to what they are and how to fix them.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #73 (permalink)  
Old 10-30-2007, 03:04 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 299
Karpagarajan is on a distinguished road
Thumbs up Re: Visual C++ Tips & Tricks

Hi Steve,
It depends on the Flight Simulator X dll files and library files. I think you need to include the library,includes files on to your VC++ options. Do you have a development sample source files for the Flight Simulator X? May I know what type of errors you are receiving while including these headers files on to your project?

thanks
__________________
Karpagarajan. R
Necessity is the mother of invention
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #74 (permalink)  
Old 11-13-2007, 02:16 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 299
Karpagarajan is on a distinguished road
Thumbs up Re: Visual C++ Tips & Tricks

MSIL (Microsoft Intermediate Language)

Microsoft C/C++ 6.0/7.0 had the ability to emit P-code years ago and was used in Microsoft applications. The son-of-P-code is a bytecode called "MSIL" (Microsoft Intermediate Language).

MSIL is always compiled and runs on top of a runtime library called the CLR ("Common Language Runtime") in a system that is collectively known as .NET ("dot-net"). .NET supports not just a single language such as C# (the Microsoft equivalent of the Java language) but also managed version of C++ and Visual BASIC to name a few.

The compilers for the various .NET languages all generate the same common MSIL bytecode, so by the time that bytecode is jitted( "just-in-time compilers" or simply "JIT". The microprocessor natively executes that "jitted" code.) by the CLR it has really become irrelevant which managed language it was compiled from. An open source version of .NET called Mono is also available.

Thanks
__________________
Karpagarajan. R
Necessity is the mother of invention
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #75 (permalink)  
Old 03-10-2008, 07:04 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 299
Karpagarajan is on a distinguished road
Smile Re: Visual C++ Tips & Tricks

Hi All,

Here is the tips for the difference between debug mode and release mode build in VC++.

Each build will be having separate output file path and separate settings. In debug mode, the compiler will automatically detect the linked files on the local system and it will automatically initialize all the variables and structures(ASSERT() used to track the debug mode error issues).

In release mode the Application is built in compiler independent and all the PATHS for the linked dlls should be copied for the system path or the application path. (VERIFY() function is used to trap the errors)

thanks
__________________
Karpagarajan. R
Necessity is the mother of invention
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #76 (permalink)  
Old 03-13-2008, 03:20 AM
Karpagarajan Karpagarajan is offline
D-Web Analyst
 
Join Date: Mar 2007
Posts: 299
Karpagarajan is on a distinguished road
Default Re: Visual C++ Tips & Tricks

Hi
Here is the tips for How to declare a dynamic class array using CMap.

CMap < int, int, CClassitem *, CClassitem*& > m_ProgEntries;

thanks
__________________
Karpagarajan. R
Necessity is the mother of invention
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #77 (permalink)  
Old 09-01-2008, 06:33 AM
!_kerher_! !_kerher_! is offline
D-Web Trainee
 
Join Date: Sep 2008
Location: USA
Posts: 3
!_kerher_! is on a distinguished road
Send a message via ICQ to !_kerher_! Send a message via Skype™ to !_kerher_!
Default Re: Visual C++ Tips & Tricks

thnx for the tutorial bro,keep it up!
__________________
Link Building Packages
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #78 (permalink)  
Old 09-22-2008, 12:54 AM
balaji1251988 balaji1251988 is offline
D-Web Trainee
 
Join Date: Sep 2008
Posts: 3
balaji1251988 is on a distinguished road
Exclamation Re: Visual C++ Tips & Tricks

can anyone help me in getting visual c++ e-books

Keyword Research Georgia Health Insurance
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #79 (permalink)  
Old 10-03-2008, 02:56 AM
cool sam cool sam is offline
D-Web Trainee
 
Join Date: Sep 2008
Posts: 24
cool sam is on a distinguished road
Default Re: Visual C++ Tips & Tricks

hi
Thanks all i have did know much about it but surly now i can.


__________________________________________
IT Hardware | IT Solutions
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #80 (permalink)  
Old 10-20-2008, 03:28 AM
willjack12 willjack12 is offline
D-Web Trainee
 
Join Date: Oct 2008
Posts: 6
willjack12 is on a distinguished road
Default Re: Visual C++ Tips & Tricks

An application development tool developed by Microsoft for C++ programmers. Visual C++ supports object-oriented programming of 32-bit Windows applications with an integrated development environment (IDE), a C/C++ compiler, and a class library called the Microsoft Foundation Classes (MFC). The IDE includes an AppWizard, ClassWizard, and testing features to make programming easier. Visual C++ was introduced in 1993, and Release 4.0 became available in 1996.
--------------------------------------------

5 Arkivreoler Self Certificate Mortgage
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/c-c-programming/531-visual-c-tips-tricks.html
Posted By For Type Date
Microsoft Visual C - encyclopedia article about Microsoft Visual C. This thread Refback 02-25-2008 10:03 AM
Vc++ - encyclopedia article about Vc++. This thread Refback 11-13-2007 11:43 PM
Investment Calculator - calculator weight, broker calculator investment This thread Refback 09-06-2007 05:51 PM
Web Link This thread Refback 09-05-2007 09:14 PM
Visual C++ Tips & Tricks - DiscussWeb IT Community - Technical Support and Technology Discussions Post #12 Refback 08-25-2007 06:06 PM
VC++ Tips & Tricks - DiscussWeb IT Community - Technical Support and Technology Discussions This thread Refback 08-17-2007 05:57 PM
Digg / Programming / Upcoming This thread Refback 07-19-2007 09:51 AM
digg / vinothchandar / news / dugg This thread Refback 07-19-2007 08:55 AM
Digg / Technology / Upcoming This thread Refback 07-19-2007 08:36 AM
VC++ Tips & Tricks - Discussweb IT Community - Web Development, Software Programming, SEO, Quality Assurance, 3D, Web Hosting and more... This thread Refback 07-11-2007 11:55 AM

<
Similar Threads
Thread Thread Starter Forum Replies Last Post
C# .Net Tips & Tricks oxygen C# Programming 83 09-24-2008 03:20 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