unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Memo1: TMemo; Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} uses ComObj; {此函数需要 ComObj 单元的支持} {参数 JsCode 是要执行的 Js 代码; 参数 JsVar 是要返回的变量} function RunJs(const JsCode, JsVar: string): string; var script: OleVariant; begin try script := CreateOleObject('ScriptControl'); script.Language := 'JavaScript'; script.ExecuteStatement(JsCode); Result := script.Eval(JsVar); except Result := ''; end; end; procedure TForm1.Button1Click(Sender: TObject); var s: string; begin s := RunJs(Memo1.Text, 'str'); ShowMessage(s); end; end.
http://www.360doc.com/content/11/1117/22/7887676_165336337.shtml
C++Builder 资料库CSIDL_DESKTOP; //桌面
CSIDL_DESKTOPDIRECTORY ; //桌面目录
http://blog.csdn.net/goodai007/article/details/6942841
http://blog.csdn.net/chiengod/article/details/309466
//sValidation=验证
//sCaption=功能名
//sHint=说明或介绍
//sCategory=类别名
//sLocaleID=本地ID
//sAppVerMin=版本
//sShortcutKey=快捷键
function main(i){
return i*i;
}