|
阅读:881回复:0
在ATL中使用MapControl的问题
<P >新建一个<FONT face="Times New Roman">ATL</FONT>工程,在工程中新建一个<FONT face="Times New Roman">ATL Dialog</FONT>,在对话框中拖入一个<FONT face="Times New Roman">MapControl</FONT>(<FONT face="Times New Roman">ArcEngine9.0</FONT>),在<FONT face="Times New Roman">PropertyPage</FONT>中加入测试图层,然后将该对话框在执行时<FONT face="Times New Roman">show</FONT>出来。但是图层没有显示,<FONT face="Times New Roman">MapControl</FONT>上仍然显示“<FONT face="Times New Roman">ESRI MapControl</FONT>”字样。将<FONT face="Times New Roman">PropertyPage</FONT>上的“<FONT face="Times New Roman">preview in design mode</FONT>”勾上后,再次运行便可以显示图层。但是无论勾不勾上该选项,在<FONT face="Times New Roman">MapControl</FONT>上所加的消息响应(如<FONT face="Times New Roman">Mousedown</FONT>,<FONT face="Times New Roman">selectedChange</FONT>等)始终如法响应。笔者一开始以为是软件版本问题,就换成<FONT face="Times New Roman">ArcObjects8.3</FONT>测试,还是如此,但换成<FONT face="Times New Roman">MapObjects2.2</FONT>就没有出现这些问题。笔者继续切换别的编程环境,发现在<FONT face="Times New Roman">VS6.0</FONT>和<FONT face="Times New Roman">.Net</FONT>(<FONT face="Times New Roman">C#</FONT>)环境中都不存在上述问题,但在<FONT face="Times New Roman">VS2003</FONT>的<FONT face="Times New Roman">MFC</FONT>中仍有这些问题,<FONT face="Times New Roman">WTL7.0</FONT>也一样。</P>
|
|