This is Csharp code for initializing the Object
how can i write this line in VB6 so that it also show me the intellisense like in CsharpCode:PPrivew Privew = new PPrivew( "Val1", "Val2", "Val13", "Val13","Val4" );
Printable View
This is Csharp code for initializing the Object
how can i write this line in VB6 so that it also show me the intellisense like in CsharpCode:PPrivew Privew = new PPrivew( "Val1", "Val2", "Val13", "Val13","Val4" );
The following should do the job of Initializing a class object using constructor
Dim Privew As New PPrivew("Val1", "Val2", "Val13", "Val13","Val4" )
What object are you trying to initialize? Some kind of print preview control?
this isn't possible in VB6
Dim Privew As New PPrivew("Val1", "Val2", "Val13", "Val13","Val4" )
VB6 doesn't allow for alternate constructors...
you have to do it in multi-steps:
-tgCode:Dim Privew As PPriview
SET Priview = New PPrivew
Priview.Val1 = ""
.
.
.
Yes its a print preview control
techgnome that will not work
vb Code:
Priview.Val1 = ""
you are setting val1 as a property
val1 is a argument
and that code shows error message that "invalid use of new keyword" :(
And where did you get this control?
"Some kind of print preview control?"
"And where did you get this control?"
is that really matters?
code converstion tools suggest this format
Dim Privew As New PPrivew("Val1", "Val2", "Val13", "Val13","Val4" )
but this is wrong
plz help
i dont think constructors exists in vb6, you have to find some alternative way to initialize your object.
I *know* that.... but you *CAN'T* use parameterized constructors in VB6. Simple as that. So that means you have to new-up the object first, THEN set the parameters, hopefully the parameters are exposed through properties of some kind.Quote:
Originally Posted by xor83
That actually then answers the next question I had, which was if the object has a parameterless constructor. It does not. That essentially renders the object useless in VB6.Quote:
and that code shows error message that "invalid use of new keyword" :(
-tg