Article View: borland.public.cppbuilder.nativeapi
Article #12428Re: why HWND type in win32 prototypes is void *
From: Remy Lebeau (TeamB)
Date: Wed, 03 Dec 2003 22:19
Date: Wed, 03 Dec 2003 22:19
20 lines
1916 bytes
1916 bytes
"dESFasado" <nospame@anymore> wrote in message news:oprzmkrdfi3sxi43@localhost... > why HWND handle in win32 API function prototypes are void *??? That is the most common way for a library to provide instances of its own custom data types without making the calling applications actually know anything about the internals of the data types. Many of the Win32 API handles are void*, but actually point to structures inside their respective libraries. In fact, a lot of third-party APIs work that way as well. It allows the libraries to define internally what they should do with their own allocated memory. All languages that can access DLLs have some way of receiving/specifying memory addresses. The library returns a memory address (that is all a void* is), and the application then passes that memory address back to the library when it needs to do something. The library does all the work of allocating, accessing, and releasing the actual memory being pointed to. Gambit
Technical Details
Message-ID:
<3fce6080$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<oprzmkrdfi3sxi43@localhost>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,feb93522dc1d50c X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-12-03 14:40:14 PST From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <oprzmkrdfi3sxi43@localhost> Subject: Re: why HWND type in win32 prototypes is void * Date: Wed, 3 Dec 2003 14:19:51 -0800 Lines: 22 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 67.23.78.224 Message-ID: <3fce6080$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1070489728 67.23.78.224 (3 Dec 2003 14:15:28 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail