SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Resident OCD goofball! bronze trophy Serenarules's Avatar
    Join Date
    Dec 2002
    Posts
    1,911
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)

    Strange question on CreateObject

    Basicly, what happened to the CreateObject(pid, host) version of this method in .NET 4.0 C#? I can't seem to locate any information at all on how to instantiate a COM+ service located on a remote server. The current version is HttpContext.Current.Server.CreateObject(pid) or (type), but you can't specify host. My guess is that I need to instantiate a HttpServerUtility for the required server, but I have no clue how to go about that. Any ideas?

  2. #2
    Resident OCD goofball! bronze trophy Serenarules's Avatar
    Join Date
    Dec 2002
    Posts
    1,911
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)
    For those interested, the answer is:

    Code Csharp:
    // get a type by asking the remote server for it
    Type type = Type.GetTypeFromProgId("Foo.Bar.Thing", "1.2.3.4");
    // then instantiate it with the reflection activator
    IFooBarThing thing = Activator.CreateInstance(type) as IFooBarThing;

    Aparently, things just got moved around. The functionality is still there.


Bookmarks

Posting Permissions

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