Board index » delphi » how do you call a D5 COM server from MS Outlook (using VB script)

how do you call a D5 COM server from MS Outlook (using VB script)

hello everyone..

i have a small test COM server working in Delphi.  to test
it i wrote a small test bed (also in delphi).  i now need
to create and call the COM server from the OnClick event
of a MS Outlook 2000 custom form.

i am having difficulty "translating" my Delphi "COM object creation code" (see below) into the correct VB script code.

can someone point me in the right direction ?

thank you very much
mark
// working code from delphi test bed
// to create and call the COM server object

var
  my_breach_obj : Ibreach;
  i : integer;
begin
  // create first object
  my_breach_obj := CreateComObject (CLASS_Breach) as IBreach;
  i := my_breach_obj.Getbreachdata(1);
  label1.caption := inttostr(i);
end;

// the following is an attempt to translate the
// code above into VB script

Sub CommandButton1_Click
  Set myObj = CreateObject("c:\proj_d5\breach_srv\breach_srv.ibreach")

Item.UserProperties.Find("MyField1").value = myobj.getbreachdata(1)

End Sub

 

Re:how do you call a D5 COM server from MS Outlook (using VB script)


Should be something like:

Assuming your server DLL is named Foo and your Breach coclass is named
Breach

set my_breach_obj = CreateObject ("Foo.Breach")

have fun
--
Binh Ly
http://www.techvanguards.com

Quote
"mark meyer" <markm...@logs.com> wrote in message news:39f5ea50$1_1@dnews...
> // working code from delphi test bed
> // to create and call the COM server object

> var
>   my_breach_obj : Ibreach;
>   i : integer;
> begin
>   // create first object
>   my_breach_obj := CreateComObject (CLASS_Breach) as IBreach;
>   i := my_breach_obj.Getbreachdata(1);
>   label1.caption := inttostr(i);
> end;

> // the following is an attempt to translate the
> // code above into VB script

> Sub CommandButton1_Click
>   Set myObj = CreateObject("c:\proj_d5\breach_srv\breach_srv.ibreach")

> Item.UserProperties.Find("MyField1").value = myobj.getbreachdata(1)

> End Sub

Other Threads