?
Solved

How to detect in MS CV 2008 code which properties are compiled now?

Posted on 2011-10-20
2
Medium Priority
?
314 Views
Last Modified: 2012-05-12
Dear experts!

I’m programmer with 10+ years in business, but new to MS VC ++ 2008. And to his IDE, quite different no matter I come here from Vb6 ad C#. I have a follow question:

My project is ActiveX DLL and I should build Unicode and non Unicode version. I put settings in Properties page of the project – non Unicode under realese and Unicode under Unicode Release . Fine, but the problem comes with a function which have different name for Unicode and non Unicode. Here you the code - it not working but you will get a idea for what I talk about.

      if (release==Unicode) // WHAT TO PUT HERE ???
      {
       HICON hIcon = AfxGetApp()->LoadIconW(IDI_ABOUTDLL);  //- THIS IS UNICODE VERSION      
      }
      else
      {
        HICON hIcon = AfxGetApp()->LoadIcon(IDI_ABOUTDLL);  // THIS IS NON UNICODE VERSION
      }

Other solution is to replace the function LoadIconW and LoadIcon with a function with equal name for Unicode and non unicode. Please help.
0
Comment
Question by:dvplayltd
2 Comments
 
LVL 31

Accepted Solution

by:
Zoppo earned 2000 total points
ID: 37004836
Hi dvplayltd,

you can use the UNICODE macro which is defined for projects which use unicode, i.e.:
#ifdef UNICODE
 HICON hIcon = AfxGetApp()->LoadIconW(IDI_ABOUTDLL);  //- THIS IS UNICODE VERSION      
#else
 HICON hIcon = AfxGetApp()->LoadIcon(IDI_ABOUTDLL);  // THIS IS NON UNICODE VERSION
#endif

Open in new window

Hope that helps,

ZOPPO
0
 

Author Closing Comment

by:dvplayltd
ID: 37004890
10x
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question