declarative attribute troubles

Results 1 to 2 of 2

Thread: declarative attribute troubles

  1. #1
    Join Date
    Dec 1969

    Default declarative attribute troubles

    I am trying to grab a declarative attribute in a VB COM+ component. The code that I&#039m using is the following:<BR><BR>at the top of the class:<BR>Implements COMSVCSLib.IObjectConstruct<BR>Private MyConnectionString As String<BR><BR>in the body of the class: <BR>Private Sub IObjectConstruct_Construct(ByVal pCtorObj As Object)<BR> Dim cs As IObjectConstructString<BR> Dim MyConnectionString As String<BR> Set cs = pCtorObj<BR> MyConnectionString = cs.ConstructString<BR>End Sub<BR><BR>then in the private sub class_initialize:<BR>Private Sub Class_Initialize()<BR> Dim oContext As COMSVCSLib.ObjectContext<BR> Set oContext = GetObjectContext()<BR> Dim pCtorObj As Object<BR> IObjectConstruct_Construct pCtorObj &#039&#060;-- I call the sub<BR> DbConnect<BR>End Sub<BR><BR>This generates an error &#039 91&#039; Object variable or With block variable not set<BR><BR>I&#039m thinking that it is in the calling of the sub that I&#039m not sending the right object, but the article( from which I got the iObjectConstruct_Construct sub from never specified how to call the sub. It just says that &#039the reference passed by the pCtorObj parameter is cast to the IObjectConstruct interface&#039?!<BR><BR>Thanks for your help, SamC

  2. #2
    Richard A. Lowe Guest

    Default RE: declarative attribute troubles

    You are passing a variable called pCtorObj with a type (Object) but no value. The value is Nothing and I guess COM doesn&#039t like this. What do you want pCtorObj to be??? What does it represent?? <BR><BR>Richard

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts