Home All Groups Group Topic Archive Search About

Name of a Callback function

Author
22 Mar 2009 11:32 PM
Syed Zeeshan Haider
Hello Everybody,
I am working on WinXP SP2 with VB6 EE.

Is it imperative to name a callback function as "WindowProc"? I was using an
example from http://www.thevbzone.com/secrets.htm to learn callback
functions and API. It worked perfectly until I changed the name of the
WindowProc to "aaaddd" to check if it worked this way. VB6 shut down
automatically.

Thank you,
--
Syed Zeeshan Haider

Author
23 Mar 2009 12:47 AM
Ed
On Sun, 22 Mar 2009 19:32:15 -0400, "Syed Zeeshan Haider" <m***@me.not>
wrote:

>Hello Everybody,
>I am working on WinXP SP2 with VB6 EE.
>
>Is it imperative to name a callback function as "WindowProc"? I was using an
>example from http://www.thevbzone.com/secrets.htm to learn callback
>functions and API. It worked perfectly until I changed the name of the
>WindowProc to "aaaddd" to check if it worked this way. VB6 shut down
>automatically.
>
>Thank you,

No, but if you do change the name then you'd also have to change any
other parts of the code that's calling that name too, like the AddressOf
WindowProc part.
Author
23 Mar 2009 1:37 AM
Syed Zeeshan Haider
I thought, I had changed all instance of the word "WindowProc". From your
answer it seems I might have missed some. I will give it another try. Thanks
for answering.
--
Syed Zeeshan Haider

Show quoteHide quote
"Ed" <nospam@hotmail.com> wrote in message
news:qtmds41bet51e49qam50q0462tfhnv3dm7@4ax.com...
> On Sun, 22 Mar 2009 19:32:15 -0400, "Syed Zeeshan Haider" <m***@me.not>
> wrote:
>
>>Hello Everybody,
>>I am working on WinXP SP2 with VB6 EE.
>>
>>Is it imperative to name a callback function as "WindowProc"? I was using
>>an
>>example from http://www.thevbzone.com/secrets.htm to learn callback
>>functions and API. It worked perfectly until I changed the name of the
>>WindowProc to "aaaddd" to check if it worked this way. VB6 shut down
>>automatically.
>>
>>Thank you,
>
> No, but if you do change the name then you'd also have to change any
> other parts of the code that's calling that name too, like the AddressOf
> WindowProc part.
Author
23 Mar 2009 1:42 AM
Syed Zeeshan Haider
Yes, you were right. This time my test passed. Thank you for confirming my
initial assumption. API seems to have a steep learning curve for someone who
doesn't know C/C++.
--
Syed Zeeshan Haider

Show quoteHide quote
"Ed" <nospam@hotmail.com> wrote in message
news:qtmds41bet51e49qam50q0462tfhnv3dm7@4ax.com...
> On Sun, 22 Mar 2009 19:32:15 -0400, "Syed Zeeshan Haider" <m***@me.not>
> wrote:
>
>>Hello Everybody,
>>I am working on WinXP SP2 with VB6 EE.
>>
>>Is it imperative to name a callback function as "WindowProc"? I was using
>>an
>>example from http://www.thevbzone.com/secrets.htm to learn callback
>>functions and API. It worked perfectly until I changed the name of the
>>WindowProc to "aaaddd" to check if it worked this way. VB6 shut down
>>automatically.
>>
>>Thank you,
>
> No, but if you do change the name then you'd also have to change any
> other parts of the code that's calling that name too, like the AddressOf
> WindowProc part.
Author
23 Mar 2009 2:31 AM
Nobody
"Syed Zeeshan Haider" <m***@me.not> wrote in message
news:eveiwZ0qJHA.3444@TK2MSFTNGP04.phx.gbl...
> Hello Everybody,
> I am working on WinXP SP2 with VB6 EE.
>
> Is it imperative to name a callback function as "WindowProc"? I was using
> an example from http://www.thevbzone.com/secrets.htm to learn callback
> functions and API. It worked perfectly until I changed the name of the
> WindowProc to "aaaddd" to check if it worked this way. VB6 shut down
> automatically.

You need to compile each time you change the WindowProc. Any runtime error
or perhaps breaking into the IDE will cause the VB IDE to crash. If you want
to disable the subclassing in the IDE only(not the EXE), use IsInIDE()
function, and based on that, skip the subclassing code.

http://vbnet.mvps.org/index.html?code/core/isinide.htm