🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #10422

COM (BCB6)

#10422
From: Oliver Young
Date: Thu, 29 Apr 2004 06:51
47 lines
1852 bytes
    Yes, I know this is not proper newsgroup to ask, but I have to. :< I'm
asking this question for past 6 months and no answer. I'm trying to
translate JScript (or Delphi) code into C++ (BCB6). 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.
Technical Details
Message-ID: <4090a604$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,c2137044da8cd787,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-04-29 00:09:30 PST
From: "Oliver Young" <none>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: COM (BCB6)
Date: Thu, 29 Apr 2004 08:51:51 +0200
Lines: 49
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 193.138.1.206
Message-ID: <4090a604$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1083221508 193.138.1.206 (28 Apr 2004 23:51:48 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail