> [...]
> in my .h file it is declared:
[quoted text clipped - 4 lines]
>
> CString CCMSMDSAssessmentMgr::GetDocID();
Why? I have never seen this.
> The error message I am getting is:
>
> "Member Function redeclaration not allowed"
Fine. The compiler catches this error.
> Why was the syntax OK in VS V6 but not in VS .NET?
I dunno why was it allowed in VC6. Maybe
a bug? I don't think it's std conform to
declare a class member like this, so I'm
fine with the new compiler disallowing it.
(Meybe you confuse this with the need to
_define_ static data members?)
> What
> is the proper syntax for declaring a member function as
> static?
As you did:
static CString GetDocID();
> 2) GetDefaultPrinter "Identifier Not Found"
>
[quoted text clipped - 4 lines]
> installed because this builds OK with VC++ V6. Any ideas
> what I need to do here?
My browser finds it in "winspool.h", the
help says "Declared in Winspool.h; include
Windows.h".
> Thanks for your help.
HTH!
> Regards,
>
> -Rob
Schobi

Signature
SpamTrap@gmx.de is never read
I'm Schobi at suespammers org
"And why should I know better by now/When I'm old enough not to?"
Beth Orton
Rob C - 09 Nov 2003 03:57 GMT
Thanks for your help. I'm not sure why I declared the
static functions that way in the first place. I just
remember having all sorts of compile errors when I first
tried it and that seemed to get rid of them. I must have
changed 2 things at the same time and thought that I
needed to redeclare the static in teh CPP file. Oh well.
I also did an include of winspool.h and then it complied.
I still find it odd hat I did not have to do this when
building under VC V6.
Regards,
-Rob
>-----Original Message-----
>> [...]
[quoted text clipped - 52 lines]
>
> Schobi
Hendrik Schober - 10 Nov 2003 11:45 GMT
> [...]
> I also did an include of winspool.h and then it complied.
As I quoted, <windows.h> would be the
file you should have to include.
> I still find it odd hat I did not have to do this when
> building under VC V6.
Probably one of the std lib headers
pulled <windows.h> in, already.
> Regards,
>
> -Rob
> [...]
Schobi

Signature
SpamTrap@gmx.de is never read
I'm Schobi at suespammers org
"And why should I know better by now/When I'm old enough not to?"
Beth Orton
Arvind Kumar Sharda - 06 May 2005 12:30 GMT
Hi..
In VC6 code will be working fine bcz it will not bother about int and
CString ..like as i m looking into ur code
static CString GetDocID()
{
return _T("10010");
}
But it will give problem in VC7 bcz in .Net when we are passing INT/LONG in
place of CString Parameters .We are passing a number for a CString. but
there is no LPCTSTR conversion to CString. So it is giving problem .
For Example
#define something 10
...
F myInstance;
//We are passing a number for a CString. This isn't valid in VC++ 7 as
there is no LPCTSTR conversion to CString.
myInstance.foo(something);
class F
{
void foo(CString a_sFoo)
{
//In most cases a_sFoo ends up as "" or some other corrupted string
AfxMessageBox(a_sFoo);
}
};
I think it will resolve ur problem