|
Hi
friends
can any one please tell me how to convert string data from
utf-8 to unicode 16 bit format?
i need it ,its very urgent.
Thanx
tunu
|
|
|
|
|
use WideCharToMultiByte()
nave
|
|
|
|
|
|
Actually, MultiByteToWideChar() is the right API. WideCharToMultiByte() goes the other way.
|
|
|
|
|
Hi!
I can not figure this one out: I have two MFC-projects. One compiles in VS 2002 and one in VS 2005.
At a certain point I have this line in both projects:
<br />
const TCHAR szHeaders[] =<br />
_T("Accept: text/*\r\nUser-Agent: XYZ\r\n");<br />
Now, in VS 2002 \r\n is intrepreted as a normal CRLF but not in VS 2005 it seems.
(MS: "The _TCHAR data type is defined conditionally in Tchar.h. If the symbol _UNICODE is defined for your build, _TCHAR is defined as wchar_t; otherwise, for single-byte and MBCS builds, it is defined as char.")
I have tried #undef _UNICODE without any luck! Debugger shows two squares: □□ like when !isascii() and does not break the line. Is it just the debugger or some conspericy going on here?
-- modified at 7:35 Monday 5th February, 2007
Regards,
Michael Mogensen, mm it-consult dk.
><((((º> ·.¸¸.· ><((((º> ·.¸¸.· ><((((º>
|
|
|
|
|
Could it be a mix up between the plain text return and the rich text return?
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
Or some wierd compiler bug? - I mean since I have not added/removed any defines etc.
Hmmmm...
Regards,
Michael Mogensen, mm it-consult dk.
><((((º> ·.¸¸.· ><((((º> ·.¸¸.· ><((((º>
|
|
|
|
|
It looks like this thread has been *handled* by the Policy Control Authority. Did he actually post this in the lounge?
Dario: How is "directory" in French? (I mean a file system directory).
John Simmons: "zee file holdaire thingie"
|
|
|
|
|
*sniff* smells like something for the C++ forum...
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
He can't catch a breal can he....
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
It's clearly just a rant.
Gary Kirkham
Forever Forgiven and Alive in the Spirit
He is no fool who gives what he cannot keep to gain what he cannot lose. - Jim Elliot
Me blog, You read
|
|
|
|
|
Michael Mogensen wrote:
Now, in VS 2002 \r\n is intrepreted as a normal CRLF but not in VS 2005 it seems.
How are you verifying this?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Just by looking into the buffer at a breakpoint after assignment/creation. It MUST be something I've missed but I just can't see it! I'll go into the hex tonight.
Regards,
Michael Mogensen, mm it-consult dk.
><((((º> ·.¸¸.· ><((((º> ·.¸¸.· ><((((º>
|
|
|
|
|
Michael Mogensen wrote: Just by looking into the buffer at a breakpoint after assignment/creation.
Are you using var,s or var,su in the watch window?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Is var,s and var,su some VS-setting or something? I don't know what I'm using... sorry... where do I check it?
Regards,
Michael Mogensen, mm it-consult dk.
><((((º> ·.¸¸.· ><((((º> ·.¸¸.· ><((((º>
|
|
|
|
|
Michael Mogensen wrote: Is var,s and var,su some VS-setting or something?
Yes, for the watch window.
Michael Mogensen wrote: where do I check it?
See here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Maybe I missed it somewhere, but where are you using this char data? The interpretation of
crlf and/or newlines varies by use.
|
|
|
|
|
I want to serialize an object that has a long* member. How do i do that?
|
|
|
|
|
Obviously you cannot serialize it in that format (it will only serialize the pointer, not the contents). What you need to do when saving your data is serialize the contents (for example, if this is an array of long, then serialize the number of elements and then serialize each element). Then, for loading, do the opposite operation: load the number of elements (and then allocate your array), then load each element.
|
|
|
|
|
I knew that it would not help me much to serialize the pointer to my long list. This is what i do:
void CMyObj::Serialize(CArchive& a)
{
if (ar.IsStoring())
{
ar<<m_nCount;
for(int i = 0;i<m_nCount;i++)
ar<<m_list[i];
}
else
{
ar>>m_nCount;
m_list = new long[m_nCount];
for(int i = 0;i<m_nCount;i++)
{
arr>>m_list[i];
}
}
}
What am i doing wrong? m_nCount gets read corectly but m_list is always filled whith 0's
|
|
|
|
|
eusto wrote: What am i doing wrong? m_nCount gets read corectly but m_list is always filled whith 0's
This should work. Are you sure you are not writing an array of 0s?
m_list is declared as a "long *"?
void CMyObj::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
ar << m_nCount;
for(int i = 0; i < m_nCount; i++)
ar << m_list[i];
}
else
{
ar >> m_nCount;
m_list = new long[m_nCount];
for(int i = 0; i < m_nCount; i++)
{
ar >> m_list[i];
}
}
}
|
|
|
|
|
HOW CAN I DISPLAY THAT NETWORK IS AVAILABLE OR NOT IN MFC ON CLICKING A BUTTON
pradeep
|
|
|
|
|
Do u mean Network means Internet connectivity?
Come online at:-
jubinc@skype
|
|
|
|
|
Please use
MultinetGetConnectionPerformance();
|
|
|
|
|
1) please read this[^]
2) then have a look here[^]
|
|
|
|