Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > Visual C++
|
Visual C++ Questions specific to Microsoft's Visual C++. For questions not specific to this Microsoft version, use the C++ Programming forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual C++ section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 15th, 2012, 05:54 PM
Registered User
 
Join Date: Feb 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Corrupted Status Window Message

When I repeatedly run the following code in VS10 debug mode, it behaves as I would expect. Right-clicking executes the expected code and the message in the status bar cycles correctly through the 2 cases. But when I run it as a release, the message is corrupted (I get a load of oriental characters). Making char* rcMess global doesn't help.

The following is the extraxt from WinProc:

switch (message)
{
case WM_RBUTTONDOWN:
if (++parallel==3)
parallel=0;
//update status bar message
char* rcMess;
switch (parallel)
{
case 0:
rcMess="Right-click for parallel 1 execution";
break;
case 1:
rcMess="Right-click for parallel 2 execution";
break;
case 2:
rcMess="Right-click for serial execution";
break;
}
SendMessage(GetDlgItem(hWnd,IDC_STATUS),SB_SETTEXT ,2,(LPARAM) (rcMess));
InvalidateRect (hWnd,NULL,TRUE);
UpdateWindow (hWnd);
break;


Any suggestions?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Window.status Bar [email protected] C# 2005 6 January 9th, 2008 05:18 AM
Help me I want static message on status bar veena_burse ASP.NET 2.0 Professional 1 July 5th, 2007 03:43 AM
how to display message to window.status bar tllcll BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 0 November 22nd, 2005 02:04 AM
Window status works in FF, but not IE...why? msprothero Javascript 2 March 22nd, 2005 10:10 AM
changing the status of the message (read / unread) neomohlala SQL Server 2000 0 August 13th, 2003 04:34 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.