|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Accessing shared member - need understanding - pretty please :-)I'm trying to use the process class through an instance of the class. As
follows, Dim MyProc as Process = Myproc.start(Filename) (where filename is a string variable having the full path of the file to use) In the IDE (Vs2005 - VB) I see there is a warning underline on that line saying that Access of a shared member etc... through an instance, qualifying expression will not be evaluated. So I look at the docs, Ok it confirms that it won't work, fine. Question is HOW do you make it work so that you CAN get the expression evaluated and executed correctly. I've seen this message a few times before in other situations, but never found any info on what to do when you get this or how to do something else that works. Any help would be greatly appreciated. Bob Bob,
For shared methods, refer to the method using classname.method, not object.method: Dim MyProc as Process = Process.Start(Filename) Kerry Moorman Show quoteHide quote "Bob" wrote: > I'm trying to use the process class through an instance of the class. As > follows, > > Dim MyProc as Process = Myproc.start(Filename) (where filename is a string > variable having the full path of the file to use) > > In the IDE (Vs2005 - VB) I see there is a warning underline on that line > saying that Access of a shared member etc... through an instance, qualifying > expression will not be evaluated. > So I look at the docs, Ok it confirms that it won't work, fine. Question is > HOW do you make it work so that you CAN get the expression evaluated and > executed correctly. > I've seen this message a few times before in other situations, but never > found any info on what to do when you get this or how to do something else > that works. > Any help would be greatly appreciated. > Bob > > > Bob,
A shared class is in fact not different from a Module. You don't have to instance it, it is fixed located in the mainstack of a program and in fact no OOP. You can reference it by SharedClassName.methode or SharedClassName.property or whatever public member in that Shared class or module. I hope this helps, Cor Show quoteHide quote "Bob" <bduf***@sgiims.com> schreef in bericht news:e3xwx2HwGHA.3936@TK2MSFTNGP04.phx.gbl... > I'm trying to use the process class through an instance of the class. As > follows, > > Dim MyProc as Process = Myproc.start(Filename) (where filename is a string > variable having the full path of the file to use) > > In the IDE (Vs2005 - VB) I see there is a warning underline on that line > saying that Access of a shared member etc... through an instance, > qualifying expression will not be evaluated. > So I look at the docs, Ok it confirms that it won't work, fine. Question > is HOW do you make it work so that you CAN get the expression evaluated > and executed correctly. > I've seen this message a few times before in other situations, but never > found any info on what to do when you get this or how to do something else > that works. > Any help would be greatly appreciated. > Bob >
Waiting for process end , how?
CurrentUser Ctype vb 2005 express > querry table in access and put contents into array Fill up string array with random characters? Dim DBh as new DBhandler vb.net 2.0 question Edit and Continue Draw Line in a specific picturebox team foundataion server hard drive type |
|||||||||||||||||||||||