AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Projekte Google Maps über COM (Component Object Model)

Google Maps über COM (Component Object Model)

Ein Thema von Thom · begonnen am 23. Dez 2010 · letzter Beitrag vom 22. Mai 2022
 
Thom

Registriert seit: 19. Mai 2006
570 Beiträge
 
Delphi XE3 Professional
 
#11

AW: Google Maps über COM (Component Object Model)

  Alt 13. Mai 2011, 12:44
Aha - also liegt's doch an Deinem Delphi 6. Da müssen offensichtlich noch ein paar Compilerschalter angepaßt werden.
Ich stelle mal eine Checkliste zusammen.

Teste mal bitte mit dem Debugger den folgenden Ablauf:
Delphi-Quellcode:
->Unit1: Zoom:=13;

->gmMap:
procedure TMapOptions.SetZoom(Value: Integer);
begin
  SetProp(MapOptionsProp_Zoom{'zoom'},Value{13},true); //siehe nächste Methode
end;

->DispObject
procedure TDispObject.SetProp(const Name: String; const Value: OleVariant; CreateIfNotExists: Boolean = false);
begin
  if CreateIfNotExists and not PropertyExists(Name) //PropertyExists('zoom') liefert false
    then AddProp(Name); //siehe nächste Funktion
  BrowserTools.SetProp(FDisp,Name{'zoom'},Value{13},{false}true);
end;

->DispObject
function TDispObject.AddProp(const Name: String): Boolean;
var
  DispatchEx: IDispatchEx;
  PName: PWideChar;
  DispID: Integer;
begin
  Result:=false;
  if Supports(FDisp,IDispatchEx,DispatchEx) then //->muß true liefern
  begin
    PName:=SysAllocString(PWideChar(WideString(Name))); //PName muß 'zoom' als WideString enthalten
    try
      if Succeeded(DispatchEx.GetDispID(PName,fdexNameCaseSensitive or fdexNameEnsure,DispID)) then //<- tritt hier der Fehler auf?
      begin //DispID sollte einen kleinen Integerwert enthalten (z.B. 1)
        SetProp(DispID,varEmpty);
        Result:=true;
      end;
    finally
      SysFreeString(PName);
    end;
  end;
end;
Ich habe noch eine Idee:

Delphi 6 enthält doch in der Unit ActiveX die Deklaration von IDispatchEx!? Wie ist das dort definiert? Wie sind die Konstanten fdexNamexxx definiert? Ich vermute dort einen Bug (evtl. WideString).
In Delphi 5 ist das nämlich noch nicht enthalten. Deshalb habe ich die Definition in die Unit BrowserTools integriert - allerdings per Compilerschalter nur bis Delphi 5. Ab Delphi 6 wird die Deklaration aus der Unit ActiveX verwendet. Mit Delphi 7 funktioniert das - nur Du hast mit Delphi 6 Probleme. Also könnte die Ursache in einer fehlerhaften Implementation des Interfaces unter Delphi 6 liegen.
Versuche mal bitte, die Compilerschalter {$IFNDEF DELPHI6_UP} in der Unit BrowserTools in {$IFNDEF DELPHI7_UP} zu ändern und poste mal die Deklaration von IDispatchEx aus der Unit ActiveX von Delphi 6.
Thomas Nitzschke
Google Maps mit Delphi

Geändert von Thom (13. Mai 2011 um 21:52 Uhr)
  Mit Zitat antworten Zitat
 

Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

(?)

LinkBack to this Thread

Erstellt von For Type Datum
DELPHI | (google maps) This thread Refback 11. Nov 2011 09:07
Twebbrowser HTML tag to UniHTMLFrame1 - uniGUI Discussion Forums This thread Refback 4. Nov 2011 06:52
DoraDev1975: google maps This thread Refback 23. Sep 2011 08:18
delphi osm - Google Search Post #0 Refback 19. Sep 2011 09:02
DoraDev1975: ?&#3636;????? 2011 This thread Refback 11. Sep 2011 16:39
DoraDev1975 This thread Refback 30. Aug 2011 10:13
Untitled document This thread Refback 25. Jun 2011 19:57
Interact with Google Maps in a TWebBrowser from Delphi | Ramblings This thread Refback 26. Jan 2011 05:12
google maps mit delphi link - Google Search This thread Refback 24. Jan 2011 14:24
google maps mit delphi - Google Search This thread Refback 24. Jan 2011 14:20
Untitled document This thread Refback 19. Jan 2011 21:49

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 08:21 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz