Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 417
  • Last Modified:

VB, Com+ and Iobjectconstruct

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
cerdmann
Asked:
cerdmann
1 Solution
 
jinglisCommented:
Use createobject instead of the new operator
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now