[mapguide-internals] Intergrating DWF Viewer of MapGuide Enterprise 2009 into Windows Forms

Kenneth Skovhede, GEOGRAF A/S ks at geograf.dk
Thu Aug 28 05:51:35 EDT 2008


I have not tried to do this with the DWF viewer, but have done it with 
the MapGuide 6.5 viewer.

If you look at the DWFViewer html files for MapGuide, you should be able 
to find the GUID of the desired class (the map viewer).
With this GUID, you can search the registry to find the name of the 
component.

In Visual Studio, you can pick the component, by adding a reference, and 
selecting it on the "COM" tab.
If you found the right class, it will generate a wrapper assembly that 
is also a .Net control.
You can then add the control as a normal control.
You should also be able to see the properties for the control.

There is also a tool to generate the assembly outside of Visual Studio, 
but I can't remember its name.

Regards, Kenneth Skovhede, GEOGRAF A/S



Carl Jokl skrev:
> I have a task in migration of a Windows Forms based Application which embeds
> the DWF Viewer of MapGuide 6. The Migration is basically just to swap out
> the MapGuide 6 DWF Viewer ActiveX Control and instead replace it with the
> MapGuide Enterprise 2009 DWF Viewer ActiveX control. I am having some
> difficulty in this due to working slightly blind on this without complete
> documentation on how to do something like this. I am using the
> EMapViewer.dll library and examining the classes within it but am not
> certain that this is the correct library or whether this library has other
> dependencies (though that I may be able to check with a dependency walker
> utility). I manage to create an instance of the CEmapViewerClass which I am
> guessing is what should be instantiated. I need to point this to a map
> though and tried using the NavigateTo method to supply the URL to be used.
> This action threw a COM Exception which I think may be due to no map being
> loaded (though this is what I am trying to do anyway). I am able to see some
> of the internal state of the viewer as I have turned on native debugging. 
>
> Item 1 which I need to get working is getting the Map Viewer to load a map
> at a given URL. 
>
> My second problem is that as this application is Windows Forms based (ableit
> written in C# .Net) I need to be able to cast the ActiveX control to be some
> kind of component which can be added to a form as well as do things like set
> the position and size and docking etc. 
>
> Item 2 be able to use DWF ActiveX control as Windows Forms Component.
>
> I could be going about this whole process wrongly but I am somewhat working
> blind at the moment without guidence. I have a document about the DWF Viewer
> API which shows me the methods available and events and some coverage of
> what the classes are. The guide I have is not detailed enough to cover items
> 1 and 2 which I am trying to figure out. I am aware that the DWF Viewer has
> wider scope usage than MapGuide alone and can be intergrated in many types
> of applications. I have looked a bit on Autodesks site for documentation.
> There is some but it can be patchy. For example when I try and download code
> examples some deny access another one was a zip download file 0 bytes in
> size. I would appreciate any help anyone may be able to provide.
>   


More information about the mapguide-internals mailing list