Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Problem bei Registrierung eines COM-Objects (https://www.delphipraxis.net/63235-problem-bei-registrierung-eines-com-objects.html)

OnkelTobi 15. Feb 2006 18:43


Problem bei Registrierung eines COM-Objects
 
Zunächst erstmal Hallo hier im Forum :)

ich habe ein Problem bei dem ich den Fehler nicht finden kann :)

In meinem aktuellen Programm möchte ich ein eigenes COM-Object zur Automatisierung registrieren.

Ich habe eine entsprechende Typbibliothek erstellt und als Ressource (MyAppTypeBib.tlb + MyAppTypeBib_TLB.pas) eingebunden.
Dazu eine Klasse (TOleMyApp) die bei der Initialisierung der Unit registriert werden soll.

Delphi-Quellcode:
 
unit uOleMyApp;

{$R MyAppTypeBib.TLB}

...

uses
  MyAppTypeBib_TLB.pas;

type
  TOleMyApp = class(TAutoObject, IOLEMyApp)
  private
  ...
  protected
  ...
  end;
...

initialization
TAutoObjectFactory.Create(ComServer, TOleMyApp, Class_OleMyApp, ciSingleInstance);
end;
Wenn ich das Ganze einzeln in einer kleinen Testanwendung teste, gibts es keine Probleme damit.
Die Klasse zur Automatisierung wird bei jedem Start erfolgreich registriert.

Nun wollte ich das ganze in mein eigentliches Programm integrieren, habe dabei aber das Problem dass die Klasse nicht erfolgreich registriert wird.

Der CLSID der Klasse taucht nirgends in der Registry auf.

Der Aufruf
Delphi-Quellcode:
var
OleMyApp: IOleMyApp;
...
OleMyApp := CoOleMyApp.Create;
wirft die Exception "Klasse ist nicht registriert"

Gibt es irgendwas zu beachten?

Compilerdirektiven, o.ä.?

Schonmal Danke :)

Tobias

PS:
Ich habe das ganze noch auf dsdt.info gepostet - nur damit niemand doppelt antwortet :)


Alle Zeitangaben in WEZ +1. Es ist jetzt 11:34 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz