I was working with floating point numbers and integers, and I came across a case where I needed just the part of the floating point number that comes after the decimal. So for example, if I had
...
Type: Posts; User: Malek
I was working with floating point numbers and integers, and I came across a case where I needed just the part of the floating point number that comes after the decimal. So for example, if I had
...
You may need to #include your resource file before you #include your mydialog.h file, because thats probably where IDD_CLOUDS_DIALOG is defined.
Alright, thanks everyone, that clears things up. I'll just use one of the workarounds to make it work that way I want it to. Thanks for the help.
I was type casting the 80 as a char since 80 is an integer, although I don't recall if the compiler complained about it or not, so it may not have been necessary.
As for R.Stiltskin (and possibly...
The (char)200 works fine. If I do (char)86, it displays the correct letter for that ascii character. The number 200 was just an example, if I printed that out it might be a junk character, or a beep,...
I was messing around with casting a single character as an integer, and I've been getting bizzare results. If I do this:
char myChar = (char)200;
unsigned int result;
result = (unsigned...
I can't seem get get a hold of a CListCtrl, the help files say that belongs to a CListView, and I'm using a CListBox, so I dont think I can use that. When searching the web more trying to find some...
SetExtendedStyle does not appear to be a function for CListBox. I tried using ModifyStyleEx, which supposedly lets me modify extended styles, but that doesn't appear to work either.
I've tried...
Is there a way to modify a window's style (CWnd base type) after it has been created? Here's what I've been doing, and it doesn't seem to do anything. I'm using MFC to create my windows.
//...
Alright, got it working. Thanks for the help. :)
I'm having trouble figuring out how to do your second suggestion. I'm trying to create my own custom class on the dialog, but the program keeps giving me the error "Failed to create empty document"....
Hmm, I did what you suggested and it creates the white box just like I want. Then I do something like this:
CDC *myDC = GetDlgItem(IDC_DRAWBOX)->GetDC();
myDC->Rectangle(10, 10, 20, 20);
...
Hello, I had a question as to how to have a drawing window and the other text windows and stuff in MFC. Basically I want to use the Resource editor to create my display. I want to have lists, text...
Hello, I'm using Microsoft Visual C++ 5.0, and am trying to make the horizontal scroll bars work the want I want them to for a CListBox. Here's a sample of what my code currently does:
...
Anyone know if there is a way to include only part of a header file, and part of the c++ file? Say for example I want 1 class structure and definitions from a header file/c++ file, but I don't want...
Alright, thanks. Making the destructor virtual seems to work. <whew> Don't have to try and change all those delete statements.
Anyone know how to call the appropriate deconstructor in this example? Assume Weapon inherits some stuff from Item, but weapon has a few variables of its own as well.
int main(void)
{
...
Are there any programs I can use when I run my code to see if I have any memory leaks in it? Like if I forgot to delete a dynamically created variable in a function that gets called 15 times. Any...
Alright, thanks. The
class Things;
class Stuff;
in the files worked. Thanks for the help.
Here's some sample code I just made up, I think it points out my problem. Any way to make this compile? Thanks.
Header: stuff.h
#ifndef HEADER_STUFF
#define HEADER_STUFF
#include...
I have a header problem, when trying to #include 2 different files. Here's my problem:
Header A:
#ifndef HEADER_A
#define HEADER_A
#include "headerB.h"
Hello, I had a question about what the difference is between delete and delete[]. Lets say for example I have this code:
char *tmp;
tmp = new char[100];
// ....
delete char;
I stumbled across a solution when I was trying to find a way to translate WM_CHAR messages. When I was translating messages in my main function, I used to be doing:
while (GetMessage(&msg, NULL,...
Is there a way to make an edit box accept tab characters? When I hit tab in an edit box it jumps to the next button, but I want it to treat that as a tab character (or turn it into a few 'space'...
Alright, thanks. EnableWindow works perfectly.