1

Since the main application is in vbscript and it's uncomfortable to work with to do some things, I have to make something to be called from that app, so I've been asked to develop a dll to be used in an old vbscript IDE application.

I'm new to this kind of development... But I think I should create a COM Object. The thing is that not only I've never created a COM Object, but also... even when I've found this without much digging, it doesn't speak much of how to create them in VS2012 (My only IDE)

The question(s) is(are):

  • Is COM object the solution I'm looking for? (maybe it's something else, what you do to develop an object to be used in vbscript)
  • Is System.ComponentModel.Component and COM Object the same?
  • How do I do it in VS2012?
  • Which are the steps I have to make (besides those you do when creating a simple console app) that I should remember to do to make it work properly?

TIA!

Alex K.
  • 171,639
  • 30
  • 264
  • 288
apacay
  • 1,702
  • 5
  • 19
  • 41
  • 1
    Yes, COM is the best choice to allow a COM aware Windows Scripting Languages like VBS to interoperate with code in another language. See [How do I Create an ActiveX (COM) in C#?](http://stackoverflow.com/questions/3360160/how-do-i-create-an-activex-com-in-c) – Alex K. Jul 01 '13 at 14:02
  • But I can't seem to find `System.Runtime.InteropServices` in vs2012 – apacay Jul 01 '13 at 14:12
  • Create a new c#(?) class library project & just add `using System.Runtime.InteropServices;` – Alex K. Jul 01 '13 at 14:15
  • I can create a `Component` from `System.ComponentModel` and when I dig a bit into the packaged class, it uses `System.Runtime.InteropServices`... I don't have to add any reference... Ok, I'll try the steps on your link! – apacay Jul 01 '13 at 14:25
  • Do you know of any usage example on the web of `System.ComponentModel.Component`? – apacay Jul 01 '13 at 16:29
  • Why do you want to use it? To create a COM object follow the instructions in the linked post, no direct use of System.ComponentModel.Component is required in that simple case. – Alex K. Jul 01 '13 at 16:37
  • Sorry, I thought it was the vs2012 way of doing COMs... but I saw this (http://stackoverflow.com/q/4667057/684646) so I'll do what you said, and close this if it works – apacay Jul 01 '13 at 16:41
  • Ow so... it doesn't work... but I think it's not working because of what references it has internally. This is the new question http://stackoverflow.com/q/17472913/684646 Should I close this one? – apacay Jul 04 '13 at 14:49

0 Answers0