Visual Studio 2017 compile error(C2664) when enable the Conformance mode

Visual Studio 2017 compile error(C2664) when enable the Conformance mode

YuhanZhang
Autodesk Autodesk
2,936 Views
1 Reply
Message 1 of 2

Visual Studio 2017 compile error(C2664) when enable the Conformance mode

YuhanZhang
Autodesk
Autodesk

Condition:

        

Visual Studio 2017(15.5 or later versions).

 

Issue:

   

When you create a new C++ project from scratch for Inventor(for standalone application or addin), and include the InventorUtils.h file:

    #include "InventorUtils.h"

then compile it you will see the C2664 errors like:

       'LPOLESTR T2OLE(LPTSTR)': cannot convert argument 1 from 'const wchar_t [16]' to 'LPTSTR'

Solution:

 

On the project Property Pages, disable the Conformance mode(C/C++->Language->Conformance mode):

conformance mode.png



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

2,937 Views
1 Reply
Reply (1)
Message 2 of 2

chandra.shekar.g
Autodesk Support
Autodesk Support

@YuhanZhang,

 

Thanks for sharing information,

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes