[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Using a COM with VB.Net

Posted on 2007-08-08
9
Medium Priority
?
1,167 Views
Last Modified: 2013-11-07
I am trying to use a COM with VB.Net and it sounds like I need to create a "wrapper" to use it.I read the article here:

http://www.csharphelp.com/archives2/archive437.html

but Im still having problems.  When I go to the command prompt and try to run  tlbimp.exe it doesnt work.  When I type in "tlbimp" it says "'tlbimp' is not recognized as an internal or external command, operable program or batch file".  I do however have it on my machine.

HEre is the code I am running in my program, which is generating COM exceptions.  

Imports System
Imports busobj
Imports System.Runtime.InteropServices

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim BusObjApp As New busobj.Application
        Dim BusObjRep As New busobj.Report

When I try to create the new business objects report I get the COM exception.

"Retrieving the COM class factory for component with CLSID {2AE0D397-5F2A-11D0-8B75-0000C0FDEBE3} failed due to the following error: 80040154."

I've been stuck on this for a while now....and ideas would be greatly appreciated.


0
Comment
Question by:collages
  • 4
  • 4
9 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 19653597
1) What version of 2005 do you have?  Express Edition, Professional, Team Suite?

2) Where was the COM component created?

Bob
0
 
LVL 1

Author Comment

by:collages
ID: 19653640
I am running VB 2005 express.

The COM component is part of Business Objects 6.1.  I am trying to automate running reports.  The COM is the busobj import in the code I posted.  It is called "BusinessObjects 6.0 Object Library".
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 19653940
You should be able to add a reference to a COM through the 'Add Reference' dialog box.  .NET will create the wrapper class for you automatically (Interop.dll).

Bob
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 1

Author Comment

by:collages
ID: 19653983
Ok...maybe I have another problem then.  I added the reference and have the following code right now:

Imports System
Imports busobj
Imports System.Runtime.InteropServices

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim BusObjApp As New busobj.Application
        Dim BusObjRep As New busobj.Report

But when I try to create the new report I get the COMException.  

Is there something wrong with my code, or does this look like another problem?
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 1600 total points
ID: 19654253
1) The underlying COM library isn't installed.

2) ActiveX cannot create object.

Bob
0
 
LVL 1

Author Comment

by:collages
ID: 19655558
How do I check to make sure the COM library is installed?  I think it is becaise I can run the application (Business Objects) just fine.

0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 19655592
There is a convoluted way, by looking through the registry under HKEY_CLASSES_ROOT\CLSID for the {2AE0D397-5F2A-11D0-8B75-0000C0FDEBE3} GUID.

Bob
0
 
LVL 34

Assisted Solution

by:Sancler
Sancler earned 400 total points
ID: 19656080
I wonder if there is a license issue here?  Although the error numbers are supposed to be different - 80040154 for not registered and 80040112 for not licensed - I seem to recall facing, or reading about, an 80040154 error being reported when, although the relevant files were on, and registered on, the system concerned they were only licensed for direct USE and not for inclusion with or reference by a developed applicant.  Sorry, I can't remember more details, and a quick Google hasn't sparked any more specific memories.  But it's an angle you might like to consider.

Roger
0
 
LVL 1

Author Comment

by:collages
ID: 19656384
Well, I think this might be my own noobness (is that word?) at work here.

Instead of creating a new report I noticed I have the option to create a new document.  Well, I created that and it doing everything I need it to do.

I dont have any documemtation on the business objects library so Im kind of poking in the dark here, but for now I think im cool to move forward.  Thanks for your help guys.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month18 days, 2 hours left to enroll

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question