青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

Benjamin

靜以修身,儉以養德,非澹薄無以明志,非寧靜無以致遠。
隨筆 - 398, 文章 - 0, 評論 - 196, 引用 - 0
數據加載中……

WCHAT、TCHAT、CString和char*的轉換(WM5.0)

在平時的編程中字符串轉換經常遇到,常用的是MultiByteToWideChar和WideCharToMultiByte,具體的函數如下:
/////////////////////////////////////////////////////////////////////////////
//Description:
// This function maps a wide-character string to a new character string
//
//Parameters:
// lpcwszStr: [in] Pointer to the character string to be converted
// lpszStr: [out] Pointer to a buffer that receives the translated string.
// dwSize: [in] Size of the buffer
//
//Return Values:
// TRUE: Succeed
// FALSE: Failed
//
//Example:
// MByteToWChar(szW,szA,sizeof(szA)/sizeof(szA[0]));
//////////////////////////////////////////////////////////////////////////////
BOOL WCharToMByte(LPCWSTR lpcwszStr, LPSTR lpszStr, DWORD dwSize)
{
 DWORD dwMinSize;
 dwMinSize = WideCharToMultiByte(CP_OEMCP,NULL,lpcwszStr,-1,NULL,0,NULL,FALSE);
 if(dwSize < dwMinSize)
 {
  return FALSE;
 }
 WideCharToMultiByte(CP_OEMCP,NULL,lpcwszStr,-1,lpszStr,dwSize,NULL,FALSE);
 return TRUE;
}
///////////////////////////////////////////////////////////////////////////////
//Description:
// This function maps a character string to a wide-character (Unicode) string
//
//Parameters:
// lpcszStr: [in] Pointer to the character string to be converted
// lpwszStr: [out] Pointer to a buffer that receives the translated string.
// dwSize: [in] Size of the buffer
//
//Return Values:
// TRUE: Succeed
// FALSE: Failed
//
//Example:
// MByteToWChar(szA,szW,sizeof(szW)/sizeof(szW[0]));
///////////////////////////////////////////////////////////////////////////////
BOOL MByteToWChar(LPCSTR lpcszStr, LPWSTR lpwszStr, DWORD dwSize)
{
    // Get the required size of the buffer that receives the Unicode
    // string.
    DWORD dwMinSize;
    dwMinSize = MultiByteToWideChar (CP_ACP, 0, lpcszStr, -1, NULL, 0);
 
    if(dwSize < dwMinSize)
    {
  return FALSE;
    }
 
    // Convert headers from ASCII to Unicode.
    MultiByteToWideChar (CP_ACP, 0, lpcszStr, -1, lpwszStr, dwMinSize); 
    return TRUE;
}
很少有人提及到下面的兩個函數size_t  wcstombs(char (&mbstr)[size], const wchar_t *wcstr,  size_t count );
size_t mbstowcs( wchar_t (&wcstr)[size], const char *mbstr, size_t count ); 以為只能用在COM中,其實不然,還可以用在WM5.0和Wince平臺;
用這兩個函數的好處就是一行代碼就可以完成轉換。要注意的是在用wcstombs函數時第三個參數必須是第二個參數長度的兩倍,用mbstowcs是第三個參數是第二個參數的長度,wcstombs可以完成WCHAR、TCHAR、CString向char*的轉換。
CString是MFC中的類,可以用WCHAR、TCHAR、cahr*直接初始化和賦值;值得一提的是在WM5.0、WCE平臺稍微有些和其他windows平臺不同的是,雖然函數傳參時無論WCHAR/TCHAR、char*都可以轉成CString作參數傳遞,因為函數傳參實際是一個賦值的過程。但是在輸出到設備上時,還必須用mbstowcs函數來轉換。
雖然Wce和Mobile平臺上只能用Unicode,但是讀寫文件時依然可以用標準C的文件操作函數,但是讀寫文件時用的字符要一致。
關于VS2008平臺字符串轉換,請看http://msdn.microsoft.com/zh-cn/library/ms235631(VS.80).aspx

posted on 2008-08-21 22:30 Benjamin 閱讀(4309) 評論(26)  編輯 收藏 引用 所屬分類: PDA/PPC開發

評論

# re: WCHAT、TCHAT、CString和char*的轉換(WM5.0)  回復  更多評論   

The <a href="http://lowest-rate-loans.com/topics/personal-loans">personal loans</a> seem to be useful for guys, which would like to organize their own organization. As a fact, it is very comfortable to receive a secured loan.
2010-05-24 17:21 | HendricksRobin

# re: WCHAT、TCHAT、CString和char*的轉換(WM5.0)  回復  更多評論   

There’re billions of different people, which know about your very good release, and I offer to order the monophonic ringtones or mp3 ringtones to do yourself unique.
2010-07-18 03:18 | ringtones

# re: WCHAT、TCHAT、CString和char*的轉換(WM5.0)  回復  更多評論   

Fine information, many thanks to the author. It is puzzling to me now, but in general, the usefulness and importance is overwhelming. Very much thanks again and good luck!
2010-12-23 14:37 | Funny Videos

# dating website  回復  更多評論   

這是一個很有趣的文章。這真的峰我的興趣進一步閱讀你的文章。謝謝分享。
2011-01-10 16:16 | dating website

# top seo firm  回復  更多評論   

It is good to visit a website and learn something new like your blog. Thanks for the effort!
2011-02-11 15:23 | top seo firm

# webcialisadvisor  回復  更多評論   

Thanks for the useful tips and information from the author. I felt good to read all the previous postings too. I appreciate the time and effort that the author put to share all these information to us in an interesting and impressive way. Looking for more posts like this.
2011-03-15 19:36 | Finbar

# Really a great post.Reading is my passion and i like reading this type of stuff always.Nice sharing friend  回復  更多評論   

Really a great post.Reading is my passion and i like reading this type of stuff always.Nice sharing friend
2011-04-05 15:50 | mbt uk

# re: WCHAT、TCHAT、CString和char*的轉換(WM5.0)  回復  更多評論   

??? ? ? ?? ????? ??? ?????. ? ?? ??? ?? ???? ?? ?? ??. ?? ??? ???? ???? ???? ???? ????? ?? ??? ??? ?? ? ??? ??????. ??? ? ?? ???? ??.
2011-06-10 09:21 | revabs workout program

# re: WCHAT、TCHAT、CString和char*的轉換(WM5.0)  回復  更多評論   

Very well written. This is the kind of information that is useful to those want to increase their SERP’s. Keep up the good work.

<a href="http://coppervalleyrestorationservices.com">water">http://coppervalleyrestorationservices.com">water damage</a>
<a href="http://coppervalleyrestorationservices.com">fire damage</a>
<a href="http://coppervalleyrestorationservices.com">mold">http://coppervalleyrestorationservices.com">mold removal</a>
<a href="http://coppervalleyrestorationservices.com">mold">http://coppervalleyrestorationservices.com">mold abatement</a>
<a href="http://coppervalleyrestorationservices.com">water">http://coppervalleyrestorationservices.com">water restoration</a>
2011-08-14 14:27 | kadambi

# re: WCHAT、TCHAT、CString和char*的轉換(WM5.0)  回復  更多評論   

I like periodicals tremendously because I discovered lots of information from it. It is now that I realize that I possibly could also score something meaningful on the internet. Thanks for making this fantastic web page.

# re: WCHAT、TCHAT、CString和char*的轉換(WM5.0)  回復  更多評論   

I seemed to be exceedingly agitated to go through the affirmations in this internet site because the given topic is seriously wonderful. It will bag the concentration of all web navigators.
2011-11-07 17:30 | Business Plan Writing

# re: WCHAT、TCHAT、CString和char*的轉換(WM5.0)  回復  更多評論   

你寫的東西肯定是我有興趣英寸的方式提出你的立場是,產生少量無欽佩。出於這個原因,我選擇,讓你知道這些事情,因為我覺得你應該知道。這是我在說什麼。
2012-01-16 01:32 | Cell Phone Lookup

# re: WCHAT、TCHAT、CString和char*的轉換(WM5.0)  回復  更多評論   

I’ve been surfing for several kinds of training over the net at the time I noticed this specific Mobile Crane Training site. I was obviously astonished by the post. I'm now learning new from you. Keep writing cool information towards your site.

2012-03-30 14:04 | Mobile Crane Training

# re: WCHAT、TCHAT、CString和char*的轉換(WM5.0)  回復  更多評論   

One of my pastimes is to surf for nice blog sites online. This is why I saw this blog site on annuity rates. Your blog site right here is most likely one of my favorites. !
2012-10-02 11:07 | annuity rates

# re: WCHAT、TCHAT、CString和char*的轉換(WM5.0)  回復  更多評論   

I at first go online to search for details on psychic Adelaide however I was led to This site given that it has a cppblog that is fascinating. I was impressed after reviewing the whole write-up. Incredible!
2012-10-23 09:24 | This site

# re: WCHAT、TCHAT、CString和char*的轉換(WM5.0)  回復  更多評論   

I had great time over here and i found plenty of things that are pleasant and exciting.I had lot of fun and entertainment over here
2012-11-03 21:20 | b2b trade

# re: WCHAT、TCHAT、CString和char*的轉換(WM5.0)  回復  更多評論   

When I am finished with all of my household duties, I like to spend time online. I merely completed reading a post on Business Consultant when I saw the hyperlink to your web page. I believe it is fantastic to review useful reasons provided by true people.
2013-01-08 10:03 | Business Consultant

# re: WCHAT、TCHAT、CString和char*的轉換(WM5.0)  回復  更多評論   

Recently, I saw this blog on Waterloo Structures which caught my attention. Its impressive write-up and I have NO DOUBT! Check this website for more information.
2013-03-02 09:54 | Check this website

# re: WCHAT、TCHAT、CString和char*的轉換(WM5.0)  回復  更多評論   

After buying magnetic signs on the net, I stumbled across your web site and read through the WCHAT. I find it very awesome.
2013-03-04 09:38 | magnetic signs

# re: WCHAT、TCHAT、CString和char*的轉換(WM5.0)  回復  更多評論   

Your WCHAT is very impressive and filled with insights. Truthfully, I accidentally found it after checking out the site regarding GVO. Check it out by visiting gvoteamelite.com.
2013-03-05 11:46 | gvoteamelite.com

# re: WCHAT、TCHAT、CString和char*的轉換(WM5.0)  回復  更多評論   

Whilst seeking for columns pertaining to how to learn to trade forex, I happen to review WCHAT. And I accept, it is amongst the most ideal that I have read yet.
2013-05-16 15:30 | Learn to trade forex

# re: WCHAT、TCHAT、CString和char*的轉換(WM5.0)  回復  更多評論   

Using my smartphone, I've been taking a look at cppblog whilst waiting for my buddy I accompanied right here at HAIR SALON SILVER LAKE BY HTTP://SILVERLAKESTUDIOLA.COM/. It could however take her a moment so I sense I'll be socializing a minute more.
2013-10-30 09:22 | http://silverlakestudiola.com

# re: WCHAT、TCHAT、CString和char*的轉換(WM5.0)  回復  更多評論   

I've had an exhausting time searching Josh Groban records on ITunes Visit http://www.soundbarreviewsguide.com/. Glad I happen to go over several intriguing factors at your blog; Right now I get more potency.
2014-02-14 11:10 | Randal Porter

# re: WCHAT、TCHAT、CString和char*的轉換(WM5.0)  回復  更多評論   

Glad I happen to go over several intriguing factors at your blog; Right now I get more potency.
2016-08-11 23:48 | http://delhicosmeticsurgery.in

# re: WCHAT、TCHAT、CString和char*的轉換(WM5.0)  回復  更多評論   

I had the pleasure to chat with Cristina recently and got to know a little bit more about her life as a jewelry designer, wife and mother.
2016-08-11 23:51 | http://bestdelhispa.com
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            午夜精品一区二区三区在线| 亚洲麻豆视频| 久久久91精品国产| 性久久久久久久| 精久久久久久久久久久| 欧美国产精品人人做人人爱| 欧美国产欧美亚洲国产日韩mv天天看完整 | 久久在线免费视频| 久久久另类综合| aa国产精品| 亚洲欧美在线免费| 亚洲国产精品va在线观看黑人 | 亚洲欧美一区二区三区久久| 午夜欧美电影在线观看| 亚洲电影观看| 亚洲午夜激情免费视频| 国外精品视频| 亚洲裸体视频| 国内免费精品永久在线视频| 欧美福利视频| 国产欧美日本一区二区三区| 欧美成人有码| 国产精品视区| 亚洲欧洲中文日韩久久av乱码| 欧美系列亚洲系列| 免费成人av在线| 国产精品美女久久久久aⅴ国产馆| 久久在精品线影院精品国产| 欧美激情中文不卡| 久久综合色天天久久综合图片| 欧美激情一区二区三区高清视频 | 日韩视频在线观看一区二区| 亚洲综合激情| 日韩视频中文| 久久综合精品国产一区二区三区| 亚洲一区二区影院| 免费中文日韩| 久久天堂成人| 国产精自产拍久久久久久| 亚洲电影第三页| 国产在线欧美| 亚洲欧美文学| 亚洲已满18点击进入久久| 久久久亚洲人| 久久亚洲欧洲| 国产婷婷色一区二区三区| 亚洲精品一品区二品区三品区| 在线观看三级视频欧美| 亚洲欧美另类综合偷拍| 亚洲已满18点击进入久久| 欧美不卡三区| 亚洲高清资源| 亚洲精品美女在线观看播放| 久久久成人精品| 久久女同互慰一区二区三区| 国产精品入口尤物| 亚洲视频你懂的| 亚洲五月六月| 欧美性猛交一区二区三区精品| 亚洲日本激情| 最新国产成人在线观看| 亚洲精选中文字幕| 欧美精品99| 亚洲精品一区在线观看香蕉| 亚洲精品之草原avav久久| 欧美国产精品日韩| 亚洲精品乱码久久久久久日本蜜臀 | 亚洲国产精品一区制服丝袜| 久久久久欧美| 另类专区欧美制服同性| 在线看国产一区| 免费成人网www| 亚洲国产精品久久久久婷婷老年 | 亚洲高清资源综合久久精品| 美国成人直播| 亚洲人成在线观看一区二区| 一区二区三区你懂的| 欧美日韩在线电影| 亚洲性线免费观看视频成熟| 香蕉成人久久| 红桃视频欧美| 欧美福利电影在线观看| 日韩视频在线观看一区二区| 亚洲女优在线| 国内精品国语自产拍在线观看| 美女成人午夜| 一区二区精品国产| 久久精品国产久精国产一老狼 | 欧美日韩在线播放| 欧美在线www| 亚洲狠狠婷婷| 欧美在线播放| 亚洲精品视频一区二区三区| 欧美体内she精视频在线观看| 先锋亚洲精品| 91久久夜色精品国产九色| 亚洲欧美激情四射在线日| 狠狠色丁香久久综合频道| 欧美激情在线狂野欧美精品| 亚洲欧美在线视频观看| 亚洲国产综合在线看不卡| 午夜欧美大尺度福利影院在线看 | 欧美人成在线视频| 欧美在线一级va免费观看| 亚洲欧洲日产国产综合网| 欧美一区二区三区在线观看视频| 亚洲国产欧美一区二区三区同亚洲| 欧美日韩在线播放| 免费一区视频| 小处雏高清一区二区三区| 亚洲国产成人在线| 久久九九免费| 亚洲欧美在线免费| 亚洲精品一区二区三区樱花| 国产午夜精品一区二区三区欧美| 欧美精品www在线观看| 久久精品国产在热久久| 亚洲一区二区精品视频| 亚洲高清在线观看一区| 国产精品综合色区在线观看| 欧美伦理91| 欧美成ee人免费视频| 久久久91精品国产| 亚洲自拍电影| 在线天堂一区av电影| 最新精品在线| 亚洲国产精品热久久| 美女国内精品自产拍在线播放| 午夜精品视频| 亚洲欧美日韩系列| 亚洲男女自偷自拍图片另类| 在线视频一区观看| 99热免费精品在线观看| 日韩一区二区免费看| 91久久久精品| 亚洲激情视频| 亚洲日韩第九十九页| 亚洲黄色一区二区三区| 91久久精品一区二区别| 在线看片一区| 亚洲激情在线播放| 亚洲欧洲三级| av不卡在线看| 亚洲亚洲精品三区日韩精品在线视频| 99精品国产福利在线观看免费 | 亚洲成色777777女色窝| 亚洲国产精品一区| 亚洲精品视频一区| 中文有码久久| 午夜精品视频在线观看一区二区| 亚洲欧美日韩精品综合在线观看| 午夜精品久久久99热福利| 性色av一区二区三区| 久久精品免费观看| 久久资源av| 欧美国产精品久久| 亚洲精品国产精品国产自| 9i看片成人免费高清| 亚洲一级高清| 久久精品国产综合精品| 欧美暴力喷水在线| 欧美三级中文字幕在线观看| 国产精品嫩草影院av蜜臀| 国产亚洲视频在线| 亚洲经典一区| 亚洲在线一区二区三区| 久久久国产午夜精品| 亚洲电影免费观看高清完整版在线| 亚洲精品久久久一区二区三区| 亚洲午夜久久久久久久久电影院 | 欧美尤物巨大精品爽| 免费成人高清| 国产精品日韩欧美综合| 一区在线电影| 亚洲男人的天堂在线观看| 久久人人爽人人爽爽久久| 亚洲国产另类精品专区| 亚洲免费在线观看视频| 久久在精品线影院精品国产| 欧美色播在线播放| 在线观看成人小视频| 亚洲字幕一区二区| 欧美成人精品高清在线播放| 99在线观看免费视频精品观看| 欧美一级一区| 欧美午夜精品久久久久久人妖| 激情国产一区| 午夜精品久久久| 亚洲欧洲综合另类| 久久精品一区二区国产| 国产精品久久久久久妇女6080| 亚洲电影免费在线 | 一本色道久久综合亚洲精品不卡 | 久久久久这里只有精品| 一区二区三区 在线观看视频| 免费成人高清| 狠狠色综合色区| 久久精品视频在线观看| 一区二区三区精品| 欧美日韩国产综合网|