随笔-100  评论-20  文章-0  trackbacks-0
  2010年11月29日
代码
#ifndef  _GDI_PLUS_H
#define  _GDI_PLUS_H
#include 
<Gdiplus.h>
using namespace Gdiplus;
#pragma comment(lib,"Gdiplus.lib") 
#endif


//配置


 
0.
  GdiplusStartupInput    gdiInput;
  ULONG_PTR gdiToken;
 
 
1. GdiplusStartup(&gdiToken,&gdiInput,NULL);
 
 
2. cXXAPP::ExitInstance()
{
    GdiplusShutdown(gdiToken);
    
return CWinApp::ExitInstance();
}

 

posted @ 2010-11-29 20:22 hcmfys_lover 阅读(9) 评论(0) 编辑
代码
/*
* convert to wide string 
*/

wchar_t 
*ConvertWideChar(char *cstr)
{
    
int WLen = MultiByteToWideChar(CP_ACP, 0,cstr, -1,NULL,0);
    wchar_t 
* buffer = new wchar_t[WLen+1];
    
int RetWLen = MultiByteToWideChar(CP_ACP, 0,cstr,  -1,buffer,WLen);
    buffer[WLen] 
= '\0';
    
return buffer;
}

/*
* convert to mutibyte string 
*/
char *ConvertMutiString(wchar_t *buffer)
{
    
int MLen =WideCharToMultiByte(CP_ACP, 0,buffer, -1,NULL, 0, NULL, NULL);  
    
char* MultiBte = new char[MLen+1]; 
    
int RetMLen = WideCharToMultiByte( CP_ACP, 0,buffer,-1,MultiBte,MLen,NULL,NULL); 
    MultiBte[MLen]
='\0';
    
return MultiBte;
}

 

posted @ 2010-11-29 20:20 hcmfys_lover 阅读(49) 评论(0) 编辑