请教,VC中调用百度地图API,在对话框中画出的地图是由VC完成的,还是由JAVESCRIP API完成的?

nongfuxu 2014-01-18 09:33:11
如题所示,请教,VC中调用百度地图API,在对话框中画出的地图是由VC完成的,还是由JAVESCRIP API完成的?

...全文
618 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
nongfuxu 2014-02-05
  • 打赏
  • 举报
回复
感谢楼上二位解答. 另外,"CHtmlCtrl is a web container which show the map" 和"当然是JS自己绘制的", 是不是说由JS绘制,在CHtmlCtrl上显示吗?
xwhmm 2014-01-20
  • 打赏
  • 举报
回复
我看到了 htmlctrl..............
hushoubo 2014-01-19
  • 打赏
  • 举报
回复
当然是JS自己绘制的
oyljerry 2014-01-18
  • 打赏
  • 举报
回复
CHtmlCtrl is a web container which show the map
nongfuxu 2014-01-18
  • 打赏
  • 举报
回复
4、testhtmlDlg.cpp // testhtml.cpp : 定义应用程序的类行为。 // #include "stdafx.h" #include "testhtml.h" #include "testhtmlDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #endif // CtesthtmlApp BEGIN_MESSAGE_MAP(CtesthtmlApp, CWinApp) ON_COMMAND(ID_HELP, &CWinApp::OnHelp) END_MESSAGE_MAP() // CtesthtmlApp 构造 CtesthtmlApp::CtesthtmlApp() { // TODO: 在此处添加构造代码, // 将所有重要的初始化放置在 InitInstance 中 } // 唯一的一个 CtesthtmlApp 对象 CtesthtmlApp theApp; // CtesthtmlApp 初始化 BOOL CtesthtmlApp::InitInstance() { // 如果一个运行在 Windows XP 上的应用程序清单指定要 // 使用 ComCtl32.dll 版本 6 或更高版本来启用可视化方式, //则需要 InitCommonControlsEx()。否则,将无法创建窗口。 INITCOMMONCONTROLSEX InitCtrls; InitCtrls.dwSize = sizeof(InitCtrls); // 将它设置为包括所有要在应用程序中使用的 // 公共控件类。 InitCtrls.dwICC = ICC_WIN95_CLASSES; InitCommonControlsEx(&InitCtrls); CWinApp::InitInstance(); AfxEnableControlContainer(); // 标准初始化 // 如果未使用这些功能并希望减小 // 最终可执行文件的大小,则应移除下列 // 不需要的特定初始化例程 // 更改用于存储设置的注册表项 // TODO: 应适当修改该字符串, // 例如修改为公司或组织名 SetRegistryKey(_T("应用程序向导生成的本地应用程序")); CtesthtmlDlg dlg; m_pMainWnd = &dlg; INT_PTR nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: 在此放置处理何时用 // “确定”来关闭对话框的代码 } else if (nResponse == IDCANCEL) { // TODO: 在此放置处理何时用 // “取消”来关闭对话框的代码 } // 由于对话框已关闭,所以将返回 FALSE 以便退出应用程序, // 而不是启动应用程序的消息泵。 return FALSE; }
nongfuxu 2014-01-18
  • 打赏
  • 举报
回复
2、stdafx.cpp (空文件) 3、testhtml.cpp // testhtml.cpp : 定义应用程序的类行为。 // #include "stdafx.h" #include "testhtml.h" #include "testhtmlDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #endif // CtesthtmlApp BEGIN_MESSAGE_MAP(CtesthtmlApp, CWinApp) ON_COMMAND(ID_HELP, &CWinApp::OnHelp) END_MESSAGE_MAP() // CtesthtmlApp 构造 CtesthtmlApp::CtesthtmlApp() { // TODO: 在此处添加构造代码, // 将所有重要的初始化放置在 InitInstance 中 } // 唯一的一个 CtesthtmlApp 对象 CtesthtmlApp theApp; // CtesthtmlApp 初始化 BOOL CtesthtmlApp::InitInstance() { // 使用 ComCtl32.dll 版本 6 或更高版本来启用可视化方式, //则需要 InitCommonControlsEx()。否则,将无法创建窗口。 INITCOMMONCONTROLSEX InitCtrls; InitCtrls.dwSize = sizeof(InitCtrls); // 将它设置为包括所有要在应用程序中使用的 // 公共控件类。 InitCtrls.dwICC = ICC_WIN95_CLASSES; InitCommonControlsEx(&InitCtrls); CWinApp::InitInstance(); AfxEnableControlContainer(); // 标准初始化 // 如果未使用这些功能并希望减小 // 最终可执行文件的大小,则应移除下列 // 不需要的特定初始化例程 // 更改用于存储设置的注册表项 // TODO: 应适当修改该字符串, // 例如修改为公司或组织名 SetRegistryKey(_T("应用程序向导生成的本地应用程序")); CtesthtmlDlg dlg; m_pMainWnd = &dlg; INT_PTR nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: 在此放置处理何时用 // “确定”来关闭对话框的代码 } else if (nResponse == IDCANCEL) { // TODO: 在此放置处理何时用 // “取消”来关闭对话框的代码 } // 由于对话框已关闭,所以将返回 FALSE 以便退出应用程序, // 而不是启动应用程序的消息泵。 return FALSE; }
nongfuxu 2014-01-18
  • 打赏
  • 举报
回复
这个VC测试程序也是在这个论坛上下载的. 4个*.CPP文件 *--------------------------------------------* 1、HtmlCtrl.cpp #include "StdAfx.h" #include <afxhtml.h> // MFC support for Windows 95 Common Controls #include "HtmlCtrl.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif IMPLEMENT_DYNAMIC(CHtmlCtrl, CHtmlView) BEGIN_MESSAGE_MAP(CHtmlCtrl, CHtmlView) ON_WM_DESTROY() ON_WM_MOUSEACTIVATE() END_MESSAGE_MAP() ////////////////// // Create control in same position as an existing static control with // the same ID (could be any kind of control, really) // BOOL CHtmlCtrl::CreateFromStatic(UINT nID, CWnd* pParent) { CStatic wndStatic; if (!wndStatic.SubclassDlgItem(nID, pParent)) return FALSE; // Get static control rect, convert to parent's client coords. CRect rc; wndStatic.GetWindowRect(&rc); pParent->ScreenToClient(&rc); wndStatic.DestroyWindow(); // create HTML control (CHtmlView) return Create(NULL, // class name NULL, // title (WS_CHILD | WS_VISIBLE ), // style rc, // rectangle pParent, // parent nID, // control ID NULL); // frame/doc context not used } //////////////// // Override to avoid CView stuff that assumes a frame. // void CHtmlCtrl::OnDestroy() { // This is probably unecessary since ~CHtmlView does it, but // safer to mimic CHtmlView::OnDestroy. if (m_pBrowserApp) { //m_pBrowserApp->Release(); m_pBrowserApp = NULL; } CWnd::OnDestroy(); // bypass CView doc/frame stuff } //////////////// // Override to avoid CView stuff that assumes a frame. // int CHtmlCtrl::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT msg) { // bypass CView doc/frame stuff return CWnd::OnMouseActivate(pDesktopWnd, nHitTest, msg); } ////////////////// // Override navigation handler to pass to "app:" links to virtual handler. // Cancels the navigation in the browser, since app: is a pseudo-protocol. // void CHtmlCtrl::OnBeforeNavigate2( LPCTSTR lpszURL, DWORD nFlags, LPCTSTR lpszTargetFrameName, CByteArray& baPostedData, LPCTSTR lpszHeaders, BOOL* pbCancel ) { const char APP_PROTOCOL[] = "app:"; int len = _tcslen(APP_PROTOCOL); if (_tcsnicmp(lpszURL, APP_PROTOCOL, len)==0) { OnAppCmd(lpszURL + len); *pbCancel = TRUE; } } ////////////////// // Called when the browser attempts to navigate to "app:foo" // with "foo" as lpszWhere. Override to handle app commands. // void CHtmlCtrl::OnAppCmd(LPCTSTR lpszWhere) { // default: do nothing }

15,980

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧