Click here to Skip to main content
15,867,686 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: STL std::string help needed Pin
Richard MacCutchan9-Feb-17 20:51
mveRichard MacCutchan9-Feb-17 20:51 
GeneralRe: STL std::string help needed Pin
Jochen Arndt9-Feb-17 21:13
professionalJochen Arndt9-Feb-17 21:13 
GeneralRe: STL std::string help needed Pin
VISWESWARAN19989-Feb-17 21:56
professionalVISWESWARAN19989-Feb-17 21:56 
GeneralRe: STL std::string help needed Pin
Jochen Arndt9-Feb-17 23:35
professionalJochen Arndt9-Feb-17 23:35 
PraiseRe: STL std::string help needed Pin
VISWESWARAN19989-Feb-17 23:53
professionalVISWESWARAN19989-Feb-17 23:53 
PraiseRe: STL std::string help needed Pin
VISWESWARAN19989-Feb-17 23:07
professionalVISWESWARAN19989-Feb-17 23:07 
AnswerRe: STL std::string help needed Pin
Jochen Arndt8-Feb-17 22:29
professionalJochen Arndt8-Feb-17 22:29 
GeneralRe: STL std::string help needed Pin
VISWESWARAN19989-Feb-17 4:00
professionalVISWESWARAN19989-Feb-17 4:00 
GeneralRe: STL std::string help needed Pin
Jochen Arndt9-Feb-17 4:12
professionalJochen Arndt9-Feb-17 4:12 
GeneralRe: STL std::string help needed Pin
VISWESWARAN19989-Feb-17 19:52
professionalVISWESWARAN19989-Feb-17 19:52 
Thank you for your solution sir but the wide character is something like this,

L"F:\\dupelicateFinder\\New folder\\New folder\\检查.jpg"

so I am converting it to the string by the above method described by you,

"F:\\dupelicateFinder\\New folder\\New folder\\检查.jpg"

I've have already found a way to convert the std::string to char* using strcppy so finally I get this,

"F:\\dupelicateFinder\\New folder\\New folder\\检查.jpg"

the same thing as of string, but I have a function( from 3rd party library) which takes char* as an argument so, I have char* value as F:\\dupelicateFinder\\New folder\\New folder\\检查.jpg

but the function shows returns -1(file not found) since the unicode fonts didn't changed from 检查.jpg to 检查.jpg so how to open the file using that function

I have checked the work flow of this function using Debugger by creating the break-points and checked the values using Immediate window.

Below is my code:

C++
// Template is passed as wstring i.e duplicates is equal to std::wstring
template<typename duplicates>
std::string Duplicates<duplicates>::compute_hash(duplicates file_loc)
{
	std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
	std::string narrow_target = converter.to_bytes(file_loc);
	char *cstr = new char[narrow_target.length() + 1];
	strcpy(cstr, narrow_target.c_str());
	 //This function takes char* as an argument
	std::string hash = CALL_MD5_Function(cstr);
	delete[] cstr;
	std::cout << hash;
	return hash;
}

AnswerRe: STL std::string help needed Pin
Daniel Pfeffer9-Feb-17 6:17
professionalDaniel Pfeffer9-Feb-17 6:17 
GeneralRe: STL std::string help needed Pin
VISWESWARAN19989-Feb-17 7:27
professionalVISWESWARAN19989-Feb-17 7:27 
GeneralRe: STL std::string help needed Pin
Daniel Pfeffer11-Feb-17 7:36
professionalDaniel Pfeffer11-Feb-17 7:36 
QuestionRe: STL std::string help needed Pin
VISWESWARAN199812-Feb-17 0:18
professionalVISWESWARAN199812-Feb-17 0:18 
AnswerRe: STL std::string help needed Pin
Daniel Pfeffer12-Feb-17 0:47
professionalDaniel Pfeffer12-Feb-17 0:47 
PraiseRe: STL std::string help needed Pin
VISWESWARAN199812-Feb-17 4:25
professionalVISWESWARAN199812-Feb-17 4:25 
PraiseRe: STL std::string help needed Pin
VISWESWARAN19989-Feb-17 23:54
professionalVISWESWARAN19989-Feb-17 23:54 
QuestionMultiple Inheritance question Pin
samzcs25-Dec-16 17:31
samzcs25-Dec-16 17:31 
GeneralRe: Multiple Inheritance question Pin
Richard MacCutchan25-Dec-16 20:36
mveRichard MacCutchan25-Dec-16 20:36 
GeneralRe: Multiple Inheritance question Pin
samzcs26-Dec-16 7:51
samzcs26-Dec-16 7:51 
GeneralRe: Multiple Inheritance question Pin
Richard MacCutchan26-Dec-16 21:29
mveRichard MacCutchan26-Dec-16 21:29 
AnswerRe: Multiple Inheritance question Pin
Vi228-Dec-16 18:35
Vi228-Dec-16 18:35 
GeneralRe: Multiple Inheritance question Pin
samzcs28-Dec-16 18:40
samzcs28-Dec-16 18:40 
QuestionCalling a MFC dialog from win32 Pin
rdeekonda29-Jul-16 5:46
rdeekonda29-Jul-16 5:46 
AnswerRe: Calling a MFC dialog from win32 Pin
Afzaal Ahmad Zeeshan29-Jul-16 6:01
professionalAfzaal Ahmad Zeeshan29-Jul-16 6:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.