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

Can't create MyOcafApp

Rui Fortes's picture


I'm trying to instanciate "MyOCAFApp" class but it doesn't seem to work.

First I tried to define the class myself but I quited.

Now I'm just trying to copy paste the class from SampleOcaf project.

I copied the files: TSampleOcaf_Application.cxx,hxx,ixx and jxx, and the file Handle_TSampleOcaf_Application.hxx.

I replaced all "TSampleOcaf_Application" text with "OCAFApp" in the files and in the files names.

Then I put #include "OCAFApp.hxx" in my CTesteApp source file.

I defined MyOCAFApp variable the same way as in the SampleOcaf project.

Ok I could compile and run.

But when I do "MyOCAFApp = new OCAFApp();" in the CTesteApp constructor I get a runtime error.

I followed execution step by step and the error occurs when MyOCAFApp empty constructor is called.

I also copied the plugin and resource file from SampleOcaf to a directory I specified in the 4 system variables: CSF_PluginDefaults CSF_PluginUserDefaults CSF_ResourcesDefaults and CSF_ResourcesUserDefaults.

I also changed the application name inside resources file to match the TColStd_SequenceOfExtendedString I used in the formats function.

What's missing? Can anyone help me? Thanks

Simon Bulman's picture

I have excactly the same problem. Are you developing on Win32 with MSVC? If so have you tried running the SampleOcaf from inside the MSVC environment, the same thing happens there !


Rui Fortes's picture

Hello Simon. My SampleOCAF works fine(now). I'm not even sure what has missing. I just verified my system variables and now it works.


Contact us

Attention: DO NOT use this form for all kind of request for the removal of your personal data. Please follow this link for such cases.