Help(Version conflits(Visual Studio's header files conflicts with opencascade's))

---------------------------------------------
#include
---------------Creating Cwnd class part ---------------
class CFashionApp :public CWinApp
{
public:
virtual BOOL InitInstance();
};
class CFashionWnd:public CWnd
{
public:
CFashionWnd();
};
CFashionWnd::CFashionWnd()
{
CString strMyClass=AfxRegisterWndClass(0,
0,
HBRUSH(COLOR_WINDOWFRAME),
::LoadIcon(NULL,IDI_APPLICATION)
);

CreateEx(0,
strMyClass,
_T("Creamdog"),
WS_SYSMENU|WS_THICKFRAME,
CRect(0,0,400,400),
NULL,
0);
};
BOOL CFashionApp::InitInstance()
{
m_pMainWnd=new CFashionWnd;

m_pMainWnd->ShowWindow(SW_SHOWNORMAL);

return TRUE;
}
CFashionApp myApp;
-----------------------------------------
Using the Cwnd object for getSafehwnd() function
--------------------///////////
CFashionApp myApp;
Handle(Graphic3d_WNTGraphicDevice) TheGraphicDevice = new Graphic3d_WNTGraphicDevice();
TColletion_ExtendedString aName("3DV");
Handle(V3d_Viewer) myViewer = new V3d_Viewer(TheGraphicDevice,aName.ToExtString(),"");
myViewer->Init();
myViewer -> SetDefaultLights();
myViewer ->SetLightOn();
-----
Handle(WNT_Window) AWNTWindow;
AWNTWindow = new WNT_Window(TheGraphicDevice,myApp.m_mpMainWnd->GetSafeHWnd());
Handle(V3d_View) myView = myViewer->CreateView();
myViewer->SetWindow(hWnd);

------------------------------
if i type "C:\OpenCASCADE6.2.0\ros\inc" in " C/C++ -> Additional Include Directories " and use the above code to derive(or create the class of Cwnd), I got the following error. Maybe conflict with the open cascade version and the Visual Studio 8 version.
Help
Thanks
winthan

Win Than Aung's picture

PS: The errors

c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(630) : error C2146: syntax error : missing ';' before identifier 'BOOL'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(630) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(630) : error C2086: 'int WINBASEAPI' : redefinition
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(239) : see declaration of 'WINBASEAPI'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(638) : error C2146: syntax error : missing ';' before identifier 'BOOL'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(638) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(638) : error C2086: 'int WINBASEAPI' : redefinition
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(239) : see declaration of 'WINBASEAPI'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(646) : error C2146: syntax error : missing ';' before identifier 'BOOL'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(646) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(646) : error C2086: 'int WINBASEAPI' : redefinition
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(239) : see declaration of 'WINBASEAPI'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(654) : error C2146: syntax error : missing ';' before identifier 'BOOL'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(654) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(654) : error C2086: 'int WINBASEAPI' : redefinition
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(239) : see declaration of 'WINBASEAPI'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(659) : error C2146: syntax error : missing ';' before identifier 'BOOL'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(659) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(659) : error C2086: 'int WINBASEAPI' : redefinition
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(239) : see declaration of 'WINBASEAPI'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(675) : error C2146: syntax error : missing ';' before identifier 'DWORD'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(675) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(675) : error C2086: 'int WINBASEAPI' : redefinition
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(239) : see declaration of 'WINBASEAPI'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(682) : error C2146: syntax error : missing ';' before identifier 'DWORD'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(682) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(682) : error C2086: 'int WINBASEAPI' : redefinition
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(239) : see declaration of 'WINBASEAPI'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(695) : error C2146: syntax error : missing ';' before identifier 'BOOL'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(695) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(695) : error C2086: 'int WINBASEAPI' : redefinition
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(239) : see declaration of 'WINBASEAPI'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(701) : error C2146: syntax error : missing ';' before identifier 'BOOL'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(701) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(701) : error C2086: 'int WINBASEAPI' : redefinition
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(239) : see declaration of 'WINBASEAPI'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(713) : error C2146: syntax error : missing ';' before identifier 'BOOL'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(713) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(713) : error C2086: 'int WINBASEAPI' : redefinition
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(239) : see declaration of 'WINBASEAPI'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(716) : error C2061: syntax error : identifier 'LPVOID'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(723) : error C2146: syntax error : missing ';' before identifier 'BOOL'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(723) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(723) : error C2086: 'int WINBASEAPI' : redefinition
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(239) : see declaration of 'WINBASEAPI'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(726) : error C2061: syntax error : identifier 'LPVOID'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(739) : error C2146: syntax error : missing ';' before identifier 'BOOL'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(739) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(739) : error C2086: 'int WINBASEAPI' : redefinition
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(239) : see declaration of 'WINBASEAPI'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(745) : error C2061: syntax error : identifier 'LPVOID'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(749) : error C2146: syntax error : missing ';' before identifier 'BOOL'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(749) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(749) : error C2086: 'int WINBASEAPI' : redefinition
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(239) : see declaration of 'WINBASEAPI'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(755) : error C2061: syntax error : identifier 'LPVOID'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(767) : error C2146: syntax error : missing ';' before identifier 'HANDLE'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(767) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(767) : error C2086: 'int WINBASEAPI' : redefinition
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(239) : see declaration of 'WINBASEAPI'
c:\program files\microsoft platform sdk for windows server 2003 r2\include\wincon.h(767) : fatal error C1003: error count exceeds 100; stopping compilation
Build log was saved at "file://c:\c++projects\tut\windows_primer\Debug\BuildLog.htm"

Yogesh Dhakad's picture

Did you start Visual Studio using the *Environment* suitable to compile OCC projects?
If not I'll suggest you to compile OCC samples and start making changes from there (after making a backup if you need in the future)

Win Than Aung's picture

i can't even run the OCC sample. when i run OCC sample, it gives me the same error. So I assume nothing wrong with the code.
So i assume there is sth wrong with version. Visual C++ 2005 doesn't like OCC sample. Help.. I think It should work if i change the Visual
c++ 2005 to visual c++ 6.0.

Win Than Aung's picture

do you have the sample on displaying shape(OCC format) on Open cascade by using v3d_viewer?
or is there any ways to display take the snapshot of STEP in OCC?
thanks
winthan