0
votes

I am working on a Delphi7 project which uses COM components to interact outside delphi code. All these components are developed in C#. Involked .tlb and .dll files for all COM components. Registered them in registry as well. Other components got registered and are usable in delphi code except one.

When accessing function of that particular COM Object, it is raising error -

Project ABC.exe raised exception class EOleSysError with message 'The system cannot find the file specified'. Process stopped. Use Step or Run to continue

I am working on understanding COM part in delphi and checked below areas :

  1. Import type library - dll is added and installed there
  2. Registry - Registry Entry exists for same

I used to rebuild the dll, place that dll with delphi code folder, and making corresponding registry entry to use COM component in delphi. Others are working fine using same procedure but not this one.

What else I should check to resolve this issue?

1
Obvious first thing to check is bitness. Is the C# assembly 64 bit?David Heffernan
That info should be addressed to @DavidHeffernan :o)Sir Rufo
@SirRufo - You are right!Trupti
@DavidHeffernan - Yes It is a 64 bit C# assembly.Trupti

1 Answers

1
votes

You have confirmed in comments that you have a 64 bit assembly. Your Delphi compiler produces 32 bit executables. A 32 bit executable cannot consume an in-proc 64 bit COM server. Although the COM server is registered, it is registered in the 64 bit COM registry. Your 32 bit executable searches the 32 bit COM registry and concludes that the COM object is not registered.

Your options:

  1. Consume the assembly out-of-proc.
  2. Switch the assembly to be a 32 bit assembly, and consume it in-proc.