Hi, Billy
What you are trying to do with mappoint control is not supported. I can
offer some things to try, based on some poking around I did. I believe you
are painting on the wrong hwnd. The one you want is one of the children's
children's children etc of the one where you are actually painting. You
can use the spy++ tool to do some detective work, and determine the hwnd of
the actual drawing surface. Once you know the class you should be able to
call FindWindow to get the hwnd of the drawing surface. You could also
enumerate the parents until you get to the hwnd you get from dotnet. You
could then write code using GetWindow to wend your way through the various
children to the drawing surface. I think you would be better off using
the built in functionality if you possibly can.
I hope you found this information useful, and thank you for choosing the
MSDN Managed Newsgroups,
John Eikanger
Microsoft Developer Support
This posting is provided “AS IS” with no warranties, and confers no rights.
(c) 2003 Microsoft Corporation. All rights reserved.
--------------------
| Content-Class: urn:content-classes:message
| From: "Billy Jacobs" <
[email protected]>
| Sender: "Billy Jacobs" <
[email protected]>
| Subject: Mappoint 2002
| Date: Mon, 4 Aug 2003 15:03:21 -0700
| Lines: 18
| Message-ID: <
[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcNa1DgGB4XGUVePRoSChXVyrdmG5A==
| Newsgroups: microsoft.public.dotnet.general
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:103438
| NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| I am attempting to draw on a Mappoint 2002 active X
| control using GDI by the following method:
|
| 1. I create a graphics object:
| g = graphics.FromHwnd(axMap.handle)
| 2. I draw a rectangle on it.
| g.FillRectangle(new solidBrush(Color.Navy), 0,0,
| AxMap.width, AxMap.height)
|
| The result is that I can see a blue outline around the map
| as if it is drawing it behind the map.
|
| Where can I find documentation on how to draw on the map
| at specified lat and lon?
|
| Thanks
|
| Billy Jacobs
|