Posts Tagged ‘programming’
星期日, 10月 19th, 2008
Displaying graphics in Symbian exe programs.
Generally, exe programs are used to implement servers (exedll, epocexe target type) or
simple console programs. This may lead to believe that graphical features are not available
for exe programs. This is not the case, and even though it might take some extra work to
set up an appropriate environment, this is quite straight forward to achieve, as the
following snippet will illustrate. This way, we can make use of graphics without having to
resort on a full blown application.
(more…)
Tags: exe, graphics, nokia, programming, symbian
Posted in World | No Comments »
星期日, 10月 19th, 2008
Displaying controls in Symbian exe programs
From Forum Nokia Wiki
If we now wanted to create and display a CCoeControl, we’d need to have a CONE environment (CCoeEnv) as a minimum, as this class is used internally by the control. This makes things easier, given that CCoeEnv, as its name implies, creates a whole environment for us, thus limiting our task to the proper control creation:
(more...)
Tags: exe, nokia, programming, symbian
Posted in Codes, Favorite, Goodarticle, Works | No Comments »
星期日, 8月 26th, 2007
一、其它数据类型转换为字符串
- 短整型(int) itoa(i,temp,10);///将i转换为字符串放入temp中,最后一个数字表示十进制 itoa(i,temp,2); ///按二进制方式转换
- 长整型(long) ltoa(l,temp,10);
- 浮点数(float,double) 用fcvt可以完成转换,这是MSDN中的例子: int decimal, sign; char *buffer; double source = 3.1415926535; buffer = _fcvt( source, 7, &decimal, &sign ); 运行结果:source: 3.1415926535 buffer: ‘31415927′ decimal: 1 sign: 0 decimal表示小数点的位置,sign表示符号:0为正数,1为负数
- CString变量 str = "2008北京奥运"; buf = (LPSTR)(LPCTSTR)str;
- BSTR变量 BSTR bstrValue = ::SysAllocString(L"程序员"); char * buf = _com_util::ConvertBSTRToString(bstrValue); SysFreeString(bstrValue); AfxMessageBox(buf); delete(buf);
- CComBSTR变量 CComBSTR bstrVar("test"); char *buf = _com_util::ConvertBSTRToString(bstrVar.m_str); AfxMessageBox(buf); delete(buf);
- _bstr_t变量 _bstr_t类型是对BSTR的封装,因为已经重载了=操作符,所以很容易使用 _bstr_t bstrVar("test"); const char *buf = bstrVar;///不要修改buf中的内容 AfxMessageBox(buf);
- 通用方法(针对非COM数据类型) 用sprintf完成转换
-
- char buffer[200];
- char c = '1';
- int i = 35;
- long j = 1000;
- float f = 1.7320534f;
- sprintf( buffer, "%c",c);
- sprintf( buffer, "%d",i);
- sprintf( buffer, "%d",j);
- sprintf( buffer, "%f",f);
(more…)
Tags: cpp, Favorite, Goodarticle, programming, vc
Posted in Favorite, Goodarticle | No Comments »
星期四, 8月 16th, 2007
关于链接库。大概的使用应该就这些吧。呵呵。
(more…)
Tags: Codes, cpp, mfc, programming, sdk, vc, Works
Posted in Codes, Works | No Comments »