|
The right decription is often half of the solution of the problem!!!
For these String conversion are some API function and macros available. Its better to use them.
I dont need them often so I dont remember gut I guess like OLE2CHAR( )
Greetings from Germany
|
|
|
|
|
yashveer wrote: v.bstrVal =sz.AllocSysString();
dont forget to free it using the SysFreeString().
|
|
|
|
|
ya i m actually using
SysFreeString()
I wouldnt have known about all this. I was searching for a way to convert text to csv.... i found something on msdn online
http://support.microsoft.com/kb/179706/
Instead of fixed string given in the code:
FillSafeArray(L"John", 0, 0, &saRet);
I wanted to use the following:
FillSafeArray(str, 0, 0, &saRet);
where str is CString
and hence....all this
|
|
|
|
|
Use the MultiByteToWideChar() function.
Other option is to define the _UNICODE in the project setting preprocessor definitions, so that the CString will be keeping wide characters internally and hence no conversion is requirent
|
|
|
|
|
You can use MultiByteToWideChar may be somethng like this
CString str;
wchar_t* wch
MultiByteToWideChar(CP_ACP,0,str,strlen(str),wch,strlen(str),NULL,NULL)
Don't forget to allocate memory to this wchar variable
then typecast this wchar to unsigned short*
FillSafeArray((unsigned short*)wch ,....)
I think this will help u out !!!
|
|
|
|
|
typecast it to const unsigned short* .....
FillSafeArray((const unsigned short*).....
|
|
|
|
|
hi all
can anybody tell me is whats the difference between UTF-8 and multibyte.
and from where i can find more information on the same?
Thanx in advance.
|
|
|
|
|
Google for "UTF-8 multibyte" and you will get many hits. Try Wikipedia first.
|
|
|
|
|
UTF-8 is a Unicode encoding scheme.
Multibyte is a common name for a number of legacy encodings that typically store strings in char arrays (in C) as opposed to wchar_t arrays.
|
|
|
|
|
Nemanja Trifunovic wrote: Multibyte is a common name for a number of legacy encodings that typically store strings in char arrays
Thus in the sense of your definition UTF-8 is a multibyte-format.
UTF-16 (not that someone in his right mind would use that) isn't.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
jhwurmbach wrote: UTF-8 is a multibyte-format.
It is in a sense that is usually stored in char arrays and is a variable length encoding, but as I said the term "multibyte" is usually used for various legacy ASCII extensions such as SHIFT_JIS. UTF-8 is really a Unicode encoding.
jhwurmbach wrote: UTF-16 (not that someone in his right mind would use that) isn't.
You probably mean UTF-32.
|
|
|
|
|
Nemanja Trifunovic wrote: jhwurmbach wrote:
UTF-16 (not that someone in his right mind would use that) isn't.
You probably mean UTF-32.
I meant UTF-8 in the original meaning. According to the link[^]given in the posting below, UTF-16 is fixed 16-bit (and seems to be what the Windows-designers had in mind when they added the UNICODE-Functions taking wchar_t)
It seem as if standard bodies have tampered with UTF-16.
UTF-8 uses bytes, but it leaves the fixed relationship one code number <-> one character (which UTF-16) reatined.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
jhwurmbach wrote: According to the link[^]given in the posting below, UTF-16 is fixed 16-bit
Don't know about the link, but UTF-16 is definitelly not fixed 16-bit per character. There are surrogate pairs[^] that cover the space above 16 bits.
On the other hand, with UTF-32, each code point is encoded with a 32-bit number, and it is the only fix-length Unicode encoding schema.
|
|
|
|
|
|
Hi
I want to Read the JPEG file in the CFile or CStdioFile format.
I used to Write and read ".doc",".xt" file format by
CStdioFile file1;
file1.m_pStream=fopen("d:/newfile1.doc","a+");
file1.WriteString(L"hai");
file1.Close();
now i want to Read and Write the JPEG formated file.Some of them said read file in Binary format, but i dont know how to read in binary format.
Give your suggestion to Read and Writeing of jpeg file format
regards
shakumar
shakumar
|
|
|
|
|
I think you must read stream fundamentals.
fstream fs;
fs.open("file.txt",ios::bin); // not sure about bin or binary.
Search in C++ books, msdn does not have good documentation about streams.
|| ART OF LIVING ||
|
|
|
|
|
Please refer here[^].
Regards,
Paresh.
|
|
|
|
|
shakumar_22 wrote: file1.m_pStream=fopen("d:/newfile1.doc","a+");
Why use this? there is an open function for CStdioFile and CFile.
file1.Open("d:/newfile1.doc",CFile::modeRead|CFile::modeWrite);
There are some other flags also for opening.
you can use the same for opening JPEG files. But what you gonne do by reading row JPEG data?
|
|
|
|
|
I want to send JPEG file through socket and write there in the receiving system as JPEG file.
for that purpose only i reading the jpeg file.
if any other way also suggest me to transfer the JPEG FILE through Socket from one system to onther
shakumar
|
|
|
|
|
shakumar_22 wrote: if any other way also suggest me to transfer the JPEG FILE through Socket from one system to onther
Your idea is not bad. you dont have to do any special handling for transfering JPEG file. Follow the same steps you followed for doc and other files.
|
|
|
|
|
You havent understand and I guess read the documentation of the CStdioFile class. Read this first and do your homeworks at home.
Greetings from Germany
|
|
|
|
|
shakumar_22 wrote: Some of them said read file in Binary format, but i dont know how to read in binary format.
See here for the difference between binary and text files. That said, consult MSDN for the distinction between CFile and CStdioFile .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I have successfully created a winform user control that i use on a webform by exposing it as an ActiveX control using the <object> tags.
Is there a way for me to access the objects public methods/properties from the ASP.NET code behind files when i post the aspx page back to the server?
Sinoop Sundar, Colossal Technologies
|
|
|
|
|
Hello Friends,
Does anybody know a function to monitor the single file and not the folder. I know there is a function named FindFirstChangeNotification() but that monitores the Folder or Folder tree I want to Monitor the Single File :->. Becoz When I am using the above function I am facing lots of probelms that i have posted earlier. (see Just below post)
|
|
|
|
|
hi,
you can take a look to the native API function ZwQueryDirectoryFile that are capable to help you in your research.
|
|
|
|