TDocStd_Application error

I have a problem with TDocSTd_application. CMyApp is inherited TDocStd_Application. And I copied from sampleocaf to myapp folder, and verifed some code. I installed cascade in d:\opencascade I set environment parameters.. CSF_PluginDefauls=d:\opencascade\src\StdResource\Plugin CSF_PluginUserDefauls=d:\opencascade\src\StdResource\Plugin CSF_ResourcesDefauls=d:\opencascade\src\StdResource\Standard CSF_ResourcesUserDefauls=d:\opencascade\src\StdResource\Standard

But I can't initialize CMyApp. Please Help me...

k-chan's picture

hi. i'm having the same problem. anyone can help?

here're more details:

i'm using win2k pro with sp1, msvc 6.0 with one of the latest service packs. also using opencascade 3.1.

recently found out the executable created crashes when executed via msvc, but instead doesn't give any problem when executed from explorer. this happens on win2k pro.

under win98se, the executable crashes with an undisposable GPF dialog box when executed under msvc. doesn't give any problem when executed from explorer too.

i've even tried creating the necessary environment variables below though i doubt they're the culprit.

is there any project setting that is required?

k-chan's picture

hi again, adding a bit more details.

the crash resulted from an unhandled exception in kernel32.dll.

the sample application only has lines to create an instance inheriting TDocStd_Application., and pretty much nothing else. the project is a basic win32 application, no mfc and atl. it's compiled under release mode.

s-bulman's picture


I had exactly this problem using NT + msvc. The problem only seemed to occur when I was linking to the debug (dlld) library files. When I changed my path to link with the release (dll) files all works ok, apart from you cannot using the debugging properly. Hope this helps.


k-chan's picture

happens to me regardless of the build configuration unfortunately... 8-(

k-chan's picture

hi, found solution to my own problem.

the CSF_PluginDefaults env var wasn't defined though i used the exact routines as in the sample. for some reason, putenv() and SetEnvironmentVariable() didn't work for me. maybe because the DLLs are loaded as a separate process? but the samples worked....

MSVC needs to be restarted to have those recently defined env vars when under WinNT.

for now, have to explicitly define env vars and have to do without definition of these during program execution.

hope this helps anyone encountering the same problem.