.NET Framework - Zero length literal string is not zero length

Asked By David Liebtag
19-Nov-09 11:25 PM
I have a program that does this:

HWND Edit =
CreateWindow("Edit","",WS_VISIBLE,0,0,100,100,Parent,0,Instance,0) ;

When the window appears, it is not empty.  Instead, it contains the numeric
digit 0.

The problem only happens when I compile with debug.

I have had this kind of thing happen before where empty literal strings are
not empty.  It seems to be related to the stack.  Sometimes when I have the
problem, I can work around it by moving local variables.

Does anyone know exactly what causes this and/or what I can do about it?

Thanks in advance.

David Liebtag

PS I am using Visual Studio .Net 2003 C++.  I know, I know.  VS .Net 2003 is
old, but it is what I am using.  After all, Microsoft still offers extended
support for it,,,
Visual Studio
(1)
CreateWindow
(1)
Window
(1)
HWND
(1)
  David Lowndes replied to David Liebtag
20-Nov-09 04:37 AM
David,

This is not the best group for this question, however...


What else do you do with the Edit window handle? Nothing in creating
the window would result in it displaying a '0'.


You've probably got a bug somewhere - not where you think it is.
Enable the compiler run-time checking settings and see if they show
anything.

Dave
  David Liebtag replied to David Lowndes
20-Nov-09 10:08 AM
Can you suggest a better group?

I have already enabled all the run-time checking and no errors are reported.

David Liebtag
  David Liebtag replied to David Lowndes
20-Nov-09 11:00 AM
You were correct.  I found that the code to initialize a global array was
running off the end and corrupting the storage for literal strings.

Thanks.

David Liebtag
  David Lowndes replied to David Liebtag
20-Nov-09 01:30 PM
The vc.language group may have been better - given the outcome.

Dave
help
Create Button & WindowProcedure .NET Framework Hi, I have created a button with CreateWindow. How I can hook a window procedure to the created button ?? This is the code that I have tried but without success HWND hButton = CreateWindow( _T("BUTTON"), _T("Encoder"), WS_CHILD | WS_VISIBLE | ES_LEFT | WS_BORDER, 0, 100, 100, 20, (HWND)0x3F7240, NULL WIN_PROC"), MB_OK ); return FALSE; } Thanks WindowsCE Embedded VC Discussions DlgMenu_WinProc (1) WM_LBUTTONDOWN (1) WIN_PROC (1) CreateWindow (1) MB_OK (1) WM_COMMAND (1) WindowProcedure (1) HWND (1) Didn't I answer this question dialog procedure of the dialog! In fact, using the New Project wizard in eVC or Visual Studio, a standard About dialog will be generated. That dialog handles a button, so maybe you button. Paul T. keywords: Create, Button, &, WindowProcedure description: Hi, I have created a button with CreateWindow. How I can hook a window procedure to the created button This is the code
into some unexpected problems. This is my first native C++ PocketPC Project. I am using Visual Studio 2008. One problem is that I can not find how to use gmtime / localtime functions Any help? Norbert WindowsCE Embedded VC Discussions Windows Mobile 5.0 (1) Windows XP (1) Visual Studio 2008 (1) OpenNETCF (1) PocketPC (1) EMVP (1) RTLs (1) CreateWindow (1) Those functions aren't supported in Pocket PC (or the underlying operating system, Windows job. . . Since Microsoft makes such a fuzz about PocketPC being compatible to Windows ("we have Visual Studio, C#, .Net, C++, MFC and Win32) I had the impression that a PocketPC PDA is Yes, it's both good and bad to be Win32-based. On the good side, CreateWindow() is still CreateWindow(), and WinSock is still mostly WinSock, and the Visual Studio tools can
would the experts recommend I become well acquainted with? Daniel C# Discussions Windows Installer (1) Visual Studio (1) ObjectDisposedException (1) DbProviderFactory (1) FtpWebRequest (1) GZipStream (1) Python (1) Linux (1) Java, Ruby you should be sure you make the one that is correct for you. - - David Wilkinson Visual C++ MVP From a language perspective yes. There's really not much you can do learn something new, I think it's going to be C# and .NET. - - David Wilkinson Visual C++ MVP I had forgotten the proper terminology. I meant to ask whether C# was on the screen. What would I look at? I know I can use C++ to createwindow or something like it, but how is it doing it? Is that part in C s the only thing that really knows "how graphics are really drawn on the screen". CreateWindow() doesn't draw graphics. It just sets up an OS object that provides for a C++, si I do not need to worry about this. The code is developed in Visual Studio, but runs as a console application in various linux / Unix systems, as well as Windows
immediate numerical values in methods or Win32 API calls). how to enable this feature ? Sylvain. Visual Studio General Discussions OffsetRect (1) AppName (1) POINT (1) RECT (1) ZI (1) MS (1) DaveRe show definition', the string.h file is opened, the same right-click on OffsetRect or CreateWindow, or also types like RECT or POINT provides an alert "The Symbol 'OffsetRect' is not