quote:
Originally posted by Hilikus
activexObject calls the default constructor, what if i want to call a constructor with parameters??
Sorry, you can't. Classes instantiated through COM interop must have a default (public, parameterless) constructor.
You should be able to easily work around this in most cases, by providing properties to set whatever you would have set through constructor's parameters.
Where that isn't possible (you are using somebody else's class or it is essential to your logic to have the parameter passed at creation time), use a helper class with a public method which takes the parameters, creates the class instance passing parameters to the constructor, and returns the created object.