Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The System cannot find the file specified 2

Status
Not open for further replies.

IAdams

MIS
Jul 9, 2008
11
US
To All,

I am using Delphi 6 and trying to consume a COM object created by VS 2005 C#. I can successfuly create the DLL in VS, export it to a TLB file and import the TLB into Delphi. But when I try to instantiate a new class from the COM using Co(Classname).Create, I get the above error.

I have no idea what file it could be looking for; the TLB is absorbed into the Delphi code as a .pas file.

Any ideas, thanks.

 
some questions:

did u register the COM DLL? (regsvr32 <dllname>)

if so, does it still exist in the path from where it was registered?

/Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Thanks for your quick response.

Yes, I registered it with the command line VS function gacutil.exe which, as I understand, does the job of registration and also puts it in the GAC, right? Then I run a utility calle tlbexp which builds the TLB file.

All is well and Delphi can see the classes and methods inside the TLB and it compiles correctly, etc. but when I run I get the 'file' error.

Just puzzled...
 
I finally got this to work with a TLB file consumed by Delphi. I'm not sure what caused the initial 'file not found' error, but I added some more functionality to the .NET dll and it started working. I had to put GUID information on every Class and Interface within the .NET dll to make them COM-visible. I never used regasm but it works anyway, I just run gacutil and tlbexp...

The .NET dll is just a wrapper for another COM we obtained that didn't have a very good interface with Delphi 6. So now the real work of tying it all together begins.

Thanks for your time and the informative hyperlinks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top