how do i CREATEOBJECT("aaa.bbb", "ip param") in C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • HDclubber
    New Member
    • Sep 2008
    • 2

    how do i CREATEOBJECT("aaa.bbb", "ip param") in C#

    I got this working script on VB.NET which createobject at remote server.
    i want to write it in C# - how can it be done ?

    VB.net code:
    oObj = CreateObject("a aa.bbb", "10.10.20.3 0")
  • balabaster
    Recognized Expert Contributor
    • Mar 2007
    • 798

    #2
    Code:
    aaa.bbb myVar = new aaa.bbb("ip param");
    Assuming that you've added the reference to your project that is. In VB, CreateObject simplifies some things in that respect that C# doesn't.

    This page may be of some help:

    Comment

    • HDclubber
      New Member
      • Sep 2008
      • 2

      #3
      Originally posted by balabaster
      Code:
      aaa.bbb myVar = new aaa.bbb("ip param");
      Assuming that you've added the reference to your project that is. In VB, CreateObject simplifies some things in that respect that C# doesn't.

      This page may be of some help:
      http://www.harding.edu/fmccown/vbnet...omparison.html

      Thanks... but this solution dosent work.
      I use DCOM client&server objects.
      i did reference to the COM object in the project.

      I need to pass ip param at the instantiate of this object so it will instantiate the COM object at the server.

      when i use this line in vb - it works fine:
      obj = CreateObject("a aa.bbb", "10.10.20.3 0");

      but when i use your solution in c # i get error:
      aaa.bbb obj = aaa.bbb("10.10. 20.30");
      Error 5 aaa.bbb' is a 'type', which is not valid in the given context

      Comment

      • balabaster
        Recognized Expert Contributor
        • Mar 2007
        • 798

        #4
        Originally posted by HDclubber
        Thanks... but this solution dosent work.
        I use DCOM client&server objects.
        i did reference to the COM object in the project.

        I need to pass ip param at the instantiate of this object so it will instantiate the COM object at the server.

        when i use this line in vb - it works fine:
        obj = CreateObject("a aa.bbb", "10.10.20.3 0");

        but when i use your solution in c # i get error:
        aaa.bbb obj = aaa.bbb("10.10. 20.30");
        Error 5 aaa.bbb' is a 'type', which is not valid in the given context
        You missed the keyword "new"

        Comment

        Working...