|
Hi Stuart,
I went into detail on my choosing of a list over vector with Steve above (and concluded I could use a slist to lessen memory requirements). But I believe I could use your code on the stream. Thanks.
Jeff
|
|
|
|
|
One other thing - one detail I didn't notice was that your file is a binary format - strictly, you should be using unsigned char s, I guess, so that signs don't get in the way. Probably doesn't make any pragmatic difference, though.
|
|
|
|
|
Hi Stuart,
Stuart Dootson wrote: strictly, you should be using unsigned chars,
Got it... I was being lazy before I did the #define byte unsigned char
Thanks,
Jeff
|
|
|
|
|
Jeffrey Walton wrote: file.open( "..//smime.p7b", std::ios::binary );
A P7B file is a Cryptographic Message Sytnax Standard (PKCS #7). As such, it is specified in ASN.1 notation.
ASN.1 is an interesting beast. To parse, it requires more of a 'Message Cracker' (similar to Windows Messaging), rather than a full fledged parser/tokenizer (HTML, XML, etc).
Jeff
|
|
|
|
|
Dear all,
Could you help me giving a sample of a function which return bitset (Standar Template Library). Please reply as soon as possible. I am waiting...
Thanks.
Regards,
Ian
|
|
|
|
|
#include <bitset>
std::bitset<12> BitsetWithNthBitSet(int n)
{
return std::bitset<12>().set(n, true);
}
|
|
|
|
|
Stuart Dootson wrote: std::bitset<12> BitsetWithNthBitSet(int n) { ...
In the example above you mention the N of bitset<n> is 12. How about if you don't know the 'N'?
-- modified at 22:54 Thursday 8th November, 2007
|
|
|
|
|
|
You can only use std::bitset if N is fixed at compile-time. If you don't know N until runtime, you can use std::vector<bool> or (as Rob said) boost::dynamic_bitset .
|
|
|
|
|
Ontanggabe Parulian wrote: In the example above you mention the N of bitset is 12. How about if you don't know the 'N'?
i feel, you need to N , otherwise how you determine which bit you have to set.
"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
|
|
|
|
|
Hello all.
So I was working with no problem in some DLLs using WTL's CString. No problemo here. However, now that I'm building my UI with WTL, the compiler is throwing me a naughty error: "CString: ambiguos symbol".
I have the following headers in my stdafx.h file:
#include <atlwin.h>
#include <atlcrack.h>
#include <atlframe.h>
#include <atlctrls.h>
#include <atldlgs.h>
#include <atlctrlw.h>
#include <atlctrlx.h>
#include <atlddx.h>
#include <atltime.h>
#include <atlmisc.h>
The bolded include is the one causing the problem. The reason is that such file uses ATL's CString version. Is there any way I can avoid ATL::CString messing up my code (I mean, without having to prefix my code with WTL::CString)?
Thanks in advance.
Hope is the negation of reality - Raistlin Majere
|
|
|
|
|
I think you can avoid the ambigous symbol problem by placing:
using WTL::CString;
in your stdafx.h file.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
No, by doing so it throws me the "CString ambiguos symbol"...
Hope is the negation of reality - Raistlin Majere
|
|
|
|
|
Have you tried to "typedef" WTL::CString to something like WString?
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Yep, already. Even tried things like
#undef CString
#define WTL::CString CString
but didn't work.
Hope is the negation of reality - Raistlin Majere
|
|
|
|
|
CString is actually a "typedef" at global scope! Why did they do that?
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
I think I found it! You have to define: _ATL_NO_AUTOMATIC_NAMESPACE because the atlbase.h header file has a using namespace ATL; .
Thus, you can do: using WTL::CString;
However, that opens up another problem with the ATL namespace contents!
-- modified at 21:27 Wednesday 7th November, 2007
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Thanks! I'll give it a try! I've been looking for something like that.
Hope is the negation of reality - Raistlin Majere
|
|
|
|
|
Well, finally --and thanks to your help-- I was able to work with this CString without the compiler error. However I just give up.
I ended my DLLs (all of them with classes that uses CString) and began the construction of the front end application. What a mess. If I have something like:
class __declspec(dllexport) C
{
public:
C() { }
CString _cs;
};
void foo()
{
C c;
CString str = c._cs;
return;
}
It just throws me asserts and system errors. The problem is that a CString object is initialized within the DLL and its data is copied in the exe. Then, when str 's destructor is called, the application fails. I guess it has something to do with the data exchange between memory segments. Something with:
_declspec(selectany) LPCTSTR _atltmpPchNil = (LPCTSTR)(((BYTE*)&rgInitData)
+ sizeof(CStringData));
which is called by the Init method (via _GetEmptyString ). Haven't done enough research though, I'm not quite sure about this.
Thus I just give up. I'm using ATL::CString . I already made the changes (which fortunately was only needed in the stdafx.h files) and now everything's workings smoothly.
Once again, thanks for the help.
Hope is the negation of reality - Raistlin Majere
|
|
|
|
|
I do a lot of WTL/ATL work and use the ATL CString instead of the WTL one (I am using VS2005 FWIW). I simply include <atlstr.h> between <atlbase.h> and <atlapp.h> and before including <atlmisc.h> I define _WTL_NO_CSTRING.
|
|
|
|
|
Yep, _WTL_NO_CSTRING is the correct magic that makes it work
|
|
|
|
|
Hi All
I have created a project in ATL.when I compile it in UNICODE release mode..I get following errors...
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1234): error C2433: 'CFileFind::CString' : 'virtual' not permitted on data declarations
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxstr.h(37): error C2039: 'ChTraitsCRT' : is not a member of 'ATL'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxstr.h(37): error C2039: 'ChTraitsCRT' : is not a member of 'ATL'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxstr.h(37): error C2039: 'ChTraitsCRT' : is not a member of 'ATL'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxstr.h(100): error C2059: syntax error : '>'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxstr.h(101): error C2059: syntax error : '>'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxstr.h(102): error C2059: syntax error : '>'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1135): error C2061: syntax error : identifier 'CString'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1483): error C2061: syntax error : identifier 'CString'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atltime.h(320): error C2064: term does not evaluate to a function taking 1 arguments
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atltime.h(388): error C2064: term does not evaluate to a function taking 1 arguments
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atltime.h(393): error C2064: term does not evaluate to a function taking 1 arguments
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxstr.h(37): error C2065: 'ChTraitsCRT' : undeclared identifier
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxcoll.h(545): error C2086: 'const int CStringArray::CString' : redefinition
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxcoll.h(537) : see declaration of 'CStringArray::CString'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxcoll.h(561): error C2086: 'const int CStringArray::CString' : redefinition
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxcoll.h(537) : see declaration of 'CStringArray::CString'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atltime.h(386): error C2086: 'int ATL::CString' : redefinition
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atltime.h(318) : see declaration of 'ATL::CString'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atltime.h(391): error C2086: 'int ATL::CString' : redefinition
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atltime.h(318) : see declaration of 'ATL::CString'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxcoll.h(540): error C2143: syntax error : missing ',' before '&'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxcoll.h(551): error C2143: syntax error : missing ',' before '&'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxcoll.h(555): error C2143: syntax error : missing ',' before '&'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxcoll.h(537): error C2143: syntax error : missing ';' before '&'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxcoll.h(542): error C2143: syntax error : missing ';' before '&'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxcoll.h(561): error C2143: syntax error : missing ';' before '&'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxcoll.h(545): error C2143: syntax error : missing ';' before '*'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxcoll.h(546): error C2143: syntax error : missing ';' before '*'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxstr.h(100): error C2143: syntax error : missing ';' before '>'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxstr.h(101): error C2143: syntax error : missing ';' before '>'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxstr.h(102): error C2143: syntax error : missing ';' before '>'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atltime.h(386): error C2143: syntax error : missing ';' before 'ATL::CTime::Format'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atltime.h(391): error C2143: syntax error : missing ';' before 'ATL::CTime::FormatGmt'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atltime.h(318): error C2143: syntax error : missing ';' before 'ATL::CTimeSpan::Format'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atltime.h(79): error C2146: syntax error : missing ';' before identifier 'Format'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atltime.h(147): error C2146: syntax error : missing ';' before identifier 'Format'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atltime.h(148): error C2146: syntax error : missing ';' before identifier 'FormatGmt'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1056): error C2146: syntax error : missing ';' before identifier 'GetFileName'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1234): error C2146: syntax error : missing ';' before identifier 'GetFileName'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1058): error C2146: syntax error : missing ';' before identifier 'GetFilePath'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1235): error C2146: syntax error : missing ';' before identifier 'GetFilePath'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1057): error C2146: syntax error : missing ';' before identifier 'GetFileTitle'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1236): error C2146: syntax error : missing ';' before identifier 'GetFileTitle'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1237): error C2146: syntax error : missing ';' before identifier 'GetFileURL'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1238): error C2146: syntax error : missing ';' before identifier 'GetRoot'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(939): error C2146: syntax error : missing ';' before identifier 'm_strFileName'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(981): error C2146: syntax error : missing ';' before identifier 'm_strFileName'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1111): error C2146: syntax error : missing ';' before identifier 'm_strFileName'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1561): error C2146: syntax error : missing ';' before identifier 'm_strFileName'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1273): error C2146: syntax error : missing ';' before identifier 'm_strRoot'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxstr.h(37): error C2275: '_CharType' : illegal use of this type as an expression
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxstr.h(100) : see declaration of '_CharType'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxstr.h(37): error C2275: '_CharType' : illegal use of this type as an expression
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxstr.h(101) : see declaration of '_CharType'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxstr.h(37): error C2275: '_CharType' : illegal use of this type as an expression
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxstr.h(102) : see declaration of '_CharType'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1056): error C2433: 'CFile::CString' : 'virtual' not permitted on data declarations
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1057): error C2433: 'CFile::CString' : 'virtual' not permitted on data declarations
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1058): error C2433: 'CFile::CString' : 'virtual' not permitted on data declarations
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1235): error C2433: 'CFileFind::CString' : 'virtual' not permitted on data declarations
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1236): error C2433: 'CFileFind::CString' : 'virtual' not permitted on data declarations
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1237): error C2433: 'CFileFind::CString' : 'virtual' not permitted on data declarations
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1238): error C2433: 'CFileFind::CString' : 'virtual' not permitted on data declarations
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atltime.h(318): error C2433: 'CString' : 'inline' not permitted on data declarations
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atltime.h(386): error C2433: 'CString' : 'inline' not permitted on data declarations
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atltime.h(391): error C2433: 'CString' : 'inline' not permitted on data declarations
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atltime.h(147): error C2501: 'ATL::CTime::CString' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atltime.h(148): error C2501: 'ATL::CTime::CString' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atltime.h(79): error C2501: 'ATL::CTimeSpan::CString' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1561): error C2501: 'CArchive::CString' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1561): error C2501: 'CArchive::m_strFileName' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(939): error C2501: 'CArchiveException::CString' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(939): error C2501: 'CArchiveException::m_strFileName' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1056): error C2501: 'CFile::CString' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1057): error C2501: 'CFile::CString' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1058): error C2501: 'CFile::CString' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1111): error C2501: 'CFile::CString' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1111): error C2501: 'CFile::m_strFileName' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(981): error C2501: 'CFileException::CString' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(981): error C2501: 'CFileException::m_strFileName' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1234): error C2501: 'CFileFind::CString' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1235): error C2501: 'CFileFind::CString' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1236): error C2501: 'CFileFind::CString' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1237): error C2501: 'CFileFind::CString' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1238): error C2501: 'CFileFind::CString' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1273): error C2501: 'CFileFind::CString' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1273): error C2501: 'CFileFind::m_strRoot' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atltime.h(318): error C2501: 'CString' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atltime.h(386): error C2501: 'CString' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atltime.h(391): error C2501: 'CString' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxcoll.h(542): error C2501: 'CStringArray::CString' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxcoll.h(546): error C2501: 'CStringArray::CString' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxcoll.h(542): error C2501: 'CStringArray::ElementAt' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxcoll.h(537): error C2501: 'CStringArray::GetAt' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxcoll.h(545): error C2501: 'CStringArray::GetData' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxcoll.h(546): error C2501: 'CStringArray::GetData' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxcoll.h(561): error C2501: 'CStringArray::operator`[]'' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxcoll.h(545): error C2734: 'CStringArray::CString' : const object must be initialized if not extern
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxcoll.h(561): error C2734: 'CStringArray::CString' : const object must be initialized if not extern
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxstr.h(37): error C2974: 'StrTraitMFC' : invalid template argument for 'StringIterator', type expected
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxstr.h(51) : see declaration of 'StrTraitMFC'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxstr.h(37): error C2974: 'StrTraitMFC' : invalid template argument for 'StringIterator', type expected
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxstr.h(51) : see declaration of 'StrTraitMFC'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxstr.h(37): error C2974: 'StrTraitMFC' : invalid template argument for 'StringIterator', type expected
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxstr.h(51) : see declaration of 'StrTraitMFC'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxstr.h(100): error C3203: 'StrTraitMFC' : class template invalid as template argument for template parameter 'StringTraits', expected a real type
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxstr.h(101): error C3203: 'StrTraitMFC' : class template invalid as template argument for template parameter 'StringTraits', expected a real type
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxstr.h(102): error C3203: 'StrTraitMFC' : class template invalid as template argument for template parameter 'StringTraits', expected a real type
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxstr.h(37): error C3861: 'ChTraitsCRT': identifier not found, even with argument-dependent lookup
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxstr.h(37): error C3861: 'ChTraitsCRT': identifier not found, even with argument-dependent lookup
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxcoll.h(561): fatal error C1003: error count exceeds 100; stopping compilation
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxstr.h(101): warning C4091: 'typedef ' : ignored on left of 'ATL::CStringT<basetype,stringtraits>' when no variable is declared
with
[
BaseType=char,
StringTraits=int
]
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxstr.h(100): warning C4091: 'typedef ' : ignored on left of 'ATL::CStringT<basetype,stringtraits>' when no variable is declared
with
[
BaseType=wchar_t,
StringTraits=int
]
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxstr.h(102): warning C4091: 'typedef ' : ignored on left of 'ATL::CStringT<basetype,stringtraits>' when no variable is declared
with
[
BaseType=wchar_t,
StringTraits=int
]
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxcoll.h(542): warning C4183: 'ElementAt': missing return type; assumed to be a member function returning 'int'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atltime.h(79): warning C4183: 'Format': missing return type; assumed to be a member function returning 'int'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atltime.h(147): warning C4183: 'Format': missing return type; assumed to be a member function returning 'int'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atltime.h(148): warning C4183: 'FormatGmt': missing return type; assumed to be a member function returning 'int'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxcoll.h(537): warning C4183: 'GetAt': missing return type; assumed to be a member function returning 'int'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxcoll.h(545): warning C4183: 'GetData': missing return type; assumed to be a member function returning 'int'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxcoll.h(546): warning C4183: 'GetData': missing return type; assumed to be a member function returning 'int'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1056): warning C4183: 'GetFileName': missing return type; assumed to be a member function returning 'int'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1234): warning C4183: 'GetFileName': missing return type; assumed to be a member function returning 'int'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1058): warning C4183: 'GetFilePath': missing return type; assumed to be a member function returning 'int'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1235): warning C4183: 'GetFilePath': missing return type; assumed to be a member function returning 'int'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1057): warning C4183: 'GetFileTitle': missing return type; assumed to be a member function returning 'int'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1236): warning C4183: 'GetFileTitle': missing return type; assumed to be a member function returning 'int'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1237): warning C4183: 'GetFileURL': missing return type; assumed to be a member function returning 'int'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afx.h(1238): warning C4183: 'GetRoot': missing return type; assumed to be a member function returning 'int'
Plzzz help me
thanks in advance
Rashmi
|
|
|
|
|
alien8888 wrote: I have created a project in ATL
There are a lot of MFC includes (afx.h, afxstr.h, afxcoll.h) for an ATL project...
Anyway - I suspect you have the pre-processor symbol '_ATL_MIN_CRT' defined somewhere, which could be causing these errors. This will be set by selecting 'Yes' for the property 'Minimize CRT use in ATL' in the project properties. The property is in the 'General' properties page, where you can set the Output and Intermediate directories.
Anyway - make sure this property is set to 'No'.
HTH
|
|
|
|
|
Hi Stuart
Thanks alot for ur help....I have tried this but still getting these errors...
in property page "Use of ATL" option is set to "Static link to ATL"...and use of MFC is set to "Use Standard Windows Libraries"....
plzzz help me...
Thanks in advance
Rashmi
|
|
|
|
|
alien8888 wrote: use of MFC is set to "Use Standard Windows Libraries"....
See - here's the thing - going by your original post, you're including a whole load of MFC headers (the ones that start with afx), but according to your project properties, you're not using MFC - why should you be including ANY MFC headers?
|
|
|
|