473,769 Members | 2,346 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Application crashing in window procedure :(

110 New Member
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 1963
weaknessforcats
9,208 Recognized Expert Moderator Expert
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 New Member
CallWindowProc expects a C function (__stdcall) and not a member function.

If pccustgrid->m_wporiglistwn dproc is actually a static function (which i am guessing it's not) you need to use pccustgrid::m_w poriglistwndpro c assuming pccustgrid is the name of the class and not an instance
Aug 10 '07 #3
weaknessforcats
9,208 Recognized Expert Moderator Expert
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 New Member
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 Recognized Expert Moderator Expert
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
2953
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 starting is that it has a welcome window first which gets displayed and then the real windows after a while,in other words it means that the process name is the same, but the handle I need to retrive is the one from the final window and not the...
2
2732
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 working perfectly well in the application running on my tablet PC next to me, I managed to narrow down the defining factor between the two applications and found that it was a one line difference. Application.Run().
9
647
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 application. I use W2K SP4 and have applied the hot Fix KB824146 and KB824105, both IE fixes. I don't have VS installed because this is a Quality Environment. I do have .NET SDK and .NET 1.1 Runtime installed. I can't change my APSNET user to run as...
5
4542
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 method using Application.Run(new MyMainParentForm) to place in the application's Sub Main to allow catching of unhandled exceptions in the application. The problem I'm facing is that I want to be able to trap unhandled exceptions at the MDI child...
5
1888
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 to the User. When the User selects a value from the combo box, the application shuts down. Here is the code for the combo box that may lead to the problem. ============================================== Private Sub cboAddPhysician_AfterUpdate()...
3
3968
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 is blank, and if not, opening up a form. Any ideas why this might be happening? Here's the code I'm using: Dim db As Database Dim Active As Recordset
3
12685
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 <windows.h> // FOR ANY DIFFICULTIES, REFER TO THE MSDN. IT IS VERY USEFUL. HWND hwndMain; LRESULT CALLBACK MainWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam);//CALLBACK function prototype
16
10766
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 Codes: Class ApplicationActionBarAdvisor:
0
1138
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 VFP or after building an EXE out of that.? Form is set as modless (WindowsType=0) Formset is set as Modal (WindowsType=1) Showindow = 2 for form Application.visible=.f. is in forms init. If application.visible = .t. then I see foxprow window....
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10045
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9993
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8870
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7406
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3958
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.