I must create a com object that has some methods described in an interface.
One of this methods is
new(par1,par2,par3) as short
The only problem is that i can't create a method with such name because it is seen as the constructor of the com object (and the constructor for the com object must have no parameters).
So when i write
Public
Function new(...) as shorti get the message
The constructor must be declared as Sub and not as Function

problem with com object
HKLOO
Sergio VB,
In order to get around this, you will have to create a parameterless constructor, and then have a method (most likely called Initialized) which you make sure is called every time a new instance is constructed.
If you are worried about this not being called, then you could create a class factory that will create the object, and make the call as well in one method.
Hope this helps.
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
Maksim Libenson
Regards,
Vikram
http://dotnetupdate.blogspot.com/
MattPorter
you can do this . thanks to VB.NET
DemoClass Public Sub [New]() End SubClass
End
Classclass App
public shared sub Main()
Dim d1 As New Demo
d1.[New]()
end sub
end class
Button_Tom
However my problem is that i am writing the com "server" but the com "client" is already developed and so i can't force the client to call server.[New](par1,...).
Any other suggestion