Previous Next

Thread: Problem calling COM component from client-side code

Last post 07-11-2008 9:47 AM by JaySullivan. 10 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (11 items)

Sort Posts:

  • 05-02-2008, 4:37 PM

    Problem calling COM component from client-side code

    Hello,

    I am working on getting a classic ASP application working under IIS 7 on a 64-bit Windows Server 2008 box.  It took me a long time to figure out how to access my VB6 COM+ component from ASP server-side code, but I got that working once I turned on the "Enable 32-bit Applications" property on the application pool that the app is running under.

    But now I want to be able to call the COM object from client-side code using RDS.  I am able to create the RDS DataSpace object and then a reference to the COM object without an error, but when I try to call the object I am getting "Internet Server Error".  Here is my sample code which is in a client-side vbscript routine:

      On Error Resume Next
      Set objDS = CreateObject("RDS.DataSpace")
      If Err.number <> 0 Then Exit Sub

      Set objTest  = objDS.CreateObject("MyObject.Code", "http://server1")
      If Err.number <> 0 Then Exit Sub
       
      Result = objTest.TestFunction()
      If Err.number <> 0 Then
        Msgbox "Error: " & Err.Description
      Else
        Msgbox "Test successful"
      End If

    This code works perfectly under IIS 6 on Windows 2003 when IIS6 is configured properly.  In IIS6 you need to add msadcs.dll as a Web Server Extension and create an MSADC virtual directory and application.  You also need to set the Execute Permissions on the MSADC application to "Scripts and Executables".

    I am wondering if I am missing the IIS7 equivalent of one of those steps.  I have added msadcs.dll to the ISAPI and CGI Restrictions list.  I have also enabled ISAPI-dll under Handler Mappings.  Am I missing something else?

    The object MyObject.Code is registered properly and is running under a COM+ application.  I have also added a MyObject.Code registry key under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\ADCLaunch.  I have no problem calling it from server-side ASP code, but I just can't seem to call it from client-side code using RDS.

    Any help would be greatly appreciated!
    Jay
     

  • 05-28-2008, 7:20 AM In reply to

    • m_mudford
    • Not Ranked
    • Joined on 05-28-2008, 11:19 AM
    • Posts 2

    Re: Problem calling COM component from client-side code

     

    hi dude, I have EXACTLY the same problem...  Did you manage to resolve it??

     

    Cheers

     Mike

  • 05-28-2008, 9:44 AM In reply to

    Re: Problem calling COM component from client-side code

    Unfortunately I got side-tracked on another project, so I haven't done any more work on this.  I'm still hoping someone will see this and have an idea, but I doubt that many people are still using RDS.



    Good luck figuring out the problem.  Please post something back if you get it working and I'll do the same.

    Thanks,

    Jay 

  • 05-29-2008, 11:27 PM In reply to

    Re: Problem calling COM component from client-side code

    I haven't supported RDS calls since IIS 5, so I forget if RDS was part of the MDAC stack or what.  Here is a KB article.  http://support.microsoft.com/kb/251122

     

    Steve Schofield
    Windows Server MVP - IIS
    http://weblogs.asp.net/steveschofield

    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget
  • 05-30-2008, 10:06 AM In reply to

    Re: Problem calling COM component from client-side code

    Steve,



    Thanks, I actually haven't seen that KB article before, but I am familiar with all of those common problems.  I think I have all of them covered except for possibly the one about setting permissions on the MSADC virtual directory.  In IIS 6 you just set the Execute Permissions to "Scripts and Executables".  What is the equivalent process in IIS 7 for making sure that the MSADC stuff is executable?  I added msadcs.dll to the ISAPI and CGI Restrictions list and also enabled ISAPI-dll under Handler Mappings.  Is there something else I need to do?  Or maybe the problem has nothing to do with this. 

    Thanks,

    Jay

     

  • 05-31-2008, 12:57 AM In reply to

    Re: Problem calling COM component from client-side code

    Did you set the proper settings to execute / script etc..  Inetmgr > Request Restrictions > Access?

    I would even try copying files from w2k3 associated with RDS.  I don't know if there is a DLL you can register on IIS 7.

    Steve Schofield
    Windows Server MVP - IIS
    http://weblogs.asp.net/steveschofield

    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget
  • 06-09-2008, 3:19 AM In reply to

    • m_mudford
    • Not Ranked
    • Joined on 05-28-2008, 11:19 AM
    • Posts 2

    Re: Problem calling COM component from client-side code

    Hiya,

     

    That night I emailed you, I got the damn thing working… Sorry I didn’t email you back sooner, but I got a bit side tracked, then I wanted to make sure I knew exactly what it was… Anyhow, here are the instructions:1)       Go into IIS Manager and select the computer name on the left.2)       Double click on “ISAPI and CGI Restrictions”3)       Add a new one pointing to this file: C:\Program Files\Common Files\System\msadc\msadcs.dll4)       Give it any name you like5)       Tick “Allow Extension path to execute” That’s what fixed it for me!!!
  • 06-09-2008, 9:45 AM In reply to

    Re: Problem calling COM component from client-side code

    Hi, thanks for getting back to me.  I'm glad you got it to work.  Unfortunately I had already added that DLL to ISAPI and CGI Restrictions and gave it the execute permission, but that didn't fix the problem.

    I'll keep looking and post something back if I get it working. 

     

  • 07-10-2008, 9:39 PM In reply to

    Re: Problem calling COM component from client-side code

    I just got this to work. Same problem, custom DLL works in server side but gives me 193 error on client side.

    You've got to make sure that the msadcs.dll in Web Server Extensions is in Program Files (x86) and not in Program Files. One houses 32 bit DLLs and the other 64 bit DLLs. Also, all the ISAPI filters for ASP must refer to Microsoft.net/framework and not Microsoft.net/framework64

    Hope this helps.

    Anna

     

  • 07-11-2008, 1:39 AM In reply to

    Re: Problem calling COM component from client-side code

    Thanks for posting a workaround.  I'm assuming your system is x64 running 32 bit app pools?

    Steve Schofield
    Windows Server MVP - IIS
    http://weblogs.asp.net/steveschofield

    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget
  • 07-11-2008, 9:47 AM In reply to

    Re: Problem calling COM component from client-side code

    Darn, Anna beat me to the punch!  I forgot to post a message back, but my problem was also solved when I added the MSADCS.DLL extension from the 32-bit Program Files folder rather than the 64-bit Program Files folder.

Page 1 of 1 (11 items)
Page view counter