Board index » cppbuilder » COM call from BCB6
Oliver Young
![]() CBuilder Developer |
COM call from BCB62004-04-13 04:35:50 PM cppbuilder10 Few months ago I've tryied to get some help here translating JScript COM code to BCB (command line) COM code, but without success. Now, I again need it. Please help. *** This is JScript code: *** var myapp = new ActiveXObject("MyCOM.MyApp.1"); var prop = myapp.CreatePropObject(); myapp.Param1 = "Some text here"; myapp.Param2 = ""; myapp.Param3 = true; myapp.Param4 = true; var res = myapp.MyFunc(prop); WScript.StdOut.WriteLine("Error code: " + res.error); *** This is Delphi code: *** program Project1; {$APPTYPE CONSOLE} uses SysUtils, ComObj, Windows, Classes, ActiveX, Variants; var MyApp, prop, res: Variant; begin CoInitialize(nil); MyApp := CreateOleObject('MyCOM.MyApp.1'); prop := MyApp.CreatePropObject; prop.Param1 := 'Some text here'; prop.Param2 := ''; prop.Param3 := True; prop.Param4 := True; res := MyApp.MyFunction(prop); WriteLn( 'Error: ' + VarToStr(res.error)); CoUninitialize(); end. |