Click here to Skip to main content
16,010,392 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Syntax Highlighting Pin
The ANZAC21-Jan-08 14:06
The ANZAC21-Jan-08 14:06 
GeneralRe: Syntax Highlighting Pin
The Mighty Atom22-Jan-08 2:04
The Mighty Atom22-Jan-08 2:04 
GeneralGetting the number of rows from a table adapter query Pin
AAGTHosting19-Jan-08 17:17
AAGTHosting19-Jan-08 17:17 
GeneralQuestion about Shared modifier Pin
Alaric_19-Jan-08 11:04
professionalAlaric_19-Jan-08 11:04 
GeneralRe: Question about Shared modifier Pin
Luc Pattyn19-Jan-08 11:51
sitebuilderLuc Pattyn19-Jan-08 11:51 
GeneralRe: Question about Shared modifier [modified] Pin
Alaric_19-Jan-08 12:39
professionalAlaric_19-Jan-08 12:39 
GeneralRe: Question about Shared modifier Pin
Guffa19-Jan-08 13:02
Guffa19-Jan-08 13:02 
GeneralRe: Question about Shared modifier Pin
pmarfleet19-Jan-08 12:00
pmarfleet19-Jan-08 12:00 
The Shared keyword in VB.NET is synonymous with the static keyword in C#. If a method is defined as Shared, it is invoked against the class itself, not against an instance of the class.

Alaric_ wrote:
Since the function is NOT static, and is in fact an instance member, does a call to a Shared method implicitly instantiate the object, call the function, return the result and then have the implicit object go out of scope for garbage collection?


If the method is defined as Shared it is a static, not an instance member of the class. The CLR will load an Type object for the class on the Managed Heap so that the method can be invoked. No instance of the class is created on the heap because an object instance is required to invoke a static method. Garbage collection does not apply since there are no object instances to be cleaned up.

Paul Marfleet

"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush


GeneralRe: Question about Shared modifier Pin
Alaric_19-Jan-08 12:29
professionalAlaric_19-Jan-08 12:29 
GeneralRe: Question about Shared modifier Pin
pmarfleet19-Jan-08 12:40
pmarfleet19-Jan-08 12:40 
GeneralRe: Question about Shared modifier Pin
Guffa19-Jan-08 13:12
Guffa19-Jan-08 13:12 
GeneralRe: Question about Shared modifier Pin
Alaric_19-Jan-08 12:34
professionalAlaric_19-Jan-08 12:34 
GeneralRe: Question about Shared modifier Pin
pmarfleet19-Jan-08 12:45
pmarfleet19-Jan-08 12:45 
GeneralRe: Question about Shared modifier Pin
Alaric_19-Jan-08 13:53
professionalAlaric_19-Jan-08 13:53 
GeneralRe: Question about Shared modifier Pin
Guffa19-Jan-08 17:56
Guffa19-Jan-08 17:56 
GeneralPuzzling MDI Behaviour Pin
George B Gilbert19-Jan-08 10:25
George B Gilbert19-Jan-08 10:25 
GeneralTwilight Zone! Pin
George B Gilbert19-Jan-08 13:33
George B Gilbert19-Jan-08 13:33 
GeneralRe: Twilight Zone! Pin
Alaric_19-Jan-08 13:55
professionalAlaric_19-Jan-08 13:55 
GeneralIP address on LAN through a wireless router. CarPC project Pin
portreathbeach19-Jan-08 8:23
portreathbeach19-Jan-08 8:23 
GeneralRe: IP address on LAN through a wireless router. CarPC project Pin
portreathbeach19-Jan-08 11:33
portreathbeach19-Jan-08 11:33 
GeneralEmail Sending in VB2005 Pin
plural19-Jan-08 3:14
plural19-Jan-08 3:14 
GeneralRe: Email Sending in VB2005 Pin
Paul Conrad19-Jan-08 7:14
professionalPaul Conrad19-Jan-08 7:14 
GeneralRe: Email Sending in VB2005 Pin
Muhammad Shahid Farooq19-Jan-08 8:16
professionalMuhammad Shahid Farooq19-Jan-08 8:16 
GeneralRe: Email Sending in VB2005 Pin
Paul Conrad19-Jan-08 12:10
professionalPaul Conrad19-Jan-08 12:10 
GeneralRe: Email Sending in VB2005 Pin
Christian Graus19-Jan-08 9:33
protectorChristian Graus19-Jan-08 9:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.