Frage

Ich habe 2.NET -DLLs, die ich mit Regasm ausgesetzt habe. Um die Referenzierung innerhalb eines COM -Clients zu vereinfachen, möchte ich diese zu einer Datei machen.

Ich habe versucht, beide Dateien in IDL zu konvertieren und dann den Inhalt des Bibliotheksabschnitts des einen in den anderen zu kopieren und dann mit MIDL zu .tlb zurück zu kompilieren. Dies funktioniert gut für die Typedefs innerhalb des zweiten IDL Ich habe kopiert.

Ich wollte sicherstellen, dass ich zu viel Zeit damit verbringe, dass es tatsächlich möglich ist, auf diese Weise magere IDLs zu machen.

War es hilfreich?

Lösung 3

Ok so it turns out that the issues I was experiencing were not related to merging the idl's.

If you wish to merge to idl's you can do so by simply copying the content of a library section in one idl into another. Then run midl on the merged file to turn it into a tlb.

Andere Tipps

Could you use ILMerge to first combine the .NET assemblies and then use REGASM on the resulting assembly?

ILMerge is a utility for merging multiple .NET assemblies into a single .NET assembly. It works on executables and DLLs alike and comes with several options for controlling the processing and format of the output.

I don't see an obvious way this would fail. You said you merged the library sections but you didn't say you copy-pasted the interface declarations from the other .idl. That would be an obvious, but unlikely, explanation.

One failure mode is when the client app uses the type library to marshal interface pointers across apartment boundaries or out-of-process. That however requires registry keys in HKCR\Interfaces. .NET doesn't create them, you'd have to do that yourself. You'd know if you did, not much of an explanation either.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top