Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / March 2004

Tip: Looking for answers? Try searching our database.

Question about event handling in a win32 c++ application

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
GAEL - 14 Mar 2004 20:06 GMT
Is it possible to create a window and associate 2 windows procedures to it for event handling
I mean

LRESULT CALLBACK WndProc1(......
LRESULT CALLBACK WndProc2(......

and then

WNDCLASS wc
..
wc.lpfnWndProc = WndProc1

How to bind the second window procedure to the WNDCLASS?

Thanks in advance
Jochen Kalmbach - 14 Mar 2004 20:12 GMT
=?Utf-8?B?R0FFTA==?= wrote:

> Is it possible to create a window and associate 2 windows procedures
> to it for event handling? I mean:

No.

> wc.lpfnWndProc = WndProc1;
>
> How to bind the second window procedure to the WNDCLASS?.

Call the second WndProc2 from the first one if the message was not handled.

Signature

Greetings
 Jochen

  Do you need a memory-leak finder ?
  http://www.codeproject.com/tools/leakfinder.asp

Jeff Partch [MVP] - 14 Mar 2004 20:19 GMT
> Is it possible to create a window and associate 2 windows procedures to it for event handling?
> I mean:
[quoted text clipped - 9 lines]
>
> How to bind the second window procedure to the WNDCLASS?.

I'm still not quite sure what you mean, but you could have the 2nd procedure
address in the instance data and the first call/defer to it something like
WC_DIALOG does.
Signature

Jeff Partch [VC++ MVP]

GAEL - 15 Mar 2004 00:06 GMT
a part of what i want to do is : i want to create a win32 dll. That dll creates a window with some event handling. And I want any client application to be able to Interact with that window, by adding some additional event handling. How can I write event handling code within the client application?
Jeff Partch [MVP] - 15 Mar 2004 00:40 GMT
> a part of what i want to do is : i want to create a win32 dll. That dll creates a window with some event handling. And I want any client application
to be able to Interact with that window, by adding some additional event
handling. How can I write event handling code within the client application?

Export a function via which the client can pass the address of its handler
function to the dll (if you already have an exported Create the window
function, this can just be an optional parameter), store it in the window's
instance data and have the window's WindowProc check for it and call it when
appropriate. Of course, there's always subclassing too.
Signature

Jeff Partch [VC++ MVP]


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.