From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,735b02d48e42b444,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-02-22 16:38:02 PST Message-ID: <3A95B085.80E74851@heaven.org> Date: Fri, 23 Feb 2001 03:36:22 +0300 From: Anatoly Chernyshev X-Mailer: Mozilla 4.7 [en] (WinNT; I) X-Accept-Language: ru,en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Bug in GNATCOM? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 194.87.97.236 X-Original-NNTP-Posting-Host: 194.87.97.236 X-Trace: 22 Feb 2001 18:01:18 -0600, 194.87.97.236 Organization: usenet.com http://www.usenet.com 80,000+ UNCENSORED Newsgroups. The #1 Usenet Service on the Planet! X-Comments: This message was posted through Usenet.com's, FREE publicly accessible Usenet Server - "post.usenet.com" X-Comments2: IMPORTANT: Usenet.com does not condone, nor support, spam or any illegal or copyrighted postings. X-Comments3: IMPORTANT: Under NO circumstances will postings containing illegal or copyrighted material through this service be tolerated!! X-Report: Please report illegal or inappropriate use to X-Abuse-Info: Please be sure to forward a copy of ALL headers, INCLUDING the body (DO NOT SEND ATTACHMENTS) Path: supernews.google.com!sn-xit-03!supernews.com!news-out.usenetserver.com!news-out.usenetserver.com!europa.netcrusader.net!204.71.68.178!out!post.usenet.com!194.87.97.236 Xref: supernews.google.com comp.lang.ada:5448 Date: 2001-02-23T03:36:22+03:00 List-Id: **** 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 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=