Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 507
  • Last Modified:

Convert creatObject from VB to C# equivalent

Hi Gents,

There is a line in VB that I can't seem to get working or a translation to work in C#. I'm really stuck any ideas?

Old VB code...
moAB = Microsoft.VisualBasic.Interaction.CreateObject("Broker.Application", "");

New C#?

Let me thank your efforts in advance.

Cheers - Sean
0
Dynotoe
Asked:
Dynotoe
  • 2
2 Solutions
 
brendanmeyerCommented:
have a look at http://msdn.microsoft.com/en-us/library/system.activator.createinstance.aspx

http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/128e5981-35ce-436a-9323-e2fafdbecbbd/
Dim SomeObject As Object = System.Activator.CreateInstance(GetType(Button))
        // C# ?? >>
Object SomeOject = System.Activator.CreateInstance(GetType(Button));

Open in new window

0
 
anarki_jimbelCommented:
Yes, there is no analog for the function in C#. However, try this:

http://msmvps.com/blogs/pauldomag/archive/2006/03/15/86417.aspx

Also, have a  look:

http://msmvps.com/blogs/pauldomag/archive/2006/03/15/86417.aspx

Eventually, you may use this VB code in C#, just need to add a reference to Microsoft.VisualBasic ...
0
 
DynotoeAuthor Commented:
Well, I'm totally stuck.  I  tried zip up and attached the project but it wouldn't let me on EE ...I would really appreciate anyone who can get it to build and run.  Run -- > Only so the window gui comes up.
I can email it to you.  Let me know.

There are only 11 build errors.  Remember this use to be in VB.

Best - Sean
0
 
DynotoeAuthor Commented:
oh forgot...please help

seanpatrickoneill  aattee comcast.net
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now