Click here to Skip to main content
15,910,358 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: convert CString to SQLCHAR* Pin
CPallini22-Oct-08 23:56
mveCPallini22-Oct-08 23:56 
AnswerRe: convert CString to SQLCHAR* Pin
anna mathew23-Oct-08 0:11
anna mathew23-Oct-08 0:11 
GeneralRe: convert CString to SQLCHAR* Pin
anna mathew23-Oct-08 0:15
anna mathew23-Oct-08 0:15 
GeneralRe: convert CString to SQLCHAR* Pin
CPallini23-Oct-08 0:49
mveCPallini23-Oct-08 0:49 
GeneralRe: convert CString to SQLCHAR* Pin
anna mathew23-Oct-08 19:24
anna mathew23-Oct-08 19:24 
GeneralRe: convert CString to SQLCHAR* Pin
CPallini23-Oct-08 21:34
mveCPallini23-Oct-08 21:34 
QuestionPicture Control Pin
MsmVc22-Oct-08 18:50
MsmVc22-Oct-08 18:50 
QuestionSendMessage seemingly doing nothing at certain point in recursion Pin
kamrann22-Oct-08 15:33
kamrann22-Oct-08 15:33 
This is my first post here, or on any coding forum in fact. Before now I've always eventually been able to solve/explain/get around problems after some amount of banging my head against the wall. This though has me stumped, so if anyone can tell me what might be happening here I would be incredibly grateful since my project is stuck until I solve this, and I've pretty much given up.

I'll put the fundamental problem/question first since the rest of the information may be irrelevant. Basically, at a certain point in the execution of my code, the Win32 API call SendMessage() is returning 0, with GetLastError() also returning 0, yet the message is not being passed to the target window's WindowProc. I've tested by putting a breakpoint in the WindowProc (it't the right one, and execution is passing through there before and after this particular point, for the exact same window). I've also confirmed using Spy++, which again does not detect the sent message. I originally found the problem because WM_SIZE was not being received after calling SetWindowPos() with a new size, and through testing with Spy++ I found that WM_WINDOWPOSCHANGING(ED)/WM_NCCALCSIZE etc were being generated, but not WM_SIZE, despite the fact that the window size HAD changed. I temporarily got around it by simply doing my processing in response to WM_WINDOWPOSCHANGED instead of WM_SIZE, but then the problem appeared again when I send a user defined message to the window to ask it for it's requested size. The bottom line is that at this point in execution, SendMessage() is apparently doing nothing, even if I just try to send a WM_NULL message, it isn't delivered, Spy++ doesn't detect it even when the hook scope is all windows of the process. Does anyone know of any situation that can cause SendMessage() to silently fail to deliver its message to the destination window procedure?

A bit more info. I'm using native C++ and WTL, but the problem is related to the calls to the Win32 API, the WTL/ATL code is not relevant I'm pretty sure. I have some custom written window classes (derived from ATL::CWindowImpl) for my GUI, which act as containers and handle automatic positioning/resizing of their children when they are resized themselves, and send a message to their parent whenever they require resizing. In a certain case in my program I have a number of such windows nested within each other, and at one point when I expand a certain one, causing a series of messages to be sent up and down the parent/child chain, the above problem is occurring. Is there some kind of limit on the number of times a window procedure can be called recursively on the stack? On the number of sent messages a particular window can be processing at one time? There's definitely no logical error causing infinite recursion, the nesting is not extreme, perhaps about 15 child windows deep, if that. I'm simply starting at the base, requesting desired size information from the direct children (which they obtain recursively), then calling SetWindowPos() to resize them, and in response to the messages generated from this call, the child windows are then doing the same procedure themselves on their own child windows.

If anyone has any suggestions at all on what could be causing this, please let me know. I've run out of ideas, and patience. Thanks.
QuestionHow can I display Dlg Message Box? Pin
sabdalla8022-Oct-08 9:53
sabdalla8022-Oct-08 9:53 
AnswerRe: How can I display Dlg Message Box? Pin
David Crow22-Oct-08 9:58
David Crow22-Oct-08 9:58 
GeneralRe: How can I display Dlg Message Box? Pin
sabdalla8022-Oct-08 10:09
sabdalla8022-Oct-08 10:09 
GeneralRe: How can I display Dlg Message Box? Pin
sabdalla8022-Oct-08 10:22
sabdalla8022-Oct-08 10:22 
QuestionRe: How can I display Dlg Message Box? Pin
David Crow22-Oct-08 10:37
David Crow22-Oct-08 10:37 
AnswerRe: How can I display Dlg Message Box? Pin
sabdalla8022-Oct-08 10:43
sabdalla8022-Oct-08 10:43 
QuestionRe: How can I display Dlg Message Box? Pin
David Crow22-Oct-08 10:47
David Crow22-Oct-08 10:47 
QuestionGetting NULL value from 'Win32_LogonSession' through WMI [modified] Pin
Supriya Tonape22-Oct-08 9:40
Supriya Tonape22-Oct-08 9:40 
QuestionRe: Getting NULL value from 'Win32_LogonSession' through WMI Pin
David Crow22-Oct-08 9:57
David Crow22-Oct-08 9:57 
AnswerRe: Getting NULL value from 'Win32_LogonSession' through WMI Pin
Supriya Tonape22-Oct-08 10:24
Supriya Tonape22-Oct-08 10:24 
QuestionRe: Getting NULL value from 'Win32_LogonSession' through WMI Pin
David Crow22-Oct-08 10:35
David Crow22-Oct-08 10:35 
AnswerRe: Getting NULL value from 'Win32_LogonSession' through WMI Pin
Supriya Tonape22-Oct-08 11:23
Supriya Tonape22-Oct-08 11:23 
GeneralRe: Getting NULL value from 'Win32_LogonSession' through WMI Pin
Supriya Tonape22-Oct-08 11:30
Supriya Tonape22-Oct-08 11:30 
GeneralRe: Getting NULL value from 'Win32_LogonSession' through WMI Pin
Mark Salsbery22-Oct-08 14:11
Mark Salsbery22-Oct-08 14:11 
General[Urgent] Re: Getting NULL value from 'Win32_LogonSession' through WMI Pin
Supriya Tonape23-Oct-08 8:40
Supriya Tonape23-Oct-08 8:40 
GeneralRe: [Urgent] Re: Getting NULL value from 'Win32_LogonSession' through WMI Pin
Mark Salsbery23-Oct-08 9:33
Mark Salsbery23-Oct-08 9:33 
GeneralRe: [Urgent] Re: Getting NULL value from 'Win32_LogonSession' through WMI Pin
Supriya Tonape23-Oct-08 12:44
Supriya Tonape23-Oct-08 12:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.