473,327 Members | 1,979 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Application crashing in window procedure :(

110 100+
hi all,
I have a very general question.. My program is crashing in a window procedure...
the sample code is as follows..

Expand|Select|Wrap|Line Numbers
  1. return CallWindowProc(pccustgrid->m_wporiglistwndproc, hwnd, message, wparam, lparam);
  2.  
this is a window procedure for a listbox.. sometimes it is crashing while editing the listbox.. actually this listbox is a part of customized grid.. if a user presses tab then he can navigate thru the grid.. and edit.

my question..
wat may be the reasons an application can crash in a window procedure?

Thnx for any replies,
xoinki
Aug 10 '07 #1
5 1939
weaknessforcats
9,208 Expert Mod 8TB
The window procedure is just a switch on the message received from DispatchMessage(). Each case is handwritten application code. Just use your debugger and you should be able to see exactly where the crash is occurring.
Aug 10 '07 #2
Darryl
86
CallWindowProc expects a C function (__stdcall) and not a member function.

If pccustgrid->m_wporiglistwndproc is actually a static function (which i am guessing it's not) you need to use pccustgrid::m_wporiglistwndproc assuming pccustgrid is the name of the class and not an instance
Aug 10 '07 #3
weaknessforcats
9,208 Expert Mod 8TB
CallWindowProc expects a C function (__stdcall) and not a member function.
A member function should be OK as long as it is __stdcall (aka WINAPI). Member functions have addresses and can be used as regular functions provided a this pointer is OK for the first argument.
Aug 10 '07 #4
Darryl
86
A member function should be OK as long as it is __stdcall (aka WINAPI). Member functions have addresses and can be used as regular functions provided a this pointer is OK for the first argument.
No a member functon is Not OK to pass to CallWindowProc.

Now there are ways to craft a C function to accept and use a this pointer, but in this instance, The first parameter of CallWindowProc already has a set signature and therefore cannot take a member function.

To the OP: Here is a link that should help you understand how to accomplish what you are trying to do

http://web.archive.org/web/200511250...icles/wndproc/
Aug 10 '07 #5
weaknessforcats
9,208 Expert Mod 8TB
No a member functon is Not OK to pass to CallWindowProc.

Now there are ways to craft a C function to accept and use a this pointer, but in this instance, CallWindowProc already has a set signature and therefore cannot take a member function.
You would have thought I would have checked the docs before saying anything. But no. That's twice today. I need more coffee.
Aug 10 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: serge calderara | last post by:
Dear all, I have an application which is suppose to start another executable process. As soon as that process is running, I need to retrive its handle. The problem of the particular process I am...
2
by: Uchiha Jax | last post by:
Hi, Recently had an issue with the Audio object from Microsoft.DirectX.AudioVideoPlayback. None of the events were firing from the object during tests (NUnit or Console). Knowing I had it...
9
by: Steve Buster | last post by:
All right, I have read every forum, newsgroup etc about this issue and no one seems to know how to fix it. I am getting a "Server Application Unavailable" exception running my .NET 1.1...
5
by: Sam Loveridge | last post by:
Hi All. I'm hoping someone can point me in the direction of a solution to unhandled exceptions in MDI child forms causing the application to crash. I've found various articles describing a...
5
by: Henry Stockbridge | last post by:
Hi, I have a combo box on a form whose purpose is to add a record to the form's underlying table. There are several (16) fields that the combo box carries with it, only a few that are visible...
3
by: hbean | last post by:
I'm working on an event procedure for a form - seems relatively straightforward to me, but for some reason Access keeps crashing on me. All the procedure is doing is checking to see if a recordset...
3
by: Firecore | last post by:
Does anyone know how to use this? I was browsing a few tutorials on the net, and I saw one that shows how to display stuff on the screen. I added a few events. This is my code: #include...
16
by: Ananthu | last post by:
Hi I dont know how to connect mysql with ECLIPSE in RCP application. Please send me the sample code of connecting mysql sever with ECLIPSE in RCP application. Coding Part: RCP Application...
0
harshadd
by: harshadd | last post by:
See the below VFP 6.0 code, save this code as test.prg Ctrate a project and add this code as program into the project. Problem: why I am not able to see the form window when i run this code from...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.