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

Benjamin

靜以修身,儉以養(yǎng)德,非澹薄無(wú)以明志,非寧?kù)o無(wú)以致遠(yuǎn)。
隨筆 - 398, 文章 - 0, 評(píng)論 - 196, 引用 - 0
數(shù)據(jù)加載中……

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

在平時(shí)的編程中字符串轉(zhuǎn)換經(jīng)常遇到,常用的是MultiByteToWideChar和WideCharToMultiByte,具體的函數(shù)如下:
/////////////////////////////////////////////////////////////////////////////
//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;
}
很少有人提及到下面的兩個(gè)函數(shù)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中,其實(shí)不然,還可以用在WM5.0和Wince平臺(tái);
用這兩個(gè)函數(shù)的好處就是一行代碼就可以完成轉(zhuǎn)換。要注意的是在用wcstombs函數(shù)時(shí)第三個(gè)參數(shù)必須是第二個(gè)參數(shù)長(zhǎng)度的兩倍,用mbstowcs是第三個(gè)參數(shù)是第二個(gè)參數(shù)的長(zhǎng)度,wcstombs可以完成WCHAR、TCHAR、CString向char*的轉(zhuǎn)換。
CString是MFC中的類,可以用WCHAR、TCHAR、cahr*直接初始化和賦值;值得一提的是在WM5.0、WCE平臺(tái)稍微有些和其他windows平臺(tái)不同的是,雖然函數(shù)傳參時(shí)無(wú)論WCHAR/TCHAR、char*都可以轉(zhuǎn)成CString作參數(shù)傳遞,因?yàn)楹瘮?shù)傳參實(shí)際是一個(gè)賦值的過(guò)程。但是在輸出到設(shè)備上時(shí),還必須用mbstowcs函數(shù)來(lái)轉(zhuǎn)換。
雖然Wce和Mobile平臺(tái)上只能用Unicode,但是讀寫文件時(shí)依然可以用標(biāo)準(zhǔn)C的文件操作函數(shù),但是讀寫文件時(shí)用的字符要一致。
關(guān)于VS2008平臺(tái)字符串轉(zhuǎn)換,請(qǐng)看http://msdn.microsoft.com/zh-cn/library/ms235631(VS.80).aspx

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

評(píng)論

# re: WCHAT、TCHAT、CString和char*的轉(zhuǎn)換(WM5.0)  回復(fù)  更多評(píng)論   

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*的轉(zhuǎn)換(WM5.0)  回復(fù)  更多評(píng)論   

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*的轉(zhuǎn)換(WM5.0)  回復(fù)  更多評(píng)論   

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  回復(fù)  更多評(píng)論   

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

# top seo firm  回復(fù)  更多評(píng)論   

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  回復(fù)  更多評(píng)論   

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  回復(fù)  更多評(píng)論   

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*的轉(zhuǎn)換(WM5.0)  回復(fù)  更多評(píng)論   

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

# re: WCHAT、TCHAT、CString和char*的轉(zhuǎn)換(WM5.0)  回復(fù)  更多評(píng)論   

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*的轉(zhuǎn)換(WM5.0)  回復(fù)  更多評(píng)論   

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*的轉(zhuǎn)換(WM5.0)  回復(fù)  更多評(píng)論   

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*的轉(zhuǎn)換(WM5.0)  回復(fù)  更多評(píng)論   

你寫的東西肯定是我有興趣英寸的方式提出你的立場(chǎng)是,產(chǎn)生少量無(wú)欽佩。出於這個(gè)原因,我選擇,讓你知道這些事情,因?yàn)槲矣X(jué)得你應(yīng)該知道。這是我在說(shuō)什麼。
2012-01-16 01:32 | Cell Phone Lookup

# re: WCHAT、TCHAT、CString和char*的轉(zhuǎn)換(WM5.0)  回復(fù)  更多評(píng)論   

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*的轉(zhuǎn)換(WM5.0)  回復(fù)  更多評(píng)論   

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*的轉(zhuǎn)換(WM5.0)  回復(fù)  更多評(píng)論   

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*的轉(zhuǎn)換(WM5.0)  回復(fù)  更多評(píng)論   

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*的轉(zhuǎn)換(WM5.0)  回復(fù)  更多評(píng)論   

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*的轉(zhuǎn)換(WM5.0)  回復(fù)  更多評(píng)論   

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*的轉(zhuǎn)換(WM5.0)  回復(fù)  更多評(píng)論   

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*的轉(zhuǎn)換(WM5.0)  回復(fù)  更多評(píng)論   

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*的轉(zhuǎn)換(WM5.0)  回復(fù)  更多評(píng)論   

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*的轉(zhuǎn)換(WM5.0)  回復(fù)  更多評(píng)論   

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*的轉(zhuǎn)換(WM5.0)  回復(fù)  更多評(píng)論   

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*的轉(zhuǎn)換(WM5.0)  回復(fù)  更多評(píng)論   

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*的轉(zhuǎn)換(WM5.0)  回復(fù)  更多評(píng)論   

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>
            欧美一二三区精品| 亚洲精品日韩精品| 亚洲欧美日韩国产成人精品影院| 欧美激情一区二区三区全黄| 亚洲黄色免费网站| 亚洲成色777777在线观看影院| 亚洲欧美日韩国产一区二区| 国产一区二区三区电影在线观看| 欧美在线免费视频| 久久国产一区二区| 亚洲久久一区| 在线视频一区观看| 国产综合视频在线观看| 亚洲第一精品久久忘忧草社区| 欧美高清视频在线播放| 中国成人黄色视屏| 欧美一区二区三区男人的天堂| 亚洲大片av| 亚洲调教视频在线观看| 黄色资源网久久资源365| 美女久久网站| 欧美色道久久88综合亚洲精品| 亚洲欧美文学| 久久久久久尹人网香蕉| 99精品久久久| 午夜在线视频观看日韩17c| 亚洲国产精品女人久久久| 99精品视频网| 精品不卡一区| 亚洲自拍啪啪| 亚洲精品久久久久久久久久久| 亚洲午夜一区二区| 亚洲国产精品传媒在线观看| 在线亚洲一区二区| 亚洲国产精品999| 亚洲一区日韩在线| 91久久视频| 久久视频在线视频| 欧美一级一区| 欧美精品在线免费| 欧美电影资源| 国产欧美亚洲视频| 日韩天堂在线观看| 亚洲高清av在线| 午夜精品视频在线观看| 99国产精品国产精品久久| 久久爱www| 欧美有码在线观看视频| 国产精品第一页第二页第三页| 欧美黄免费看| 狠狠干综合网| 欧美一区二区三区电影在线观看| 一区二区三区欧美在线| 欧美大片在线看免费观看| 久久女同互慰一区二区三区| 国产婷婷成人久久av免费高清| 中文av一区二区| 一区二区三区精品久久久| 欧美成人网在线| 欧美.日韩.国产.一区.二区| 国产一区二区三区在线免费观看| 亚洲香蕉成视频在线观看| 亚洲一二三区精品| 欧美日韩在线视频观看| 99在线观看免费视频精品观看| 亚洲人精品午夜| 欧美成ee人免费视频| 欧美激情五月| 亚洲国产精品一区二区尤物区| 久久久999精品视频| 久久亚洲欧美| 亚洲高清av在线| 蜜桃av久久久亚洲精品| 亚洲第一搞黄网站| 日韩亚洲欧美综合| 欧美日韩国产综合视频在线观看中文 | 亚洲精品一区二区三区在线观看 | 欧美日韩免费观看一区三区| 亚洲人人精品| 一区二区三区国产在线| 国产精品a久久久久久| 亚洲专区国产精品| 久久精品中文| 亚洲福利视频三区| 欧美日韩精品一本二本三本| 国产精品99久久久久久久久| 久久精品一区二区三区不卡牛牛 | 欧美日韩国产三级| 亚洲天堂第二页| 久久噜噜噜精品国产亚洲综合| 影音先锋另类| 欧美三日本三级少妇三2023| 亚洲午夜精品视频| 久久久综合香蕉尹人综合网| 亚洲韩国日本中文字幕| 亚洲高清视频在线| 正在播放欧美视频| 免费观看在线综合色| 国产伪娘ts一区| 欧美一区日本一区韩国一区| 亚洲国产精品一区| 欧美寡妇偷汉性猛交| 亚洲国产小视频在线观看| 久久久久久免费| 午夜国产欧美理论在线播放| 欧美性一区二区| 欧美一级片一区| 欧美一区二区高清| 狠狠入ady亚洲精品经典电影| 欧美在线国产| 久久久99精品免费观看不卡| 一区二区三区免费在线观看| 经典三级久久| 久久不见久久见免费视频1| 亚洲一区二区三区精品动漫| 在线免费观看日本一区| 欧美日韩国产一区二区三区地区 | 久久亚洲一区二区三区四区| 亚洲一卡久久| 亚洲国产欧美国产综合一区| 国产毛片精品视频| 欧美日韩亚洲91| 欧美.www| 久久婷婷久久| 欧美一区二区三区在线看 | 亚洲精品一品区二品区三品区| 久久久久久久久久看片| 午夜在线一区| 亚洲免费视频中文字幕| 91久久午夜| 在线观看一区| 激情久久综合| 韩国三级电影久久久久久| 国产精品久久午夜夜伦鲁鲁| 欧美日韩精品在线观看| 蜜桃久久av一区| 久久久久久夜精品精品免费| 欧美一区二区日韩一区二区| 亚洲欧美精品在线观看| 在线中文字幕日韩| 一区二区三区.www| 99热这里只有精品8| 亚洲精品中文字幕在线观看| 亚洲福利视频网站| 欧美激情久久久久| 亚洲高清不卡在线| 亚洲电影免费观看高清| 亚洲经典在线| 亚洲精品国偷自产在线99热| 亚洲精品久久久久久久久| 亚洲人成网在线播放| 欧美激情无毛| 99re视频这里只有精品| 一本到高清视频免费精品| 中文日韩在线视频| 亚洲欧美一区在线| 久久精品国产欧美激情| 另类春色校园亚洲| 欧美巨乳在线| 国产精品久久久久久久久免费桃花| 欧美香蕉大胸在线视频观看| 国产欧美一区视频| 激情一区二区三区| 日韩网站免费观看| 亚洲影院免费观看| 久久精品人人做人人爽电影蜜月| 久久久青草青青国产亚洲免观| 久久最新视频| 91久久极品少妇xxxxⅹ软件| 一本色道久久88综合亚洲精品ⅰ | 亚洲级视频在线观看免费1级| 一区二区三区日韩在线观看| 欧美一区二区免费| 欧美v日韩v国产v| 国产精品成人一区二区网站软件| 国产日韩欧美制服另类| 亚洲日韩欧美一区二区在线| 亚洲午夜久久久久久尤物| 久久精品一区二区三区不卡牛牛| 亚洲电影在线看| 亚洲综合电影| 欧美成人免费小视频| 国产欧美另类| 99亚洲一区二区| 久久国产精品亚洲va麻豆| 亚洲大片av| 欧美呦呦网站| 欧美日韩一区二区三区| 黄网站色欧美视频| 午夜精品一区二区三区在线播放| 欧美成人一区二区三区在线观看| 亚洲一区二区三区中文字幕| 免费在线看一区| 国产一区999| 亚洲欧美综合v| 91久久国产综合久久蜜月精品| 久久久久久久久久看片| 国产精品夜夜夜| 亚洲午夜国产一区99re久久| 亚洲电影自拍|