|
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?
|
|
|
|
|
I have included "afxwin.h"....but when I comment this line...an error occur
fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
what should I do..
Thanks in advance..
Rashmi
|
|
|
|
|
Hi,
I have successfully created an Outlook add-in project in Visual Studio
2005.
I'm programming in ATL.
I'm wondering how one could create an appointment?
Here's some sample code...
STDMETHODIMP CConnect::OnConnection(IDispatch *pApplication,
AddInDesignerObjects::ext_ConnectMode /*ConnectMode*/, IDispatch
*pAddInInst, SAFEARRAY ** /*custom*/ )
{
pApplication->QueryInterface(__uuidof(IDispatch),
(LPVOID*)&m_pApplication);
pAddInInst->QueryInterface(__uuidof(IDispatch),
(LPVOID*)&m_pAddInInstance);
CComQIPtr <Outlook::_Application> spApp(pApplication);
ATLASSERT(spApp);
m_spApp_Event_New_Mail = m_spApp_Event_Send_Mail = m_spApp = spApp;
//////////////////////// Application
event ////////////////////////////////////
HRESULT hr = NULL;//DispEventAdvise((IDispatch*)spExplorer);
hr =
AppEvents::DispEventAdvise((IDispatch*)m_spApp_Event_Send_Mail,&__uuidof(Outlook::ApplicationEvents));
if(FAILED(hr))
return hr;
hr =
AppEvents_New::DispEventAdvise((IDispatch*)m_spApp_Event_New_Mail ,&__uuidof(Outlook::ApplicationEvents));
if(FAILED(hr))
return hr;
spApp->ActiveExplorer(&m_spApp_Event_Explorer);
hr =
ExpEvents::DispEventAdvise((IDispatch*)m_spApp_Event_Explorer,
&__uuidof(Outlook::ExplorerEvents));
if(FAILED(hr))
return hr;
CComPtr <Outlook::_NameSpace> olNs;
CComQIPtr <Outlook::Recipient> currUser;
CComBSTR bstr_temp("");
CComQIPtr <Outlook::_Application> m_spOutlookApp(pApplication);
ATLASSERT(m_spOutlookApp);
m_spOutlookApp = spApp;
m_spOutlookApp->get_Session(&olNs);
if(olNs == NULL)
return -1;
olNs->get_CurrentUser(&currUser);
currUser->get_Name(&bstr_temp);
CString test1 = CString(bstr_temp);
MessageBox(NULL, test1, "connect", MB_OK);
return S_OK;
}
Thanks!
/Samuel
|
|
|
|
|
Hi All
I have created an MMC snapIn .I want to track result view list column header click event...but I dont know that what will be the that event so that I can catch it in MMC event handler..plz help me
thanks in advance
Rashmi Kushwaha
|
|
|
|
|
Hey Fish, why did you get another account?
Here is another question. Are you really trying to develop an MMC snap-in without reading the documentation? I strongly urge you to consult the documentation when working with any Library/API.
|
|
|
|
|
Hi mike..
I am developing a printer management console..and I have gone through some of the documents...I had written MMCN_COLUMN_CLICK event in my notify handler..but when a listview header is clicked..I didn't get the MMCN_COLUMN_CLICK event..can u help me plz,,...
|
|
|
|
|
Hi.
In the project that I am working, I need to develop a listener that checks a folder and files.
Well, on CLIENT this listener will have detect ANY internal change in ANY file in the folder and instantly will synchronizer with SERVER, like a ShadowCopy, and different of a snapshot, for keep integrity between CLIENT-SERVER, ok?
Can anyone give me a hand? Libraries, and similar components.
I'm working in c++ builder, but visual studio components also help.
Regards,
|
|
|
|
|
How many times are you going to post the same question ?
Creating a new user account and then posting the exact same question is a little lame, and will not encourage people to help.
|
|
|
|
|
Hi All
I have developed an MMC snap-in.It has some context menu options created in the program.Now at some event I want to hide some of the menu items declared in a menu.But I dont know how to do it..can anyone help me...
any type of help will be appreciated..
thanks in advance
Rashmi Kushwaha
|
|
|
|
|
Hey fish, I can help you. However I would like you to change your screen name to fit on a single line so that your posts don't take more space than everyone else. You do that and I will help you.
|
|
|
|
|
Hi All
I have developed an MMC snap-in.It has some context menu options created in the program.Now at some event I want to hide some of the menu items declared in a menu.But I dont know how to do it..can anyone help me...
any type of help will be appreciated..
thanks in advance
Rashmi Kushwaha
|
|
|
|
|
You can have the MenuUpdate handler(See CCmdUI) that will be called before
the menu is displayed.You can have the flag for the menuitems and depending on the value of the flag you can enable or disable the menuitems.
Ritesh.
|
|
|
|