• 大小: 49KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-11
  • 语言: C/C++
  • 标签: C++  JS  相互调用  MFC  

资源简介

这里是 VC与JavaScript交互(三) ———— JS调用C++,下载的时候需要看清楚

资源截图

代码片段和文件信息

// JSCppInteractive.cpp : 定义应用程序的类行为。
//

#include “stdafx.h“
#include “JSCppInteractive.h“
#include “JSCppInteractiveDlg.h“

#ifdef _DEBUG
#define new DEBUG_NEW
#endif


// CJSCppInteractiveApp

BEGIN_MESSAGE_MAP(CJSCppInteractiveApp CWinApp)
ON_COMMAND(ID_HELP &CWinApp::onhelp)
END_MESSAGE_MAP()


// CJSCppInteractiveApp 构造

CJSCppInteractiveApp::CJSCppInteractiveApp()
{
// TODO: 在此处添加构造代码,
// 将所有重要的初始化放置在 InitInstance 中
}


// 唯一的一个 CJSCppInteractiveApp 对象

CJSCppInteractiveApp theApp;


// CJSCppInteractiveApp 初始化

BOOL CJSCppInteractiveApp::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(“应用程序向导生成的本地应用程序“));

CJSCppInteractiveDlg dlg;
m_pMainWnd = &dlg;
INT_PTR nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: 在此处放置处理何时用“确定”来关闭
//  对话框的代码
}
else if (nResponse == IDCANCEL)
{
// TODO: 在此放置处理何时用“取消”来关闭
//  对话框的代码
}

// 由于对话框已关闭,所以将返回 FALSE 以便退出应用程序,
//  而不是启动应用程序的消息泵。
return FALSE;
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-08-26 16:24  JSCppInteractive\
     目录           0  2015-08-26 16:24  JSCppInteractive\JSCppInteractive\
     文件        1779  2015-08-26 15:53  JSCppInteractive\JSCppInteractive\JSCppInteractive.cpp
     文件         501  2015-08-26 15:39  JSCppInteractive\JSCppInteractive\JSCppInteractive.h
     文件         323  2015-08-26 16:11  JSCppInteractive\JSCppInteractive\JSCppInteractive.htm
     文件        5164  2015-08-26 15:39  JSCppInteractive\JSCppInteractive\JSCppInteractive.rc
     文件        5586  2015-08-26 15:39  JSCppInteractive\JSCppInteractive\JSCppInteractive.vcproj
     文件        4040  2015-08-26 16:11  JSCppInteractive\JSCppInteractive\JSCppInteractiveDlg.cpp
     文件         876  2015-08-26 16:07  JSCppInteractive\JSCppInteractive\JSCppInteractiveDlg.h
     文件        3053  2015-08-26 15:39  JSCppInteractive\JSCppInteractive\ReadMe.txt
     文件         587  2015-08-26 15:39  JSCppInteractive\JSCppInteractive\Resource.h
     目录           0  2015-08-26 16:23  JSCppInteractive\JSCppInteractive\res\
     文件       21630  2005-11-11 22:45  JSCppInteractive\JSCppInteractive\res\JSCppInteractive.ico
     文件         372  2015-08-26 15:39  JSCppInteractive\JSCppInteractive\res\JSCppInteractive.rc2
     文件         147  2015-08-26 15:39  JSCppInteractive\JSCppInteractive\stdafx.cpp
     文件        2534  2015-08-26 15:39  JSCppInteractive\JSCppInteractive\stdafx.h
     文件         913  2015-08-26 15:39  JSCppInteractive\JSCppInteractive.sln
     目录           0  2015-08-26 16:24  JSCppInteractive\debug\
     文件      110592  2015-08-26 16:11  JSCppInteractive\debug\JSCppInteractive.exe

评论

共有 条评论