473,770 Members | 4,552 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

2 New Member
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")
Sep 18 '08 #1
3 2101
balabaster
797 Recognized Expert Contributor
Expand|Select|Wrap|Line Numbers
  1. 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
Sep 18 '08 #2
HDclubber
2 New Member
Expand|Select|Wrap|Line Numbers
  1. 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
Sep 18 '08 #3
balabaster
797 Recognized Expert Contributor
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"
Sep 18 '08 #4

Sign in to post your reply or Sign up for a free account.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.