>>Could you estimate what percentage of time this is a concern in higher-level language like VB or VFP? Or, rather - could you give an example where it's pertenant to be aware of an ID/handle and their respective distictions and estimate how often that example is of concern?
>>
>
>InVB, lots - dealing with printers, the VB developer references the device via an hDC - a handle to a device context. Want to get a control to do something? Send it a message using SendMessage() or PostMessage(); you just need the hWnd of the control. Want to check the completion status of a program you fired up to run in the background? If you have an hProcess (process handle) you can call GetExitCodeProcess(), or given the ProcessID, you can get a handle granting you all sorts of capabilities using OpenProcess().
>
>I'd guess that my code contains lots of calls to the API layer that many others don't use. I can certainly write an app without resorting to talking to the API, but I can write a better one if I just ask Windows to do the tough stuff for me.
Interesting. Although I've not made use of this it sounds kinda simple. Thanks.
>You don't have to buy a lawnmower to keep your grass clipped; a herd of cattle will handle the task quite well.
Me? I've often wondered... And I've 'herd' some people recommend sheep, too -you know, just thinkin' outside the box... then again a mower *does* provide a handle. But it just seems kinda primal. I mean, I have to push that handle around all day when I could just leave the tasks to a higher-level tool - perhaps goats! They are smarter than cattle and sheep put together. Either way, I guess its really a Very Baa-baa-Basic operatation to deal with handles.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement