Click here to Skip to main content
15,917,481 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to pass string in DLL? Pin
Cedric Moonen12-Apr-05 1:31
Cedric Moonen12-Apr-05 1:31 
GeneralRe: How to pass string in DLL? [edited] Pin
Cedric Moonen12-Apr-05 2:06
Cedric Moonen12-Apr-05 2:06 
AnswerRe: How to pass string in DLL? Pin
Francesco Aruta12-Apr-05 8:46
Francesco Aruta12-Apr-05 8:46 
GeneralRe: How to pass string in DLL? Pin
Rick York12-Apr-05 9:30
mveRick York12-Apr-05 9:30 
GeneralRe: How to pass string in DLL? Pin
Francesco Aruta12-Apr-05 9:53
Francesco Aruta12-Apr-05 9:53 
GeneralRe: How to pass string in DLL? Pin
Cedric Moonen12-Apr-05 20:55
Cedric Moonen12-Apr-05 20:55 
GeneralRe: How to pass string in DLL? Pin
Francesco Aruta13-Apr-05 0:19
Francesco Aruta13-Apr-05 0:19 
GeneralForwardReferencing in VC++ 6.0 Pin
Ganesh_Srim11-Apr-05 23:35
Ganesh_Srim11-Apr-05 23:35 
Hello All,

The following simple program that uses forward referencing does not
compile in my VC++ 6.0 compiler.
On the line where I define the member function
Pont2D::projectFrom(Point3D p3d) { ... }
the compiler complains that Point3D is undefined and refers to the
declaration at the beginning that tries to forward reference
the Point3D class. Here is the compiler output:

ForwardReference.cpp
ForwardReference.cpp(11) : error C2027: use of undefined type 'Point3D'
ForwardReference.cpp(4) : see declaration of 'Point3D'
ForwardReference.cpp(11) : error C2228: left of '.i' must have class/struct/union type
ForwardReference.cpp(11) : error C2027: use of undefined type 'Point3D'
ForwardReference.cpp(4) : see declaration of 'Point3D'
ForwardReference.cpp(11) : error C2228: left of '.j' must have class/struct/union type

Has any one encountered similar problem? Is there any command line option that would handle this issue?

Thanks.
Ganesh.


// ForwardReference.cpp: The First Line of the file
#include <iostream.h>

class Point3D; // Forward Declaration of class Point3D defined below.

class Point2D {
public:
int i, j;
Point2D() : i(0), j(0) {}
Point2D(int a, int b) : i(a), j(b) {}
void projectFrom(Point3D p3d) { i = p3d.i; j = p3d.j; } // compilation error
};

class Point3D { // being declared above, compiler ignores the defintion here.
public:
int i, j, k;
Point3D() : i(0), j(0) k(0) {}
Point3D(int ii, int jj, int kk) : i(ii), j(jj), k(kk) {}
Point3D& operator=(const Point2D& p2d) { i = p2d.i; j = p2d.j; k = 0;}
};

int main()
{
Point2D p2d(1,2);
Point3D p3d(2,3,4);
p2d.projectFrom(p3d);
cout << "p2d = (" << p2d.i << "' " << p2d.j << ").\n";
return 0;
}
// end ForwardReference.cpp

Ganesh
GeneralRe: ForwardReferencing in VC++ 6.0 Pin
toxcct11-Apr-05 23:57
toxcct11-Apr-05 23:57 
GeneralRe: ForwardReferencing in VC++ 6.0 Pin
Ganesh_Srim12-Apr-05 9:13
Ganesh_Srim12-Apr-05 9:13 
GeneralRe: ForwardReferencing in VC++ 6.0 Pin
Joel Holdsworth12-Apr-05 0:18
Joel Holdsworth12-Apr-05 0:18 
GeneralRe: ForwardReferencing in VC++ 6.0 Pin
CP Visitor12-Apr-05 4:44
CP Visitor12-Apr-05 4:44 
GeneralRe: ForwardReferencing in VC++ 6.0 Pin
Ganesh_Srim12-Apr-05 9:16
Ganesh_Srim12-Apr-05 9:16 
GeneralRe: ForwardReferencing in VC++ 6.0 Pin
Bob Helter12-Apr-05 10:11
sussBob Helter12-Apr-05 10:11 
GeneralRe: ForwardReferencing in VC++ 6.0 Pin
Ganesh_Srim12-Apr-05 23:12
Ganesh_Srim12-Apr-05 23:12 
GeneralRe: ForwardReferencing in VC++ 6.0 Pin
Blake Miller12-Apr-05 7:31
Blake Miller12-Apr-05 7:31 
GeneralRe: ForwardReferencing in VC++ 6.0 Pin
Ganesh_Srim12-Apr-05 9:10
Ganesh_Srim12-Apr-05 9:10 
GeneralRe: Tried All - NoLuck! Pin
Ganesh_Srim12-Apr-05 9:26
Ganesh_Srim12-Apr-05 9:26 
GeneralRe: Tried All - NoLuck! Pin
Rick York12-Apr-05 9:48
mveRick York12-Apr-05 9:48 
GeneralRe: Tried All - NoLuck! Pin
CP Visitor12-Apr-05 22:55
CP Visitor12-Apr-05 22:55 
GeneralRe: Tried All - NoLuck! Pin
Ganesh_Srim12-Apr-05 23:17
Ganesh_Srim12-Apr-05 23:17 
GeneralRe: Tried All - NoLuck! Pin
Ganesh_Srim12-Apr-05 23:12
Ganesh_Srim12-Apr-05 23:12 
GeneralRe: ForwardReferencing in VC++ 6.0: Resolved! Thanks All Pin
Ganesh_Srim12-Apr-05 23:21
Ganesh_Srim12-Apr-05 23:21 
GeneralNotify Change Pin
sunit511-Apr-05 23:25
sunit511-Apr-05 23:25 
GeneralRe: Notify Change Pin
ThatsAlok11-Apr-05 23:45
ThatsAlok11-Apr-05 23:45 

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.