Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

COM in FORTRAN Questions

Intel_C_Intel
Employee
408 Views
My engine is a COM object. I'm writing a SPAWN model in the engine to create and manage new engines. There is a requirement to 'save' the engine objects so I don't have to create them and load databases each run.I have a few questions about COM in FORTRAN:
  • Must COMInitialize and COMUninitialize always be paired?
  • Can I rely on COMUninitialize to clear my objects, or should I always call COMReleaseObject on them?
  • Is there a 'standard' or recommended way to 'save' an object? Does one just SAVE the object pointers? Or make them COMMON? Or stick them in a module?

Each SPAWN model can create and run up to five engines, if I want to save the objects I'll either have to allow only one SPAWN model, or to identify the objects with the name of the SPAWN model they belong to. I'm concerned about 'cleaning-up' if things go awry.

Any tips?

Cheers,

Dan

0 Kudos
1 Reply
Intel_C_Intel
Employee
408 Views

Actually, can I do this:

SUB Outside
USE DFCOM

INTEGER*4 nStat

CALL COMInitialize(nStat)

CALL Inside()

CALL COM Uninitialize()
END SUB

SUB Inside
! Call some COM functions....
END SUB

Or do I need to COMInitialize and COMUninitialize in 'Inside' too?

Message Edited by Judd on 05-25-2004 01:51 PM

0 Kudos
Reply