|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Name of a Callback functionHello 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 On Sun, 22 Mar 2009 19:32:15 -0400, "Syed Zeeshan Haider" <m***@me.not> No, but if you do change the name then you'd also have to change anywrote: >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, other parts of the code that's calling that name too, like the AddressOf WindowProc part. 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. -- Show quoteHide quoteSyed Zeeshan Haider "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. 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++. -- Show quoteHide quoteSyed Zeeshan Haider "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. "Syed Zeeshan Haider" <m***@me.not> wrote in message You need to compile each time you change the WindowProc. Any runtime error 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. 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 |
|||||||||||||||||||||||