|
Get a job that matches your skills. Or learn new skills.
By the way, GOOD MORNING!!! That is what I am trying to...
|
|
|
|
|
Erudite__Eric wrote: ...what a dishonest liar you are...
How do you know he lied? My very first job out of college I got because I had experience with Pascal on a Unix platform. Shortly after I was hired, my first assignment was a C program on a DOS platform.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Thank you very much David...
|
|
|
|
|
Hi,
I'm assuming you are going to use ADO (not ADO.NET).
I have some experience in developing apps that use MS SQL DB, ADO and MFC in C++ (since 2002).
Sorry to say I don't have a code sample I can give you but you might take a look at this: A set of ADO classes - version 2.20[^]. I have not used that code myself but it looks like it will take care of connecting to the SQL DB and getting data from it.
|
|
|
|
|
You are just great... Thanks!
|
|
|
|
|
Hi
How to color the CListBox controls entire client area ? I mean entire client rect.
Thanks
|
|
|
|
|
|
Good resources...
|
|
|
|
|
I can't compile the program successfully.
This is the error message:error C2059: syntax error : '*'.(I just show the first error message.)
And here is the code:
This is the first time I post my problem to CodeProject.
Please help me! Thank you in advance!
#include <iostream>
#include <vector>
using namespace std;
class Number
{
public:
void dubble(int &value)
{
value *= 2;
}
};
class Command
{
public:
virtual void execute(int &) = 0;
};
class SimpleCommand: public Command
{
typedef void(Number:: *Action)(int &);
Number *receiver;
Action action;
public:
SimpleCommand(Number *rec, Action act)
{
receiver = rec;
action = act;
}
/*virtual*/void execute(int &num)
{
(receiver-> *action)(num);
}
};
class MacroCommand: public Command
{
vector < Command * > list;
public:
void add(Command *cmd)
{
list.push_back(cmd);
}
/*virtual*/void execute(int &num)
{
for (int i = 0; i < list.size(); i++)
list[i]->execute(num);
}
};
int main()
{
Number object;
Command *commands[3];
commands[0] = &SimpleCommand(&object, &Number::dubble);
MacroCommand two;
two.add(commands[0]);
two.add(commands[0]);
commands[1] = &two;
MacroCommand four;
four.add(&two);
four.add(&two);
commands[2] = &four;
int num, index;
while (true)
{
cout << "Enter number selection (0=2x 1=4x 2=16x): ";
cin >> num >> index;
commands[index]->execute(num);
cout << " " << num << '\n';
}
}
|
|
|
|
|
Which statement is in error?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
1. Please edit your message and put <pre> tags around your code.
2. Tell us which line is getting the error.
|
|
|
|
|
It compiled fine after i commented this line out:
void execute(int &num)
{
}
#include < iostream.h >
#include < vector >
using namespace std;
class Number
{
public:
void dubble(int &value)
{
value *= 2;
}
};
class Command
{
public:
virtual void execute(int &) = 0;
};
class SimpleCommand: public Command
{
typedef void(Number:: *Action)(int &);
Number *receiver;
Action action;
public:
SimpleCommand(Number *rec, Action act)
{
receiver = rec;
action = act;
}
void execute(int &num)
{
}
};
class MacroCommand: public Command
{
vector < Command * > list;
public:
void add(Command *cmd)
{
list.push_back(cmd);
}
void execute(int &num)
{
for (int i = 0; i < list.size(); i++)
list[i]->execute(num);
}
};
int main()
{
Number object;
Command *commands[3];
commands[0] = &SimpleCommand(&object, &Number::dubble);
MacroCommand two;
two.add(commands[0]);
two.add(commands[0]);
commands[1] = &two;
MacroCommand four;
four.add(&two);
four.add(&two);
commands[2] = &four;
int num, index;
while (true)
{
cout << "Enter number selection (0=2x 1=4x 2=16x): ";
cin >> num >> index;
commands[index]->execute(num);
cout << " " << num << '\n';
}
return 0;
}
|
|
|
|
|
Falconapollo wrote:
void execute(int &num)
{
(receiver-> *action)(num);
} There is an extra space before the * in <big>receiver-> *action</big> .
Remove that space so it reads <big>receiver->*action</big> .
This will solve the compile problem.
If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun
|
|
|
|
|
Thank you very much, ahmed zahmed!~
You solved my problem!
|
|
|
|
|
Hello world,
I am a rookie here, and want to learn C.
How and where should i begin??
|
|
|
|
|
A little googling may help you to find some tutorial sites - like this link[^]
|
|
|
|
|
Don't fickleness! Just learn!
|
|
|
|
|
Unless you have a need for plain C, you would probably be better ignoring it and going straight to C++ or C#. Lots of tutorials on the web, or get yourself a book. You can also get the free versions of Visual Studio here[^].
|
|
|
|
|
better learn c++, you can get free copy of "thinking in c++" online
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
C for Dummies[^]
If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun
|
|
|
|
|
|
|
Thanks a ton!
|
|
|
|
|
Hi all. I got a huge problem while trying to draw a text with MFC. So, i got my custom class which extends CStatic.
In OnPaint:
CPaintDC dc(this);
Gdiplus::Graphics * gfx = Gdiplus::Graphics::FromHDC(dc.GetSafeHdc());
CDC * pDC = CDC::FromHandle(gfx->GetHDC());
pDC->TextOut(0, 0, "my text");
gfx->ReleaseHDC(pDC->GetSafeHdc());
Simple. But every time OnPaint gets called - new text is drawn over old one, so it is getting bolder and bolder. And, it is not like the old one never erased, but it is erased only when there are about 5 same texts drawn over each one.
Another thing, i've tried not to use Gdiplus at all - do everything only with CDC thing - same effect. Have used DrawText - same effect. Only with Gdiplus DrawString text is drawn correctly. But i need to draw it with Gdi32.
Thanks.
011011010110000101100011011010000110100101101110
0110010101110011
|
|
|
|
|
You can try using Graphics object gfx only for drawing. No need to mix GDI and GDI+.
Instead of TextOut(), use Graphics::DrawString()
|
|
|
|