![]() |
Maptitude über OLE/COM steuern
Hallo,
steuert hier jemand Maptitude über OLE/COM? Ich möchte eine Karte öffnen (das klappt) und dort ein Zeichen in einer bestimmten Schriftart einfügen. Den Code dazu habe ich teilweise aus der Hilfedatei nach Delphi übersetzt (hoffentlich richtig). Es läßt sich compilieren. Beim Ausführen erscheint jedoch an der Stelle "Hier der Fehler" die folgende Meldung:
Code:
Diese Datei existiert nach einer frischen Maptitude Installation auf der gesamten Festplatte nicht. Ich vermute daher, dass der Fehler ein anderer ist und die Meldung nicht ganz stimmt. Wer kann helfen? Oder hat für mich ein anderes Beispiel, wie ich eine Maptitude-Karte von Delphi aus bearbeiten kann? Danke!
C:\Users\NAME\AppData\Roaming\Caliper\Maptitude 2015\caliper.mrk was not found.
Delphi-Quellcode:
procedure TForm1.Test;
var spec, specSub, MapScope, Location, Color: OleVariant; MapName: string; Gisdk: OleVariant; begin Gisdk := CreateOleObject('Maptitude.AutomationServer'); Gisdk.RunMacro('OpenMap', 'D:\test.map', null); Gisdk.RunMacro('SetWindowSizePixels', null, 340, 270); Gisdk.RunMacro('SetLayer', 'Cities & Towns'); MapName := Gisdk.RunMacro('GetMap'); spec := VarArrayCreate([1, 4], varVariant); Location := Gisdk.RunMacro('Coord', -75000000, 43000000); spec[1] := VarArrayCreate([1, 2], varVariant); specSub := spec[1]; specSub[1] := 'Location'; specSub[2] := Location; spec[2] := VarArrayCreate([1, 2], varVariant); specSub := spec[2]; specSub[1] := 'Font'; specSub[2] := 'Caliper Cartographic|14'; spec[3] := VarArrayCreate([1, 2], varVariant); specSub := spec[3]; specSub[1] := 'Index'; specSub[2] := '53'; Color := Gisdk.RunMacro('ColorRGB', 0, 0, 65535); spec[4] := VarArrayCreate([1, 2], varVariant); specSub := spec[4]; specSub[1] := 'Color'; specSub[2] := Color; try Gisdk.RunMacro('AddAnnotation', 'Map|'+MapName, 'Font Character', spec); //<-- Hier der Fehler except MessageDlg(Gisdk.RunMacro('GetLastError', null), mtError, [mbOK], 0); end; end; |
AW: Maptitude über OLE/COM steuern
We believe you are simply seeing the last error message left over from the application start-up (it tries to load bookmarks but none have been created yet).
The error is unrelated to your custom code. Perhaps the problem is that the value of the Index option should be an integer, but you are using a string |
AW: Maptitude über OLE/COM steuern
Hi, thank you very much for your reply :-)
Zitat:
Zitat:
Delphi-Quellcode:
to
specSub[2] := '53';
Delphi-Quellcode:
specSub[2] := 53;
But the error is the same. Gisdk.RunMacro raises this EOleException:
Code:
and GetLastError shows the error message as I have written in my first post.
'AddAnnotation returned an error. (1)'
|
AW: Maptitude über OLE/COM steuern
Another problem is the first parameter in the call to AddAnnotation - instead of
‘Map |’ + MapName it should be ‘Map|’ + MapName i.e. no space character between ‘Map' and ‘|' |
AW: Maptitude über OLE/COM steuern
Zitat:
Delphi-Quellcode:
Gisdk.RunMacro('AddAnnotation', 'Map|'+MapName, 'Font Character', spec);
(You can copy and paste it to notepad to check it. The pipe | character has some white space arround it. It may look like a space character. But it isn't) |
AW: Maptitude über OLE/COM steuern
I have created a bookmark with Maptitude as a workaround. Now there is a file called caliper.mrk. The error message
Code:
is gone now. But Gisdk.RunMacro raises still this EOleException:
C:\Users\NAME\AppData\Roaming\Caliper\Maptitude 2015\caliper.mrk was not found.
Code:
But GetLastError returns another message now:
'AddAnnotation returned an error. (1)'
Code:
What is the problem here? Thank you in advance :-)
Cannot find resource Matrix.
|
AW: Maptitude über OLE/COM steuern
Please ignore what GetLastError is reporting - these are leftover expected errors that are thrown during the application initialization. These errors have no connection with the problem you are experiencing.
|
AW: Maptitude über OLE/COM steuern
Zitat:
![]() We have bought 2 licenses of Maptitude. If we get it working many of our customers will buy a license too! This 100% sure :-) |
AW: Maptitude über OLE/COM steuern
Hi:
Please review this thread: ![]() The group is a good resource for developers of Maptitude. However, we would be happy to help further. |
AW: Maptitude über OLE/COM steuern
I've joined the Maptitude Yahoo group. But I can't write a new post. Is it possible that you (or a moderator) give me write access to this group? Thanks!
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 06:15 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