From: Anatoly Chernyshev <gesture@heaven.org>
Subject: Bug in GNATCOM?
Date: Fri, 23 Feb 2001 03:36:22 +0300
Date: 2001-02-23T03:36:22+03:00 [thread overview]
Message-ID: <3A95B085.80E74851@heaven.org> (raw)
**** Post for FREE via your newsreader at post.usenet.com ****
Hello,
I'd tried to play a little with adatovb sample from GNATCOM package.
First, I changed the VB class in this way:
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "AdaToVBClass"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Ext_KEY = "SavedWithClassBuilder" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
Public Sub Display(Message As String, a As Single)
MsgBox Message & Str$(Sin(0.25) + 915 * a)
End Sub
Public Function Display1() As Integer
Display1 = MsgBox("What?", vbOKCancel)
End Function
Private Sub Class_Initialize()
MsgBox "You are welcome"
Form1.Show '--Form1 is mere a "native" empty form
End Sub
Then, I built the Dll and rewrote client.adb:
with GNATCOM.Initialize;
with GNATCOM.Types;
with GNATCOM.BSTR;
with AdaToVB.UAdaToVBClass_Interface; use
AdaToVB.UAdaToVBClass_Interface;
with interfaces.c;
with ada.text_io; use ada.text_io;
procedure Client is
Object : UAdaToVBClass_Type;
Msg : aliased GNATCOM.Types.BSTR := GNATCOM.BSTR.To_BSTR
("Hello");
fg : interfaces.c.short;
fg1: aliased interfaces.c.c_float;
begin
GNATCOM.Initialize.Initialize_COM;
Create (Object, AdaToVB.CLSID_AdaToVBClass);
for i in 1..2 loop
fg1:=interfaces.c.c_float(i*0.05);
Display (Object, Msg'Unchecked_Access, fg1'unchecked_access);
end loop;
for i in 1..7 loop
fg:=display1(object);
put ("Reply: " & interfaces.c.short'image(fg));
new_line;
end loop;
GNATCOM.BSTR.Free (Msg);
end Client;
Everything worked fine except during object initialization the form
didn't appear and I was getting error message:
raised GNATCOM.ERRORS.COM_ERROR : HRESULT (2148139414) :
When I used the same dll from VB program I had no errors though.
I don't know whether it is a GNATCOM bug or my misunderstanding of
something... Any help/ideas on how to correct this point would be
greatly appreciated.
Thanks in advance,
Anatoly
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
*** Usenet.com - The #1 Usenet Newsgroup Service on The Planet! ***
http://www.usenet.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
next reply other threads:[~2001-02-23 0:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-02-23 0:36 Anatoly Chernyshev [this message]
2001-02-26 23:42 ` Bug in GNATCOM? David Botton
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox