Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

C++ Builder problem

2 views
Skip to first unread message

ichang Hu

unread,
Mar 18, 1997, 3:00:00 AM3/18/97
to

We just got the C++ Builder from Borland. It is like Delphi but
the codes are C++. I have a question about it. Look at the following
codes.


1 Application->Initialize(); //initial call
2 Application->CreateForm(__classid(TForm1), &Form1); //initial call
3 GetClassName(Application-Handle, szServerName,80); //get info. for
me
4 GetClassInfo(hInstance, szServerName, &wc); //get info. for
me

5
lng=SetClassLong(Application->Handle,GCL_WNDPROC,(long)((WNDPROC)WndProc));
// try to change it point to the address of the function I made
// (WNDPROC)Proc has the address I want, GCL_WNDPROC is a flag of the
stuff I
// want to change.

6 GetClassInfo(hInstance, szServerName, &wc);
//check to see if it is been changed.

7 Application->Run(); //run the program.. But my WndProc didn't
// get the messages for process.


8 GetClassInfo(hInstance, szServerName, &wc);
// Info. tell me the address still pointer to my function


Before starting my program by Application->Run() method,
I tried to change WndProc to my own by SetClassLong(), but
nothing happend. My own CALLBUCK MyWndProc() did't get
messages. My question is how can I replace address of WndProc
in WNDCLASS to my own address for proceeding messages by
MyWndProc()? If you can help me, please e-mail
to jcr...@game-club.com Thank you.

Ray Lischner

unread,
Mar 19, 1997, 3:00:00 AM3/19/97
to

On Tue, 18 Mar 1997 23:56:37 +0800, ichang Hu <ich...@digitalex.com>
wrote:

>We just got the C++ Builder from Borland. It is like Delphi but
>the codes are C++. I have a question about it. Look at the following
>codes.

...


>Before starting my program by Application->Run() method,
> I tried to change WndProc to my own by SetClassLong(), but
> nothing happend. My own CALLBUCK MyWndProc() did't get
> messages. My question is how can I replace address of WndProc
> in WNDCLASS to my own address for proceeding messages by
> MyWndProc()? If you can help me, please e-mail
> to jcr...@game-club.com Thank you.

Override the WndProc method, which the form inherits from TWinControl.
See the help files for details.
--
Ray Lischner, Tempest Software, Inc., Corvallis, Oregon, USA
Author of Secrets of Delphi 2 (http://www.tempest-sw.com/secrets/)

0 new messages