Solved

VB, Com+ and Iobjectconstruct

Posted on 2000-02-16
1
389 Views
Last Modified: 2010-05-18
I can't get my vb program to implement Iobjectcontruct to pull a connection string from my COM+ services.

I followed what microsoft has to say:

Make sure your project has a reference to "COM+ 1.0 Services Type Library".


In your class module, beneath any Option statements, add the following line of code:
Implements IObjectConstruct

You may also add a private class-level variable to hold the string:
Private msConstructorString As String

In the scope list box in your code editor, where it reads "(General)", you should have a new item called IObjectConstruct. When you select it the IObjectConstruct_Construct function will be added to your class.

Add the following code to it so the function looks as follows:
Private Sub IObjectConstruct_Construct(ByVal pCtorObj As Object)
     msConstructorString = pCtorObj.ConstructString
End Sub
This retrieves the ConstructString and stores it in your private variable.



but it never hits the iobjectconstruct_construct sub routine.
Any suggestions?

Craig
0
Comment
Question by:cerdmann
1 Comment
 

Accepted Solution

by:
jinglis earned 200 total points
ID: 2540625
Use createobject instead of the new operator
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

679 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