Click here to Skip to main content
15,919,245 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: menu and sub menu Pin
mpapeo10-Apr-05 16:16
mpapeo10-Apr-05 16:16 
GeneralRe: menu and sub menu Pin
Christian Graus10-Apr-05 16:28
protectorChristian Graus10-Apr-05 16:28 
GeneralRe: menu and sub menu Pin
mpapeo10-Apr-05 16:43
mpapeo10-Apr-05 16:43 
Generalrun my program from DOS Pin
includeh1010-Apr-05 10:45
includeh1010-Apr-05 10:45 
GeneralRe: run my program from DOS Pin
Ravi Bhavnani10-Apr-05 11:14
professionalRavi Bhavnani10-Apr-05 11:14 
GeneralTernary Operation Pin
Ganesh_Srim10-Apr-05 9:49
Ganesh_Srim10-Apr-05 9:49 
GeneralRe: Ternary Operation Pin
Joaquín M López Muñoz10-Apr-05 10:10
Joaquín M López Muñoz10-Apr-05 10:10 
GeneralRe: Ternary Operation Pin
Ganesh_Srim11-Apr-05 8:32
Ganesh_Srim11-Apr-05 8:32 
Hello, THanks for the reply. I figured this out only now.
I did try what you suggested before.
But MS VC++ does not accpept such a construct like GNU CC does.

But this problem can be solved by subclassing a simple Point class:

class Coords2D {
public:
int x,y;
Coords2D() : x(0), y(0) {}
Coords2D(int a, int b) : x(a), y(b) {}
Coords2D(const Coords2D& c) : x(c.x), y(c.y) {}
Coords2D& operator=(const Coords2D& c) { x = c.x; y = c.y; }
};

// An instance hold reference to operands of binary +
class PointsToBeAdded {
public:
const Coords2D& p1;
const Coords2D& p2;
PointsToBeAdded(const Coords2D& pp1, const Coords2D& pp2) : p1(pp1), p2(pp2) {}
//operator Point();
};

class Point : public Coords2D
{
...
};
...
and so on....


Here is the error message

TernaryOpTester.cpp
H:\C++\Projects\Test\tmp\TernaryOpTester.cpp(79) : error C2027: use of undefined type 'PointsToBeAdded'
H:\C++\Projects\Test\tmp\TernaryOpTester.cpp(58) : see declaration of 'PointsToBeAdded'
H:\C++\Projects\Test\tmp\TernaryOpTester.cpp(79) : error C2228: left of '.p1' must have class/struct/union type
H:\C++\Projects\Test\tmp\TernaryOpTester.cpp(79) : error C2027: use of undefined type 'PointsToBeAdded'
H:\C++\Projects\Test\tmp\TernaryOpTester.cpp(58) : see declaration of 'PointsToBeAdded'
H:\C++\Projects\Test\tmp\TernaryOpTester.cpp(79) : error C2228: left of '.p2' must have class/struct/union type
Tool returned code: 2


Ganesh
GeneralA regular expression needed Pin
John R. Shaw10-Apr-05 9:47
John R. Shaw10-Apr-05 9:47 
GeneralRe: A regular expression needed Pin
Michael Dunn10-Apr-05 10:25
sitebuilderMichael Dunn10-Apr-05 10:25 
GeneralRe: A regular expression needed Pin
John R. Shaw10-Apr-05 11:06
John R. Shaw10-Apr-05 11:06 
GeneralRe: A regular expression needed Pin
Michael Dunn10-Apr-05 12:05
sitebuilderMichael Dunn10-Apr-05 12:05 
GeneralRe: A regular expression needed Pin
John R. Shaw10-Apr-05 13:03
John R. Shaw10-Apr-05 13:03 
GeneralDundas UltimateTCP40 - question Pin
#realJSOP10-Apr-05 5:22
professional#realJSOP10-Apr-05 5:22 
GeneralParasolid Pin
4apai10-Apr-05 4:05
4apai10-Apr-05 4:05 
GeneralMessageBox in other languages Pin
a_kiani10-Apr-05 3:45
a_kiani10-Apr-05 3:45 
GeneralRe: MessageBox in other languages Pin
ThatsAlok10-Apr-05 18:29
ThatsAlok10-Apr-05 18:29 
QuestionHow to get function name by its address Pin
Dudi Avramov10-Apr-05 1:32
Dudi Avramov10-Apr-05 1:32 
AnswerRe: How to get function name by its address Pin
Joel Holdsworth10-Apr-05 5:31
Joel Holdsworth10-Apr-05 5:31 
Generalcompling .exe Pin
monageasmear10-Apr-05 0:48
monageasmear10-Apr-05 0:48 
GeneralRe: compling .exe Pin
Gary R. Wheeler10-Apr-05 2:42
Gary R. Wheeler10-Apr-05 2:42 
GeneralRe: compling .exe Pin
4apai10-Apr-05 3:52
4apai10-Apr-05 3:52 
GeneralVariable Argument (Ellipsis (...)) in MFC Win32 DLL Pin
asdf175310-Apr-05 0:09
asdf175310-Apr-05 0:09 
GeneralRe: Variable Argument (Ellipsis (...)) in MFC Win32 DLL Pin
4apai10-Apr-05 3:54
4apai10-Apr-05 3:54 
GeneralRe: Variable Argument (Ellipsis (...)) in MFC Win32 DLL Pin
asdf1753110-Apr-05 4:52
sussasdf1753110-Apr-05 4:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.