Forum: C++ Sep 19th, 2009 |
| Replies: 6 Views: 229 Ok I am building a GUI Framework, where there is a Widget class,
which can both have mother widgets and be a mother widget.
When some event happens, the widget receives a message, in the form of... |
Forum: C++ Sep 19th, 2009 |
| Replies: 6 Views: 229 Too time consuming. I would rather not do it at all then
And about the code snippet, if I create an instance of Mother,
and call HandleMessage<10> it would print "It works!\n".
But if I call... |
Forum: C++ Sep 19th, 2009 |
| Replies: 2 Views: 353 I would recommend a disassembler, but requires you to know assembly. |
Forum: C++ Sep 19th, 2009 |
| Replies: 6 Views: 229 Well it is an integer, compared to a list of integers. |
Forum: C++ Sep 19th, 2009 |
| Replies: 6 Views: 229 Hi I have a problem, I hope you can help me with.
I have a number, which I need to compare to some values.
I do not wish to go through all the values, and compare them individually, as I there... |
Forum: C++ May 29th, 2009 |
| Replies: 19 Views: 485 OK last try
class TestA;
#ifndef __TESTA_H
#define __TESTA_H
#include <stdio.h>
#include "testB.h"
class TestA { |
Forum: C++ May 29th, 2009 |
| Replies: 19 Views: 485 Are you sure you want to have a pointer of the other class in them both? |
Forum: C++ May 29th, 2009 |
| Replies: 19 Views: 485 You should always include the header when you want to use it's class to avoid multiple inclusion add the following code.
#ifdef TESTB_H
#define TESTB_H
//class declaration
#endif |
Forum: C++ May 29th, 2009 |
| Replies: 19 Views: 485 Include testA.h in testB.h if you want it to have a pointer to a testA object |
Forum: C++ May 29th, 2009 |
| Replies: 19 Views: 485 put the declaration in the header file and the definition in the other
//declaration
class foo
{
void bar();
};
//definition |
Forum: C++ May 28th, 2009 |
| Replies: 8 Views: 310 Possibly the fact that struct keyword mostly is used for containers? |
Forum: C++ May 27th, 2009 |
| Replies: 9 Views: 258 Well come to think about it I don't know why I wanted to do it.
Maybe I am just tired. |
Forum: C++ May 27th, 2009 |
| Replies: 9 Views: 258 Thank you for answering the questions I will just assume it is ok to make a main class.
I didn't think non heap variables could be said to be allocated because they are allocated by the OS at... |
Forum: C++ May 27th, 2009 |
| Replies: 9 Views: 258 Yes I was assuming a destructor was implemented but my question still applies should I allocate all my resources in classes?
As for question number two here is an example of what I mean
int... |
Forum: C++ May 27th, 2009 |
| Replies: 9 Views: 258 I have been testing a C++ based SDK and now i have a few questions for you that i hope you will answer
.
1. When passing objects between each other is it preffered to use references if not what... |
Forum: C++ May 9th, 2009 |
| Replies: 6 Views: 288 Thank You!
this is what I've got.
There are some problems and you can't replace a function but I can handle that myself
class msghandler
{
public:
void HandleMessage(WNDPROC func,... |
Forum: C++ May 9th, 2009 |
| Replies: 6 Views: 288 The problem is that it is the windows API we are talking about and I can't have a predefined function for every windows message.
I was thinking something like obtaining a function pointer and the... |
Forum: C++ May 9th, 2009 |
| Replies: 6 Views: 288 Yes but in an automated way so I can add functions at runtime and make it have a value.
I know I could do this with a loop and an if statement but it would be optimal if could check if the message... |
Forum: C++ May 9th, 2009 |
| Replies: 6 Views: 288 Hi and sorry for the inconvenience
I am trying to make an interface where a function is run given a number(windows API).
I want a default function to be run if it hasn't been overwritten by the... |
Forum: C++ Mar 29th, 2009 |
| Replies: 8 Views: 707 I don't think you can't assign values to functions/methods.
I don't know what you want to do but as I see it you use the assignment as a way to make the method do nothing until you find out how to... |
Forum: C++ Mar 16th, 2009 |
| Replies: 2 Views: 235 Just use <iostream> there is nearly no syntax difference and your program might not compile on all compilers |
Forum: C++ Jan 29th, 2009 |
| Replies: 6 Views: 308 Use this
ofstream out;
out.open("\\reg.txt"); |
Forum: C++ Jan 25th, 2009 |
| Replies: 1 Views: 397 Ok i have been thinking.
Would it be possible to intercept the messages sent to the desktop window?
Like after we are done painting the screen go to this program. |
Forum: Posting Games Jan 22nd, 2009 |
| Replies: 164 Views: 15,961 Why would I care?
If you lie are you telling the truth? |
Forum: C++ Jan 22nd, 2009 |
| Replies: 4 Views: 333 The one and only "Charles Petzold Programming Windows" |
Forum: C++ Jan 22nd, 2009 |
| Replies: 10 Views: 59,334 Try this.
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), BACKGROUND_RED BACKGROUND_INTENSITY);
You can change RED to GREEN or BLUE and BACKGROUND to FOREGROUND.
If you want to... |
Forum: C++ Jan 22nd, 2009 |
| Replies: 5 Views: 555 What he meant(i think) is that you could do this.
ShellExecute(0, 0, "<program to open program with>", "<file to open>", 0, SW_MAXIMIZE);
This is ofcourse not optimal but it can be used... |
Forum: C++ Jan 20th, 2009 |
| Replies: 1 Views: 397 Hi.
I am making an application that will use the screen and do something with it(live).
My problem is that when i do that i get the previous screen made by my program last time i updated the... |
Forum: C++ Jan 20th, 2009 |
| Replies: 5 Views: 555 When you double click the *.pps file does it then open?
If it does try checking what app is used to open *.pps files. |
Forum: C++ Dec 27th, 2008 |
| Replies: 4 Views: 1,404 Thank you everyone.
It worked when i used.
SetWindowText(GetDlgItem(hWnd, 112), buffer);
It ignores newlines but i think i can handle that. |
Forum: C++ Dec 26th, 2008 |
| Replies: 4 Views: 1,404 Hi i am trying to make a notepad like program.
The problem is that when i try to display some text nothing happens.
If someone could help me i would really appreciate it.
The function call:
... |
Forum: C++ Sep 10th, 2008 |
| Replies: 9 Views: 960 |
Forum: C++ Sep 10th, 2008 |
| Replies: 9 Views: 960 for misunderstanding the concepts of classes i thought that it was the core of an optimal program (like code at bottom of post) is it really only to reuse code?
class someClass
{
public:
... |
Forum: C++ Sep 9th, 2008 |
| Replies: 9 Views: 960 |
Forum: C++ Sep 9th, 2008 |
| Replies: 9 Views: 960 |
Forum: C++ Sep 8th, 2008 |
| Replies: 9 Views: 960 hi i was wondering how much i should use classes in C++.
Should i use it as much as possible? |