For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

Build new project

Patrick Köppe's picture
Forums: 

Hello,

can anybody help me creating a new VS2005 application with Open CASCADE usage for example IGES import. I tried a lot of things but nothing worked really. Can anybody _PLEASE_ describe step by step how to create a new project and using Open CASCADE inside of it. Thanks a million.

Greets
Patrick

Rajesh Kishore's picture

Hi Patrick,
To create new MFC application using OCC wizard, you have to add *.awx files of wizards from $CASROOT /../Tools to the VC++\Common\MSDev98\Template directory.
Start Visual C++. Click File / New and in Project tabs you will see Viewer and OCAF AppWizard.
For more information:
C:\OpenCASCADE6.1.0\doc\index.htm
development tools > Wizards

Rajesh Kishore's picture

Hi Patrick,
To create new MFC application using OCC wizard, you have to add *.awx files of wizards from $CASROOT /../Tools to the VC++\Common\MSDev98\Template directory.
Start Visual C++. Click File / New and in Project tabs you will see Viewer and OCAF AppWizard.
For more information:
C:\OpenCASCADE6.1.0\doc\index.htm
development tools > Wizards

Patrick Köppe's picture

Sorry I forgot to write, the wizard files only work with VS 6.0, I have VS2005 (VS 8.0). So this sadly doesn't help. No matter thanks for your effort.

Greets
Patrick

Patrick Köppe's picture

What I have done.
At first I tried to recompile the ImportExport sample. After converting it to VS2005, changing the includepath from libd to lib and compiling mfcsample (also converting it to VS2005, changing includepath from libd to lib and adding type specifier "int" in line 668 in OCC_2dView.cpp), it runs perfectly.
Now I tried to write my own application. I created a new MFC application. In the menu of the application I created a new entry and generated a event handling function. In this function I copied the function call "CImportExport::ReadIGES(myAISContext)" from the ImportExport sample function "void CImportExportDoc::OnFileImportIges()". Added "#include " to the same file and added the includepaths "$(CASROOT)\..\samples\standard\mfc\Common,$(CASROOT)\inc". Also I added the preprocessor variable WNT. Then I tried running the application with the result of many many errors.
What's wrong what do I have to include and where???

Greets
Patrick

Patrick Köppe's picture

A friend of mine looked a little at the code and said:
Add to importexport.h the following "#include " and "#include " and "#include " also insert into "Additional dependences" "TKVrml.lib TKStl.lib TKBrep.lib TKIGES.lib TKShHealing.lib TKStep.lib TKXSBase.lib TKShapeSchema.lib FWOSPlugin.lib PTKernel.lib TKBool.lib TKCAF.lib TKCDF.lib TKDraw.lib TKernel.lib TKFeat.lib TKFillet.lib TKG2d.lib TKG3d.lib TKGeomAlgo.lib TKGeomBase.lib TKHLR.lib TKMath.lib TKOffset.lib TKPCAF.lib TKPrim.lib TKPShape.lib TKService.lib TKTopAlgo.lib TKMesh.lib TKV2d.lib TKV3d.lib" and set the library path to "$(CASROOT)\win32\lib".
After doing this I only get one error. The identifier "myAISContext" is not declared.

I don't think that this (changing the Open CASCADE source) is the right way doing it.

Greets
Patrick

Patrick Köppe's picture

After this I tried something more and added to the "MyTestDoc.h" "#include " and changed the inheritance to ": public OCC_3dBaseDoc". Also I added to the "Additional dependences" "mfcsample.lib" and to the library path "$(CASROOT)\..\samples\standard\mfc\mfcsample\Debug". When I start now, compiling is okay, linking is okay, but at start a error message pops up and says "The application could not be started, because mfcsample.dll was not found. Reinstall of the application could fix the problem.". What's this?

Greets
Patrick

mamadou sy's picture

HI Patrick, according to my experience, you have to compile mfcsample as well before compiling or running any other OCC programs.
First, erase the debug in the mfcsample and go ahead.
I hope this will help.

Patrick Köppe's picture

Thanks for your answer. But how I wrote in my second post I had recompiled mfcsample. No matter I did it again, but nothing changes.

Greets
Patrick