Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Was heisst Fensterhandle des OLE Elements nicht verfügbar (https://www.delphipraxis.net/81085-heisst-fensterhandle-des-ole-elements-nicht-verfuegbar.html)

bundy 20. Nov 2006 19:30


Was heisst Fensterhandle des OLE Elements nicht verfügbar
 
Ich habe eine Programm geschrieben. Das Programm funktioniert wunderbar.
Nun habe ich mir von Map & Guide die ActivX Controls gekauft.

Wenn ich eine Neue Win32 Aplication erstelle, und die Komponenten da rauf klatsche funktioniert es wunderbar.
Ziehe ich die Komponenten auf meine bestehendes Programm erhalte ich folgenden Fehler.

:arrow: Im Projekt FTB_Client.exe ist eine Exception der Klasse EOleError mit der Meldung 'Das Fenster-Handle des OLE-Elements nicht verfügbar' aufgetreten.

Was bedeutet dieser Fehler ?

PS: Map&Guide sind Routenplaner Komponenten die auf ActivX basis funktionieren, ein Server läuft lokal im Hintergrund, der die Anfragen vom client verarbeitet

lg
Bundy

Bernhard Geyer 20. Nov 2006 19:49

Re: Was heisst Fensterhandle des OLE Elements nicht verfügba
 
Wurde das Projekt mit einer alten Delphi-Version erstellt und fehlt damit der Application.Initialize-Aufruf in der dpr-Datei?

bundy 20. Nov 2006 20:14

Re: Was heisst Fensterhandle des OLE Elements nicht verfügba
 
Nein ich hab beides mit D2006 erstellt.

3_of_8 20. Nov 2006 20:22

Re: Was heisst Fensterhandle des OLE Elements nicht verfügba
 
Vielleicht hilft es, beim Hersteller direkt nachzufragen, vielleicht kennen die das Problem schon?

mkinzler 20. Nov 2006 20:25

Re: Was heisst Fensterhandle des OLE Elements nicht verfügba
 
Was ist der Unterschied zwischen dem vorhanden Formular und dem neuen? Sind beide Win32-Programme? Welche weiteren Komponenten sind bereits auf der Form? Benutzt das alte Programm Laufzeitpackages?

bundy 20. Nov 2006 20:41

Re: Was heisst Fensterhandle des OLE Elements nicht verfügba
 
Das bestehende Programm hat folgende Komponenten (ohne Map&Guide Komponenten):
Delphi-Quellcode:
uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,
  uROClient, uROClientIntf, uRORemoteService, uROBinMessage, cxGraphics, cxPC,
  dxStatusBar, dxNavBarCollns, cxClasses, dxNavBarBase, cxSplitter, cxControls,
  ExtCtrls, dxNavBar, cxStyles, cxCustomData, cxFilter, cxData, cxDataStorage,
  cxEdit, DB, cxDBData, cxGridLevel, cxGridCustomView, cxGridCustomTableView,
  cxGridTableView, cxGridDBTableView, cxGrid, cxMemo, cxDBEdit, cxDropDownEdit,
  cxCalendar, cxTextEdit, cxMaskEdit, cxSpinEdit, cxLabel, cxCheckBox,
  cxContainer, cxGroupBox, cxDBLookupComboBox, cxNavigator, cxDBNavigator,
  Menus, cxLookAndFeelPainters, cxButtons, ppBands, ppCache, ppClass, ppProd,
  ppReport, ppComm, ppRelatv, ppDB, ppDBPipe, ppCtrls, ppPrnabl, myChkBox,
  ppBarCod, jpeg, ppStrtch, ppMemo, ppVar, ImgList, cxImageComboBox;
nach Map & Guide addon
Delphi-Quellcode:
  MGC_BASELib_TLB, OleCtrls, MGC_CONTROLSLib_TLB;
um das erweitert.

Neues Programm

Delphi-Quellcode:
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, MGC_BASELib_TLB, OleCtrls;

type
  TForm2 = class(TForm)
    MGCMapSource1: TMGCMapSource;
    MGCMapView1: TMGCMapView;
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;
Ich hab jetzt mal beim Hersteller ins Forum gepostet, mal sehn was die antworten :(

lg
Bundy

bundy 21. Nov 2006 17:55

Re: Was heisst Fensterhandle des OLE Elements nicht verfügba
 
Ich hab den Fehler gefunden nach langem herumprobieren.
Ich weiß zar nicht ob es jemandem interessiert, aber ich poste mal die Lösung :roll:

Delphi-Quellcode:
program FTB_DVBClient;

uses
  uROComInit, //<<<<<------------  HIER kracht es !!
  Forms,
  MidasLib,
  fClientForm in 'fClientForm.pas' {ClientForm},
  fClientDataModule in 'fClientDataModule.pas' {ClientDataModule: TDAClientDataModule},
  ufmSucheStrasse in 'ufmSucheStrasse.pas' {fmSucheStrasse},
  ufmAnlegen in 'ufmAnlegen.pas' {fmAnlegen},
  ufmExportXLS in 'ufmExportXLS.pas' {fmExportXLS};

{$R *.res}

begin
  Application.Initialize;
  Application.CreateForm(TClientDataModule, ClientDataModule);
  Application.CreateForm(TClientForm, ClientForm);
  Application.CreateForm(TfmSucheStrasse, fmSucheStrasse);
  Application.CreateForm(TfmAnlegen, fmAnlegen);
  Application.CreateForm(TfmExportXLS, fmExportXLS);
  Application.Run;
end.
uROComInit ist eine Unit von RemObjects. Die beim verwenden der Komponenten automatisch dem Projekt hinzugefügt wird.

In ihr steht folgendes.

Delphi-Quellcode:
unit uROCOMInit;

{----------------------------------------------------------------------------}
{ RemObjects SDK Library - Core Library                                     }
{                                                                            }
{ compiler: Delphi 5 and up, Kylix 2 and up                                 }
{ platform: Win32, Linux                                                    }
{                                                                            }
{ (c)opyright RemObjects Software. all rights reserved.                     }
{                                                                            }
{ Using this code requires a valid license of the RemObjects SDK            }
{ which can be obtained at [url]http://www.remobjects.com[/url].                       }
{----------------------------------------------------------------------------}

{$I RemObjects.inc}

interface

implementation

{$IFDEF MSWINDOWS}
uses ActiveX;

initialization
  CoInitializeEx(nil,COINIT_MULTITHREADED);

finalization
  CoUninitialize;
{$ENDIF}

end.
Wofür diese Unit ist, .... ich habe keine Ahnung, aber wenn ich sie aus meinem Programm entferne funktioniert es einwandfrei.
Und die Komponenten von RemObject & Dataabstract ebenfalls.

lg
Bundy

Bernhard Geyer 21. Nov 2006 21:46

Re: Was heisst Fensterhandle des OLE Elements nicht verfügba
 
Mmmm :gruebel:

Diese Unit stellt die COM-Spielregeln für deine Anwendung um. Und wie es scheint ist Map & Guide nicht kompatible mit diesen COM-Threading-Modell. Damit könnte es nun sein das du beie Compos nicht in einer Exe verwenden darfst (bzw. imm umständlich das COM-Threading-Modell umstellen mußt).

acadam71 30. Sep 2008 13:31

Re: Was heisst Fensterhandle des OLE Elements nicht verfügba
 
Hier mal eine Info von RemObjects bzgl. der Unit uROComInit, (der letzte Abschnitt ist der wichtigste)

Overview

Initializes the COM library for use by the calling thread, sets the thread's concurrency model, and creates a new apartment for the thread if one is required.
Usage

RemObjects SDK uses MSSQL which depends on COM to work so CoInitializeEx has to be called for RO server applications to function. CoInitializeEx is used to initialize COM in a multithreaded environment. By default the templates use uROCOMInit has which calls this function, so COM is already initialized in most cases howeverusing CoInitializeEx has known disadvantages:

Clipboard stops working
Drag and drop operations can't be accepted
Object linking and embedding (OLE) doesn't work
Shell dialogs (Open/Save) don't open

All these things require OleInitialize to be called in the main thread, instead of CoInitializeEx and require Single Thread Apartment. If your application need any of the above functionality you will have to remove the uROComInit reference from your project and initialize/deinitialize COM in ever thread that requires it.


Alle Zeitangaben in WEZ +1. Es ist jetzt 19:15 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