MapPoint hangs when saving map as HTML

tfmiltz
09-09-2005, 09:41 AM
I'm using the MapPoint Control, and I needed to save a map as HTML.
Because the Control does not sponsor support for geoFormatHTMLMap using the .saveas method, I read that the only way to do this is to use the control.saveas to save the map as a .ptm, and then instantiate MapPoint (second instance if you watch processes), and use:

oRootApp.ActiveMap.SaveAs sFileNameAndPath, geoFormatHTMLMap

This indeed does save the map an html, and the corresponding graphic, however, the new second instance of mappoint that is started never dies.

Upon form load with the control, an instance of MapPoint starts.
On the form, I sponsor functionality to save map as html.
So, the form is still loaded, one instance of mappoint running, and I go to instantiate the second instance to gain access to teh .SaveAs that allows for geoFormatHTMLMap, map saves, but never returns.

Win NT 5.0 > 5.x happens on all versions of OS that I've witnessed.

Anyone else have a clue on this ?

I did indeed read the example provided in this forum for saving to html, and for the most part have learned that the control lacks a great deal of functionality of the app object automation approach, and unfortunately you can not embed the app through automation as transparantly as the control.

Ideas ?

Tim Miltz

Wilfried
09-09-2005, 11:06 AM
Hi,

In fact the map is saved as a picture, and a small html document is generated to show the picture with a browser. So what you easy can do is copy the map to clipboard, save the clipboard as a gif, bmp, or wathever and generate a small html file yourself. It will probably go mutch faster also.

tfmiltz
09-10-2005, 10:25 AM
Interesting idea there.

I wasn't aware the mappoint Control sponsored a means to copy the map to the clipboard.

I realized what causes the hang, if the control instance has the map currently 'open', and I go to instantiate the map point application object, second instance hangs, if I 'close' the map that's displayed with the mappoint control, and THEN instantiate MO (some humor for ESRI people there), it doesn't hang, but, I end up flashing the screen blank for a split second during save.

Using the control explicitly would be terrific, what's odd is I see MapPoint Application Object HAS a .UserControl property that can be set to True, yet, I don't get the stripped down control when I set this, so I just use the control explicitly, however, as stated above, no means to save to 'other than' a .ptm file with the control.

I like the clipboard idea, however, I'm not sure what means exist to push the control's map to the clipboard.

Thoughts ?

Wilfried
09-13-2005, 01:16 PM
Hi,

You can use the CopyMap method to copy it to clipboard. After that you save it to a GIF or whatever format file you like, and you create a HTML file to display it. This is excacly what mappoint does saving to html, but it is better you control all yourself (meaning I like to have control myself :)

 
Web mp2kmag.com
mapforums.com