CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2002
    Location
    England
    Posts
    530

    com+ dll runtime error - what am I doing wrong?

    Hi

    Have an unspectacular asp script
    Code:
    	set obj=Server.CreateObject("MyWeb_dll.clsUser")
    	obj.StartCom
    	set obj = nothing
    and this in clsUser in the dll (ripped off from the internet)
    Code:
    Public Sub StartCom()
    
        Dim objContext As ObjectContext
        Dim objResponse As Response
        Dim objRequest  As Request
        Dim objApplication  As Application
        Dim objSession As Session
        Set objContext = GetObjectContext()
            
        Set objApplication = objContext("Application") 'Obtain ASP Application object.
        Set objSession = objContext("Session") 'Obtain ASP Session object.
        Set objResponse = objContext("Response") ' Obtain ASP Response object.
        Set objRequest = objContext("Request")   ' Obtain ASP Request  object.
    
        'This code uses the Response object (objResponse);
        'you can use other intrinsic objects in a similar fashion.
        objResponse.Write "Hello World!"
            
    End Sub
    It errors when the code gets as far as setting objApplication. 91, object variable or with blobk variable not set. I've set references to MS ASP Object library and Com+ service type library. What am I not doing right? I am only debugging at the mo so haven't registered any compiled dll with the Component Services - is this where I could be going wrong? Could it be an IIS setting?

    Help!

  2. #2
    Join Date
    Sep 2002
    Location
    England
    Posts
    530

    Re: com+ dll runtime error - what am I doing wrong?

    Sussed it - set MTSTransactionMode to something other than 0.

    Cheers

  3. #3
    Join Date
    Mar 2005
    Posts
    2

    Exclamation Re: com+ dll runtime error - what am I doing wrong?

    HI Guys

    I am facing Similar problem . Setting class Transaction mode property to any other value does not solve the purpose. Pls help.

  4. #4
    Join Date
    Sep 2002
    Location
    England
    Posts
    530

    Re: com+ dll runtime error - what am I doing wrong?

    Hi

    What error are you getting and where? Same as I described above??

    Cheers

  5. #5
    Join Date
    Nov 2002
    Location
    Baby Land
    Posts
    646

    Re: com+ dll runtime error - what am I doing wrong?

    If all fails just pass the response, session, and application object to your dll, but remember to clean up all the references explicitly.

    But I would try registering the component with COM+ services first before changing your DLL design.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured