473,897 Members | 2,796 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 1969
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
2966
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
2740
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
4549
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
1894
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
3975
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
12710
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
10783
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
1144
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
9990
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9837
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
10849
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...
0
10476
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9655
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
8031
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
7183
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
5872
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4697
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

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.