1

We got a DLL written by C# programmers, compiled to usable as COM object.

We consult these developers to get the function names, and syntaxes, and we can use it after we registered it with regasm.

This is ok, but we have more questions to produce faster development (on changes), and some things are not understandable or not working.

We used Delphi 6 professional, and assembly made by C# Visual Studio 2008 (as I think).

Let's see them:

1.) I cannot use the typelib (TLB) of the C# code, because I cannot import into Delphi.

The result was:

"Hiba az OLE beállításjegyzék használata közben."

Translate ~ "Error occured on use OLE typelib/setting lib"

Possible sources of the error:

a.) Delphi 6 cannot import the new COM dll-s.

b.) We must force to C# generate an older formatted TLB.

We tried to re-generate the TLB with regasm, but we also got this error.

May this impossable, but if case b.) happens, what we need to say to C# developers - how to compile the DLL-s?

(DLL-s are unimportable by Delphi, because they don't have self init section).

2.) Interesting: All of the parameters correctly converted into variants vica-versa, but if the C# method does not have parameter, I got error in Delphi side... For example (pseudo):

proc A():bool;

Calling of A is generating an error in Delphi side.

proc A(Dummy: bool):bool;

Calling of A(False) is working fine.

I don't know, why we got this. What do you thing about this? Is this a C# compiling problem?

Thanks for your help: dd

1
  • 1
    I'm confused by some parts of your question. You say that this C# dll with a COM interface is usable but yet you fail to import this into delphi 6. I'm not familiar with delphi but I assume if you failed to import it you wouldn't even be able to compile the code that uses it. Can you try importing the dll instead of the tlb? Commented Mar 30, 2011 at 23:10

1 Answer 1

1

Best route here is to obtain source code showing the successful use of the DLL via COM using, say, C#. The developers of the DLL should be able to provide that. The DLL probably also has to be registered with regasm (not regsvr32.exe as it would be for a native COM DLL) before it will be accessible via COM. As always, without more actual code, it is very difficult to answer such questions.

Sign up to request clarification or add additional context in comments.

2 Comments

You can't register .Net dlls that expose COM using regsvr32. You have to use regasm.
@Cole W: I didn't know that. I have zero experience with .NET. I have amended my answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.