Home All Groups Group Topic Archive Search About

Linking to a new API - help please!!

Author
2 Jun 2005 11:24 AM
GT
I am trying to write an application with an API (in C++). It produces a .TLB
and a .EXE file. I have 3 test harnesses to check the work a C++ test
harness links to it just fine, but in MS VB and MS J++, I can't get it to
work:

In the VB test harness, we can link to excel using the code:
    Dim myApplication As New Excel.Application
We can then do anything expected with the excel application.


However the same code for out little test API application won't work:
    Dim api_test As TEAPI.TEAPIDocument
Doing anything with the application causes:
"Run-time error -2147024770 (8007007e) Automation Error. The specified
module could not be found"


HELP!!!!
Is there another group I could ask??

Author
2 Jun 2005 11:39 AM
GT
"GT" <contactGT_remo***@hotmail.com> wrote in message
news:30Cne.53796$Li.18151@fe1.news.blueyonder.co.uk...
>I am trying to write an application with an API (in C++). It produces a
>.TLB and a .EXE file. I have 3 test harnesses to check the work a C++ test
>harness links to it just fine, but in MS VB and MS J++, I can't get it to
>work:

I forgot to say - in the C++ test app, I have to make a call to
"CoInitialize(NULL)" before it will link to the API app. Is there an
equivalent to "CoInitialize(NULL)" in VB or VJ++??

Show quoteHide quote
> In the VB test harness, we can link to excel using the code:
>    Dim myApplication As New Excel.Application
> We can then do anything expected with the excel application.
>
>
> However the same code for out little test API application won't work:
>    Dim api_test As TEAPI.TEAPIDocument
> Doing anything with the application causes:
> "Run-time error -2147024770 (8007007e) Automation Error. The specified
> module could not be found"
>
>
> HELP!!!!
> Is there another group I could ask??
>
>
Author
2 Jun 2005 6:03 PM
Dick Grier
Hi,

Did you add a reference to your TLB using the Project/References menu?

--
Richard Grier  (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 4th
Edition ISBN 1-890422-28-2  (391 pages) published July 2004.  See
www.mabry.com/vbpgser4 to order.