JavaScript function code:
Function a () {return 5;}
VC code: CScriptControl test; create.create ("Testscript", 0, Rect, THIS, 100); Test.SetLanguage ("javascript"); cstring strstat = "function a () {" Return 5; "} RET = a (); "Test.addcode (strStat); variant a = test.eval (" RET "); AFXMessageBox (_BSTR_T (a));
This will make the script and the calling program interaction.