Results 1 to 10 of 10

Thread: (Remotely) Creating COM+ Object in App

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2001
    Location
    Calgary, AB Canada
    Posts
    42

    (Remotely) Creating COM+ Object in App

    Here is the scenario.

    I have written a DLL that connects to Exchange and extracts the list of contacts and thier various properties / fields.

    This DLL must reside on the exchange server as it cannot connect to exchange and extract this information any other way. (that I know of)

    I have written a client application that will reside on a desktop (or other server) on the same network. This application needs to "connect" to the DLL on the exchange server and call a function that returns this list of contacts.

    I have set the DLL to be a COM+ object, and if the application resides on the same computer (exchange server) as the COM object then it works and the data is retrieved.

    However any attempt to run the application on a different workstation on the same network fails to create the COM+ object.

    Am I even on the right track here?

    How should the COM+ object be configured?
    What if anything should be configured on the client machine(s)?
    How should the code create this object?

    Using VB6.

    Any help or direction would be greatly appreciated.

  2. #2

    Thread Starter
    Member
    Join Date
    Nov 2001
    Location
    Calgary, AB Canada
    Posts
    42

    Re: (Remotely) Creating COM+ Object in App

    • I copied the "remote.dll" to the server
      On the Server
      • I registered the DLL using regsvr32 "path\remote.dll"
        I ran "Component Services"
        I selected "Component Services\Computers\My Computer\COM+ Applications
        Here I created a New empty Application
        I gave it a name "remote.dll" for example purposes
        I selected "server" application
        I selected "Network Service - Built in service account with network access"
        I left everything else at its default value and clicked finish
        I then opened the new "remote" component and dragged the dll to the "components" folder so that a list of all of the classes contained in the DLL were exposed
        I then started the COM by right clicking on it and selecting Start. The little plus sign started moving so it appears to be running.


    My client application (written in VB6) does not "reference" the DLL. I connect to the DLL in the following manner

    Code:
      Dim myObj as Object
    
      Set myOjb = CreateObject("remote.myClass")
    I have installed the client code on the exchange server and when I run it, everything works. Although it seems to me that it would work even if I hadn't added the object in the Component Services since the DLL is registered.

    The dilmena is when running the client from my workstation or any other computer other than the server that the DLL is installed on.

    I have modified the code to read

    Code:
      Set myObj = CreateObject("remote.myClass","exchange")
    "exchange" being the "name" of the server containing the DLL.

    This simply doesn't work. So the questions that come to mind are.

    Did I set the COM object up properly?
    Did it really need to be registered?
    Do I need to be a "system" administrator on the server that I copied and registered the DLL on?

    Is CreateObject the correct function to use in this case?
    Is the syntax correct?

  3. #3
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961

    Re: (Remotely) Creating COM+ Object in App

    I have gotten this type of thing to work with DCOM. Maybe you should try using DCOM instead of COM+?
    Nobody knows what software they want until after you've delivered what they originally asked for.

    Don't solve problems which don't exist.

    "If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)

    2 idiots don't make a genius.

  4. #4
    Junior Member
    Join Date
    Mar 2006
    Posts
    24

    Re: (Remotely) Creating COM+ Object in App

    hope no on minds bringing this old thread up, but i searched the forumsfor DCOM syntax and found this and this(http://www.vbforums.com/showthread.php?t=386735)

    now these were examples of late binding. how would i use DCOM with early binding. and is the syntax same in VB.NET as in VB6

  5. #5
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961

    Re: (Remotely) Creating COM+ Object in App

    To use Early Binding in VB6, reference the DCOM Object in the project and
    VB Code:
    1. Set Object = New Library.Class
    Nobody knows what software they want until after you've delivered what they originally asked for.

    Don't solve problems which don't exist.

    "If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)

    2 idiots don't make a genius.

  6. #6
    Junior Member
    Join Date
    Mar 2006
    Posts
    24

    Re: (Remotely) Creating COM+ Object in App

    but how do i reference the object when its not installed on the client machine, on ehich i am developing the application. and also i plan to use vb.net. i will appreciate if u can give some info abt thaT

  7. #7
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961

    Re: (Remotely) Creating COM+ Object in App

    Early binding requires the proper installation of the ActiveX Object, local and/or remote.
    Nobody knows what software they want until after you've delivered what they originally asked for.

    Don't solve problems which don't exist.

    "If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)

    2 idiots don't make a genius.

  8. #8
    Junior Member
    Join Date
    Mar 2006
    Posts
    24

    Re: (Remotely) Creating COM+ Object in App

    a'right. thank you very much

  9. #9
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961

    Re: (Remotely) Creating COM+ Object in App

    I would also assume late binding of an ActiveX Object also requires the proper installation of said the ActiveX Object library.
    Nobody knows what software they want until after you've delivered what they originally asked for.

    Don't solve problems which don't exist.

    "If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)

    2 idiots don't make a genius.

  10. #10
    Frenzied Member yrwyddfa's Avatar
    Join Date
    Aug 2001
    Location
    England
    Posts
    1,253

    Re: (Remotely) Creating COM+ Object in App

    A few thoughts (don't know if they're going to be useful)

    I extensively use the CreateObject(Class,Server) syntax to access remote COM+ objects. This requires that

    (i) The COM+ object is configured - you appear to have done this correctly; one (very) minor niggle is the configured identity. Test it with a Domain Admin account first, then 'go-live' with an account that only has the permissions required to make it work. Doing it with a DomAdmin account ensures that your plumbing and code logic are fine. You don't need to worry about security issues until you put it live.

    (ii) The typelib generated when the ActiveX control is built needs to be installed on the client machine. You can do this simply by registering the DLL on the client machine, or you can export the the TypeLib when you make your DLL and register that instead.(for simplicity to begin with register the DLL on the client machine using regsvr32)

    (iii) Make sure Binary Compatibility is set. It is conceivable that you have mismatched IID's etc etc.

    (iv) As good practice - ie not essential to getting things working - seperate your interface from your implementation. Ideally this, along with (ii) and (iii) should be achieved using IDL, and MIDL.

    One last thing . . . you mention that it doesn't work, but I can't find any reference to any error messages? if you can provide an error message or two then that might be helpful.
    "As far as the laws of mathematics refer to reality, they are not certain; and as far as they are certain, they do not refer to reality." - Albert Einstein

    It's turtles! And it's all the way down

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