Click here to Skip to main content
16,016,229 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Win APIs different in debug/release (.NET?) Pin
rberman18-Jun-06 10:30
rberman18-Jun-06 10:30 
GeneralRe: Win APIs different in debug/release (.NET?) [modified] Pin
Dave Kreskowiak19-Jun-06 1:25
mveDave Kreskowiak19-Jun-06 1:25 
GeneralRe: Win APIs different in debug/release (.NET?) Pin
rberman19-Jun-06 4:29
rberman19-Jun-06 4:29 
GeneralRe: Win APIs different in debug/release (.NET?) Pin
Dave Kreskowiak19-Jun-06 5:08
mveDave Kreskowiak19-Jun-06 5:08 
GeneralRe: Win APIs different in debug/release (.NET?) Pin
rberman19-Jun-06 5:32
rberman19-Jun-06 5:32 
GeneralRe: Win APIs different in debug/release (.NET?) Pin
Dave Kreskowiak19-Jun-06 12:44
mveDave Kreskowiak19-Jun-06 12:44 
GeneralRe: Win APIs different in debug/release (.NET?) Pin
rberman19-Jun-06 6:30
rberman19-Jun-06 6:30 
GeneralRe: Win APIs different in debug/release (.NET?) Pin
Dave Kreskowiak19-Jun-06 12:42
mveDave Kreskowiak19-Jun-06 12:42 
rberman wrote:
a handle is NOT a pointer


No. A handle is an unsigned integer the width of the address bus on the machine. So, if you run your code on a 64-bit machine, you'll get handles that are 64-bits wide. This is why it's not a good idea to specify handles as Interger or Int32. They're the same, a signed 32-bit integer, no matter what platform they're running on. So, on a 64-bit machine you'll be trying to stuff a 64-bit handle into a 32-bit space. Not going to happen...

IntPtr's are system-width, no matter what platform they're running on. You don't have to recode your app at all to switch between 32-bit and 64-bit.


rberman wrote:
Garbage collection should have no impact on handles therefore -- they are a simple identifier, not an address that might be moved in garbage collection.


Partially correct. Garbage collection will not touch unmanaged handles at all. But, there is a finite number of them that are "checked-out" from the system and are assigned an ID number. If that handle isn't specifically freed, it will never be returned to the pool, and you'll eventually run the system out of handles.


rberman wrote:
So now I'm curious why they treat it this way -- is there something else that .NET does to system-assigned handles that might make them susceptible to damage?


Nope. Nothing. The problem comes in when the handle is not marshalled to Managed code properly, like using the wrong managed type to store it.


Dave Kreskowiak
Microsoft MVP - Visual Basic

GeneralRe: Win APIs different in debug/release (.NET?) Pin
rberman19-Jun-06 7:00
rberman19-Jun-06 7:00 
GeneralRe: Win APIs different in debug/release (.NET?) Pin
Dave Kreskowiak19-Jun-06 12:47
mveDave Kreskowiak19-Jun-06 12:47 
QuestionSource code for zedgraph bar chart (for 5 Bars needed) [modified] Pin
eric123916-Jun-06 23:24
eric123916-Jun-06 23:24 
QuestionAddressOf CopyProgressRoutine Pin
maple_kisses16-Jun-06 23:13
maple_kisses16-Jun-06 23:13 
AnswerRe: AddressOf CopyProgressRoutine Pin
Dave Kreskowiak17-Jun-06 16:45
mveDave Kreskowiak17-Jun-06 16:45 
Questionplease hepl me Pin
avinashprabhu.t.p16-Jun-06 20:13
avinashprabhu.t.p16-Jun-06 20:13 
AnswerRe: please hepl me Pin
Dave Kreskowiak17-Jun-06 16:46
mveDave Kreskowiak17-Jun-06 16:46 
QuestionInternet disabling/enabling Pin
elms16-Jun-06 19:46
elms16-Jun-06 19:46 
AnswerRe: Internet disabling/enabling Pin
Dave Kreskowiak17-Jun-06 16:50
mveDave Kreskowiak17-Jun-06 16:50 
GeneralRe: Internet disabling/enabling Pin
elms28-Jun-06 9:34
elms28-Jun-06 9:34 
GeneralRe: Internet disabling/enabling Pin
Dave Kreskowiak29-Jun-06 1:23
mveDave Kreskowiak29-Jun-06 1:23 
QuestionDir() function Pin
No-e16-Jun-06 8:49
No-e16-Jun-06 8:49 
AnswerRe: Dir() function Pin
Mekong River17-Jun-06 16:04
Mekong River17-Jun-06 16:04 
GeneralRe: Dir() function Pin
No-e19-Jun-06 2:40
No-e19-Jun-06 2:40 
GeneralRe: Dir() function Pin
Mekong River19-Jun-06 3:38
Mekong River19-Jun-06 3:38 
GeneralRe: Dir() function Pin
No-e19-Jun-06 3:51
No-e19-Jun-06 3:51 
GeneralRe: Dir() function Pin
Mekong River19-Jun-06 13:33
Mekong River19-Jun-06 13: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.