🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #8120

Re: Help needed in Type Casting

#8120
From: Ed Mulroy [TeamB]
Date: Tue, 23 Nov 2004 15:14
40 lines
2292 bytes
I wrote:

>> You specified a member function of a structure to 
>> Windows as a callback function.  Windows is not 
>> party to the internal configuration of your program
>> and has no facilities to call a non static member 
>> function in the context of whatever instance of that 
>> structure you intended to be used.

You replied:

>If you have got Borland C++ 4.02 or greater and Look 
>for windows examples; it exactly contradicts you 
>statement.

That is not true.  

You described a problem and asked what is wrong.  I told 
you what was wrong. 

Go to your books on C++.  Investigate what they say about
function pointers to non-static member functions and how
they are different from function pointers to normal, 
non-member functions. 

You are trying to specify a non-static member function 
as the window procedure address in the lpfnWndProc 
element of a WNDPROC structure.  The line generates an 
error because what is assigned to the element is not of 
the same type.  The address of a non-static member 
function involves not only the address of the function 
code but also that of the instance of the structure or
class of which it is a member.  The lpfnWndProc variable
is not a compatible type to the address of a non-static
member functon of a class or structure.

.  Ed 

>FireHead <satishA82@linuxmail.org> wrote:
Technical Details
Message-ID: <41a361d0$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!in.100proofnews.com!in.100proofnews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <41a13964@newsgroups.borland.com> <41a17387$1@newsgroups.borland.com> <41a26c56@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,874f410c864356cd
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Ed Mulroy [TeamB]" <dont_email_me@bitbuc.ket>
Sender: "Ed Mulroy [TeamB]" <dont_email_me@bitbuc.ket>
Reply-To: "Ed Mulroy [TeamB]" <dont_email_me@bitbuc.ket>
Subject: Re: Help needed in Type  Casting
Newsgroups: borland.public.cppbuilder.nativeapi
X-User-Info: 24.74.175.102     
References: <41a13964@newsgroups.borland.com> <41a17387$1@newsgroups.borland.com> <41a26c56@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.66
Message-ID: <41a361d0$1@newsgroups.borland.com>
Date: 23 Nov 2004 08:14:08 -0700
X-Trace: newsgroups.borland.com 1101226448 207.105.83.66 (23 Nov 2004 08:14:08 -0700)
Lines: 41
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!in.100proofnews.com!in.100proofnews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail