wxWidgets中的类型转换
来源:互联网 发布:淘宝 折扇 编辑:程序博客网 时间:2024/05/22 17:11
1int to wxString: wxString str = wxString::Format(wxT("%i"),myInt);
2wxString to int : int i; i = wxAtoi(str);
3 string to wxString: std::string stlString = "sdfas"; wxString mystr(stlString .c_str(),wxConvUTF8);
4 wxString to string:
wxString mystring(wxT("HelloWorld"));
std::string stlstring = std::string(mystring.mb_str());
5char* to wxString:
char* chars = "Hello world";
wxString mystring(chars, wxConvUTF8);
6 wxString to char*: char* cs = str.mb_str(wxConvUTF8);
7char[] to wxString:
char chars[34] = "sefasd";
wxstring mystring(chars, wxConvUTF8);
8wxString to char[]:
wxString mystring(wxT("HelloWorld"));
char cstring[1024];
strcpy(cstring, (const char*)mystring.mb_str(wxConvUTF8));
二、wxdatetime 与wxstring转换
2.1 wxdatetime to wxstring :
wxDateTime dt = CalendarCtrl1->GetDate();
wxString msg = dt.Format(wxT("%Y-%m-%d"),wxDateTime::A_EST);
2.2 wxstring to wxdatetime: char* ca = "2008-09-03";wxDateTime dt;dt.ParseDate(ca);
2wxString to int : int i; i = wxAtoi(str);
3 string to wxString: std::string stlString = "sdfas"; wxString mystr(stlString .c_str(),wxConvUTF8);
4 wxString to string:
wxString mystring(wxT("HelloWorld"));
std::string stlstring = std::string(mystring.mb_str());
5char* to wxString:
char* chars = "Hello world";
wxString mystring(chars, wxConvUTF8);
6 wxString to char*: char* cs = str.mb_str(wxConvUTF8);
7char[] to wxString:
char chars[34] = "sefasd";
wxstring mystring(chars, wxConvUTF8);
8wxString to char[]:
wxString mystring(wxT("HelloWorld"));
char cstring[1024];
strcpy(cstring, (const char*)mystring.mb_str(wxConvUTF8));
二、wxdatetime 与wxstring转换
2.1 wxdatetime to wxstring :
wxDateTime dt = CalendarCtrl1->GetDate();
wxString msg = dt.Format(wxT("%Y-%m-%d"),wxDateTime::A_EST);
2.2 wxstring to wxdatetime: char* ca = "2008-09-03";wxDateTime dt;dt.ParseDate(ca);
0 0
- wxWidgets中的类型转换
- wxWidgets中的常用类型转换
- wxWidgets 中类型转换
- wxwidgets-----wxstring与其他类型转换
- java中的类型转换
- java中的类型转换
- C#中的类型转换
- C#中的类型转换
- C#中的类型转换
- C#中的类型转换
- C#中的类型转换
- c#中的类型转换
- C#中的类型转换
- C#中的类型转换
- C#中的类型转换
- C# 中的类型转换
- C# 中的类型转换
- C# 中的类型转换
- Hibernate缓存
- C#泛型详解
- Head First设计模式C++实现--第三章:装饰者(Decorator)模式
- Expires / Cache-Control / Last-Modified / If-Modified-Since / ETag / If-None-Match 区别使用
- 由易到难学习递归的精华
- wxWidgets中的类型转换
- google code jam 2014 RC_B
- Myeclipse报错Errors running builder 'DeploymentBuilder' on project 'xxx'
- 请对输入的一组数据(0~9)进行排序,规则:数据出现次数多的,数字大的排在前面。
- 【学习OpenCV】OpenCV起步--下载离线文档
- is too old (format 29) to work with client version '1.8.9 (r1591380)' (expects format 31).
- Git历险记(五)
- ehcache缓存同步配置
- C++小知识:C++类中成员的访问控制属性有哪些类型,什么区别