string to char* conversion
-
Hi I am building my tool in VC++ 2008 and it is non /clr based. I want the code that converts string to char* and it should be non clr based. I set project property "Common language runtime" as "No Common language runtime". http://support.microsoft.com/kb/311259\[^\] This link provides me solution to my problem but for that i have to set project property "Common language runtime" as a "Common language runtime support" which i don't want. Because if i change it gives me an error fatal error C1113: #using failed on 'h:\bipin\b.e\kpit proj\copy control\temp\dllproject\debug\dllproject.lib' Here is my code string snos; c1.ReadPhysicalDriveInNTWithZeroRights(snos); fuction reads hard disk serial number and stores it into "snos". Thanking you.
-
Hi I am building my tool in VC++ 2008 and it is non /clr based. I want the code that converts string to char* and it should be non clr based. I set project property "Common language runtime" as "No Common language runtime". http://support.microsoft.com/kb/311259\[^\] This link provides me solution to my problem but for that i have to set project property "Common language runtime" as a "Common language runtime support" which i don't want. Because if i change it gives me an error fatal error C1113: #using failed on 'h:\bipin\b.e\kpit proj\copy control\temp\dllproject\debug\dllproject.lib' Here is my code string snos; c1.ReadPhysicalDriveInNTWithZeroRights(snos); fuction reads hard disk serial number and stores it into "snos". Thanking you.
I think you asked this question and delete your question,right(one hours ago)?
-
Hi I am building my tool in VC++ 2008 and it is non /clr based. I want the code that converts string to char* and it should be non clr based. I set project property "Common language runtime" as "No Common language runtime". http://support.microsoft.com/kb/311259\[^\] This link provides me solution to my problem but for that i have to set project property "Common language runtime" as a "Common language runtime support" which i don't want. Because if i change it gives me an error fatal error C1113: #using failed on 'h:\bipin\b.e\kpit proj\copy control\temp\dllproject\debug\dllproject.lib' Here is my code string snos; c1.ReadPhysicalDriveInNTWithZeroRights(snos); fuction reads hard disk serial number and stores it into "snos". Thanking you.
so you think deleting your previous post and reposting it exactly the same again will change something ? just wondering : why are you insisting that much about the CLR thing ? you want what exactly ? convert a C++ string (std::string) to a C style string (char*) ? or you want to get the HDD serial number anyway ? BTW, where are you taking this function from ?
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
-
I think you asked this question and delete your question,right(one hours ago)?
I though ur not getting it. so i deleted my previous question. you want what exactly ? convert a C++ string (std::string) to a C style string (char*) ? ya toxcct i want that.
-
I though ur not getting it. so i deleted my previous question. you want what exactly ? convert a C++ string (std::string) to a C style string (char*) ? ya toxcct i want that.
-
I though ur not getting it. so i deleted my previous question. you want what exactly ? convert a C++ string (std::string) to a C style string (char*) ? ya toxcct i want that.
the std::string class has a c_str() function which returns a char*...
std::string str = "Hello World";
char psz[20] = {0};::strcpy(str.c_str(), psz);
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
-
thanks
-
so you think deleting your previous post and reposting it exactly the same again will change something ? just wondering : why are you insisting that much about the CLR thing ? you want what exactly ? convert a C++ string (std::string) to a C style string (char*) ? or you want to get the HDD serial number anyway ? BTW, where are you taking this function from ?
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
toxcct wrote:
just wondering : why are you insisting that much about the CLR thing ?
Maybe because searching MSDN for string returns tons of System.String links but almost no std::string links. MS is pushing us heavily in the direction of .NET.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all.
Douglas Adams, "Dirk Gently's Holistic Detective Agency" -
toxcct wrote:
just wondering : why are you insisting that much about the CLR thing ?
Maybe because searching MSDN for string returns tons of System.String links but almost no std::string links. MS is pushing us heavily in the direction of .NET.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all.
Douglas Adams, "Dirk Gently's Holistic Detective Agency"hum, yes, probably, but i don't read the MSDN, i just KNOW it ! lol
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]