|
-
January 26th, 2008, 03:37 PM
#1
[RESOLVED] Invisible Menu?
Alright, so I was going through this tutorial, and converting the code from C to c++, not that hard, but what I came across was that once I added (HFONT) to
Code:
hfDefault = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
and (LPSTR) to
Code:
pszFileText = (LPSTR)GlobalAlloc(GPTR, dwFileSize + 1);
the menubar just dissappeared, any ideas why?
Last edited by HKothari; January 26th, 2008 at 03:56 PM.
-
January 26th, 2008, 07:44 PM
#2
Re: Invisible Menu?
Just to clarify, you are saying that if you remove (HFONT) and (LPSTR) then the menubar is displayed, but if you put them in (changing nothing else) the menubar does not display. But it compiles either way. Is that it? If so, what happens if you just put in (HFONT) and not (LPSTR)? And what exactly are you doing with hfDefault?
-
January 27th, 2008, 08:22 AM
#3
Re: Invisible Menu?
If I remove them, it doesn't compile because now the it is in C++ it needs the explicit typecasts, but after adding them, it dissappeared, and hfDefault is just the default font used in a textbox. And no, it doesn't compile without them.
-
January 27th, 2008, 02:31 PM
#4
Re: Invisible Menu?
With the information you provided it is difficult to conclude anything. I have the least doubt on either of the 2 because as such both are harmless. What I would suspect is what happens after those lines are executed, especially, the pszFileText one. It is possible you are allocating a ridiculous amount, and/or, writing excess of the bounds and such. Are you making sure you check for the values using debugger single stepping and making sure your code is executing all the right paths ?
-
January 28th, 2008, 06:24 AM
#5
Re: Invisible Menu?
Sorry, I think I found my problem, and it had nothing to do with those two, it was just coincidence, it's that my resource files aren't compiling, so I just have to figure out that.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|