Can't create MyOcafApp

Hello.

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

s-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 !

Simon

r-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.

Bye