|
hi all,
I am getting error C2061: syntax error : identifier 'string' at this code
std::string LoadInstaller(__in UINT nID, string tcItemText);
std::string LoadProduct(__in UINT nID);
std::string LoadInstaller(UINT nID , string tcItemText)
{
ATL::CString StrTable;
string InstallerKey;
InstallerKey = "";
StrTable.LoadStringA(IDS_ServiceRegEntry);
InstallerKey.append(StrTable.GetString());
StrTable.LoadStringA(IDS_LongProjectName);
InstallerKey.append(StrTable.GetString());
StrTable.LoadStringA(IDS_ServiceParam);
InstallerKey.append(StrTable.GetString());
InstallerKey.append("\\");
StrTable.LoadStringA(nID);
InstallerKey.append(StrTable.GetString());
InstallerKey.append("\\");
InstallerKey.append(tcItemText);
return InstallerKey;
}
std::string LoadProduct(UINT nID)
{
ATL::CString StrTable;
string ProductKey;
ProductKey = "";
StrTable.LoadStringA(IDS_ServiceRegEntry);
ProductKey.append(StrTable.GetString());
StrTable.LoadStringA(IDS_LongProjectName);
ProductKey.append(StrTable.GetString());
StrTable.LoadStringA(IDS_ServiceParam);
ProductKey.append(StrTable.GetString());
ProductKey.append("\\");
StrTable.LoadStringA(nID);
ProductKey.append(StrTable.GetString());
return ProductKey;
}
I have already included <string>, i dont know what seems to be the problem. Any Advice?
Thanks,
Jayjay
|
|
|
|
|
monsieur_jj wrote: I have already included
What have you already included?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
You have forgotten the namespace std::string .
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
He probably has, but omitting the std namespace should have produced a C2065 error.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
It seems you need to include a header file.
|
|
|
|
|
i already included string header
|
|
|
|
|
Did you include?
#include <iostream>
using namespace std;
|
|
|
|
|
Please use the "<" and ">" links at the bottom when posting, otherwise the code is not readable.
On the other hand my previous post stands: he forgot to prefix the string variable declarations inside the functions with the namespace std .
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
|
|
That does not seem a setting for project because I need to Choose "C/C++" tab -> "Preprocessor" category. In test opencv propery does not have C/C++ tab
|
|
|
|
|
C/C++ tab would be just right there under configuration properties.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
|
I won't click on another link if it ponits to a 2 Mb Bitmap. Why can't you upload it as a JPG?
And to solve your problem, is that an empty project[^]? The C/C++ settings applies for the files that belong to the properties of a project. So, if you don't have files, then the tab shouldn't appear. Try adding files to your project first.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
There are no settings for C++ because you don't have any files in the project. Add some files and the settings will appear.
-Saurabh
|
|
|
|
|
Hi All
I am useing SHFileOperation.Code is here
void CAbc::OnBnClickedButton1()
{
CString pzFrom=_T("C:\\Test\\");
CString psTo=_T("C:\\");
CopyFolder(pzFrom, psTo);
}
void CAbc::CopyFolder(LPCTSTR pszFrom, LPCTSTR pszTo)
{
SHFILEOPSTRUCT fos ={0};
fos.wFunc = FO_COPY;
fos.pTo = pszTo;
fos.pFrom = pszFrom;
::SHFileOperation(&fos);
}
Both Directory exits.I am geting Error this on Dailog Box
Could not find this item
This is no longer in C:\Test\.Verify the Item's location and try again.
I am not to figure out why this is happen.Becouse both directory exits.
Plz help me
|
|
|
|
|
Where's your name file in this code?
|
|
|
|
|
Sorry Sir i am not geting waht you want to know from me?Plz tell me
|
|
|
|
|
|
Plz help me it's urgent sir..
|
|
|
|
|
Hi,
There you have just specified two folders name.
What happened to the file name.
Because its SHFileOperation file operation..
|
|
|
|
|
TeVc++ wrote: urgent
For urgentz matterz plz askz CPallini. He willz helpz.
|
|
|
|
|
TeVc++ wrote: Plz help me it's urgent sir..
Of course when you use of this phrase you must be wait for CPallini but
your code is working for me:
SHFILEOPSTRUCT p={0};
p.wFunc = FO_COPY;
p.pTo = _T("c:\\");
p.pFrom = _T("c:\\2\\1");
SHFileOperation(&p);
You got this error because you use of p.pFrom = _T("c:\\2\\"); but you must be set a name after \\
|
|
|
|
|
Did you try to use flags for SHFILEOPSTRUCT, like FOF_MULTIDESTFILES ? Did you read the documentation?
|
|
|
|
|
Try this:
LPCTSTR lpFrom = _T("D:\\SymbianDev\\Test\0");
LPCTSTR lpTo = _T("D:\\SymbianDev\\Test1\0");
SHFILEOPSTRUCT fos ={0};
fos.wFunc = FO_COPY;
fos.pTo = lpTo;
fos.pFrom = lpFrom;
if(::SHFileOperation(&fos) == 0)
cout<<"SHFileOperation succeeded"<<endl;
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
modified on Friday, October 3, 2008 6:42 AM
|
|
|
|