Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

VS2010 & MFC Legacy support Compile error

Solved!
Go to solution

Hi all ,

 

I'm using VS2010 Ultimate with MS2010 And the C++ MFC Legacy R1.

 

I'm tring to compile a simple program ( first time with all the support)

 

I'v included the path library.

 

 

stdafx.ccp :
#include "NiUiComponent.h"
#include "NiDAQmxComponent.h"
using namespace NI;
I'm getting this builed error :
1>c:\program files (x86)\national instruments\measurementstudiovs2010\vcnet\include\niexception.h(466): error C2440: 'default argument' : cannot convert from 'const char [1]' to 'LPCTSTR'
1>          Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>c:\program files (x86)\national instruments\measurementstudiovs2010\vcnet\include\niexception.h(466): error C2548: 'NI::ThrowNiOleException' : missing default parameter for parameter 2
1>c:\program files (x86)\national instruments\measurementstudiovs2010\vcnet\include\nicommoncomponent.h(48): fatal error C1189: #error :  UNICODE not supported

 

 

any idea's ?

 

 

 

-----------------------------------------
Kobi Kalif
Software Engineer

0 Kudos
Message 1 of 2
(6,593 Views)
Solution
Accepted by topic author Kobi_K

Hello -

 

When using NI MFC components, you must not use unicode libraries.  Measurement Studio MFC support does not support unicode, only multibyte.  You can fix this in one of two ways. 

 

  • When creating a new MFC project, you can deselect the "Use Unicode libraries" checkbox.
    NickB_05-12_10-59-08.png


  • If you have an existing project, you can open the project properties and select "Use Multi-Byte Character Set" for the "Character Set" general configuration property.
    NickB_05-12_10-56-00.png


One of these solutions should resolve the build errors for you.  Please let me know if it does not.

 

NickB

National Instruments

0 Kudos
Message 2 of 2
(6,589 Views)