第一范文网 - 专业文章范例文档资料分享平台

翻译稿

来源:用户分享 时间:2025/7/18 7:16:13 本文由闂備礁宕ˇ浼存偤閺囩姷鐭夐悹浣芥珪閻拷 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

Getting Started with MapObjects Version 2.x in Visual C++

}

41

case ID_ALIGN_LEFTTOP: alignment = DT_LEFT|DT_TOP; break; case ID_ALIGN_CENTER: alignment = DT_VCENTER|DT_CENTER; break; case ID_ALIGN_RIGHTBOTTOM: alignment = DT_RIGHT|DT_BOTTOM; break; }

CEasyMapView* pView = (CEasyMapView*)m_pOrigView; ASSERT_VALID(pView);

pView->SetAlignment(alignment); Invalidate();

2. Change the CPreviewView reference in CEasyMapView::OnFilePrintPreview to CMapPreviewView:

if (!DoPrintPreview(IDD_PREVIEW, this, RUNTIME_CLASS(CMapPreviewView), pState))

Test your changes

1. 2. 3. 4.

Build and run the application.

Use the File-Print Preview menu to display a preview of the printer page. Use the alignment buttons to align your map on the page. Print

Getting Started with MapObjects Version 2.x in Visual C++ 42

APPENDIX A

Adding MapObjects to your Visual C++ project using the #import directive

The #import directive is used to incorporate information from a type library. The content of the type library is converted into C++ classes, mostly describing the COM interfaces.

As a developer of MapObjects you only have access to the type library information contained in the MO20.OCX. When you Insert a Component into your Visual C++ project, Visual Studio automatically generates wrapper classes and their associated .cpp and .h files for each MapObjects class. These

wrapper classes need to be added to your project (for the MapObjects classes that are directly referenced by your project). Also, ESRI supply a header file \MapObjects for constants such as colour constants and coordinate system constants (eg moRed, moPCS_BritishNationalGrid)

If you intend to use MapObjects without using the graphical user interface (i.e. you do not intend to use the actual Map control object that is dragged onto your Form) then ERSI recommend that you use the #import directive. This automates the creation of the necessary files required by the compiler and also includes all enummerations directly . It also means that you do not need to include the C++ wrapper files in your project. . There are a number of parameters that must be passed so that the correct import of the MO20.OCX takes place. The #import directive will also generate Smart Pointers for the MapObjects classes.

#import \ no_namespace named_guids raw_native_types \\

rename(\

The rename of EOF and Font is required to avoid clashes with other system definitions, however other parameters can be changed to suit your requirements.

An example of using one of the Smart Pointers.

IMoPointPtr pPoint(\ // CLSID_ + class name without \pPoint->Set(1,2,0,0);

搜索更多关于: 翻译稿 的文档
翻译稿.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c438bp8e7sv9mzf00wd8d_11.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top