Search Results

Showing results 1 to 35 of 35
Search took 0.01 seconds.
Search: Posts Made By: mostermand ; Forum: C++ and child forums
Forum: C++ Sep 19th, 2009
Replies: 6
Views: 233
Posted By mostermand
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: 233
Posted By mostermand
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: 387
Posted By mostermand
I would recommend a disassembler, but requires you to know assembly.
Forum: C++ Sep 19th, 2009
Replies: 6
Views: 233
Posted By mostermand
Well it is an integer, compared to a list of integers.
Forum: C++ Sep 19th, 2009
Replies: 6
Views: 233
Posted By mostermand
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: 498
Posted By mostermand
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: 498
Posted By mostermand
Are you sure you want to have a pointer of the other class in them both?
Forum: C++ May 29th, 2009
Replies: 19
Views: 498
Posted By mostermand
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: 498
Posted By mostermand
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: 498
Posted By mostermand
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: 315
Posted By mostermand
Possibly the fact that struct keyword mostly is used for containers?
Forum: C++ May 27th, 2009
Replies: 9
Views: 271
Posted By mostermand
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: 271
Posted By mostermand
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: 271
Posted By mostermand
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: 271
Posted By mostermand
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: 295
Posted By mostermand
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: 295
Posted By mostermand
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: 295
Posted By mostermand
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: 295
Posted By mostermand
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: 739
Posted By mostermand
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: 239
Posted By mostermand
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: 313
Posted By mostermand
Use this

ofstream out;
out.open("\\reg.txt");
Forum: C++ Jan 25th, 2009
Replies: 1
Views: 406
Posted By mostermand
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: C++ Jan 22nd, 2009
Replies: 4
Views: 337
Posted By mostermand
The one and only "Charles Petzold Programming Windows"
Forum: C++ Jan 22nd, 2009
Replies: 10
Views: 60,799
Posted By mostermand
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: 568
Posted By mostermand
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: 406
Posted By mostermand
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: 568
Posted By mostermand
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,452
Posted By mostermand
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,452
Posted By mostermand
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: 984
Posted By mostermand
thank you everyone
Forum: C++ Sep 10th, 2008
Replies: 9
Views: 984
Posted By mostermand
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: 984
Posted By mostermand
Forum: C++ Sep 9th, 2008
Replies: 9
Views: 984
Posted By mostermand
Forum: C++ Sep 8th, 2008
Replies: 9
Views: 984
Posted By mostermand
hi i was wondering how much i should use classes in C++.
Should i use it as much as possible?
Showing results 1 to 35 of 35

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC