Software Archive
Read-only legacy content

DLL or COM?

kwong107
Beginner
662 Views
Hi,
I've been creating Fort ran DELL's that are called from a GI from within EXCEL using VA. One of the problems I run into is that if the Fort ran code crashes, it brings EXCEL down with it. Does upgrading to 6.5 with OM support buy me anything? I believe that OM is implemented as a DELL that is run in the same process space.

Also what are my other alternatives? Is it possible to run the DELL under a separate process space? Can I create a BB COM wrapper that is called by the EXCEL VBA GUI which in turn calls the Fortran DLL?

I'm just starting to learn about COM, so I'd appreciate any info or resources that anyone can provide.

Thanks,
Kin Wong
0 Kudos
5 Replies
Steven_L_Intel1
Employee
662 Views
Used the spell checker, I see.... I love how it turns DLL into DELL. I complained about that twice so far...

I recommend NOT using Spell Check here.

Steve
0 Kudos
kwong107
Beginner
662 Views
Here's the unchecked version, usually a spell checker asks you to verify the changes:

Hi, I've been creating Fortran DLL's that are called from a GUI from within EXCEL using VBA. One of the problems I run into is that if the Fortran code crashes, it brings EXCEL down with it. Does upgrading to 6.5 with COM support buy me anything? I believe that COM is implemented as a DLL that is run in the same process space.

Also what are my other alternatives? Is it possible to run the DLL under a separate process space? Can I create a VB COM wrapper that is called by the EXCEL VBA GUI which in turn calls the Fortran DLL?

I'm just starting to learn about COM, so I'd appreciate any info or resources that anyone can provide.

Thanks, Kin Wong
0 Kudos
Intel_C_Intel
Employee
662 Views
CVF 6.5a does provide the ability to create an out-of-proc COM server, providing some additional fault tolerance. But you must take care coding. Different applications can respond differently when their out-of-proc COM server dies horribly; some are better written than others. :-)

If it were me, I'd spend the time trying to understand why my current dll is crashing and try to make it more robust. Depending on your current version of CVF the upgrade may still be worthwhile if it helps you find the problem. Then the COM Server stuff is gravy.

hth,
John
0 Kudos
kwong107
Beginner
662 Views
Thanks for the info. Can you give me some tips or direct to some resources for COM programming practices that will provide better fault tolerance? Like I said, I'm just starting to learn about COM.

The Fortran DLL contains a new set of calculations (basically a subroutine that is plugged in) for each new project that comes in, so there will always be some errors introduced in the process of programming the DLL. I provided the EXCEL VBA GUI and the Fortran framework, so any programmer can work on a new project by just plugging in the project specific calculations. About 90% of the time, the problem is due to the programmer leaving a type statement in the code during debugging and it crashes when called from a VBA program.

Kin
0 Kudos
Intel_C_Intel
Employee
662 Views
About 90% of the time, the problem is due to the programmer leaving a type statement in the code during debugging and it crashes when called from a VBA program.

Well, this would crash a regular dll, COM dll server, and a COM exe server. In the first two cases, your VBA caller would crash immediately as well. In the last case, it depends on the robustness of the client. Again, I'd focus on getting error free code. COM will not provide you any relief from having to write good code.

-John
0 Kudos
Reply