随笔-76  评论-0  文章-0  trackbacks-0
 
1.修改春燕提到得日志问题。
2.修改fsp种子添加文件的问题。
3.完善upnp。
posted @ 2009-10-14 17:52 Mitnick 阅读(58) | 评论 (0)编辑 收藏

上午看代码,下午学会了想工程中添加图标,再下午修正了不能正确显示网络探测类型的bug,再晚稍微学会了td的使用。

posted @ 2009-10-13 19:11 Mitnick 阅读(65) | 评论 (0)编辑 收藏
今天主要在rpc接口文件中添加了dump日志的功能。
posted @ 2009-10-12 16:39 Mitnick 阅读(55) | 评论 (0)编辑 收藏

今天上午用静态的方法添加了upnp的dll。
中午的时候一直在测试注销和关机是底层收到的消息问题(这个以后要自己搞清楚)。
下午完善了upnp的接口还要测试播放时注销的情况。

posted @ 2009-10-10 18:17 Mitnick 阅读(78) | 评论 (0)编辑 收藏
今天把底层自己的显示工程完成了,得到以下收获。
1.release版本在优化的过程中将变量bBack优化到寄存器里面,所以它始终是false导致跳不出循环。 而在bBack声明的时候加上volatile就可以在使用它的时候从内存中取出,然后放到寄存器里面,这样就可以循环中改变它的值,从而跳出循环。
posted @ 2009-10-09 18:16 Mitnick 阅读(51) | 评论 (0)编辑 收藏
今天主要在修改自己的程序,明天就国庆了,没有啥心情写了,呵呵。
祝福祖国,让我早点开上Jeep~
posted @ 2009-09-30 15:12 Mitnick 阅读(55) | 评论 (0)编辑 收藏

今天成功用MFC写完了显示任务信息的部分。对CListBox有了深一步的了解,对MFC的消息映射有了了解。
on_message(wm_xxx,onfunc) 宏 只能响应自己定义的消息,如果是系统消息,直接重载就可以。

posted @ 2009-09-29 18:08 Mitnick 阅读(50) | 评论 (0)编辑 收藏
今天一直在用MFC写FspService自己的测试程序,学会了ListControl控件的应用。
posted @ 2009-09-28 18:22 Mitnick 阅读(174) | 评论 (0)编辑 收藏

1. char* to string
string s(char *); 
注:在不是初始化的地方最好用assign().
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2. string to const char*
string a="strte";
const char* r=a.c_str();
注意是const的。还要转到char*:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2.2. const char* to char*
const char* r="123";
char   *p1   =   new   char[strlen(r)+1];
strcpy(p1,r);
附:http://hi.baidu.com/cfans/blog/item/06970ef4b671f366dcc4745d.html
 这个页面是具体讲述区别的。
·············································································································
3. cstring to string
vs2005 Unicode下:
  CStringW   str(L"test");  
  CStringA   stra(str.GetBuffer(0));  
  str.ReleaseBuffer();      
  std::string   strs   (stra.GetBuffer(0));  
  stra.ReleaseBuffer();

非Unicode下:
CString cs("test");
std::string str=cs.getBuffer(0);
cs.ReleaseBuffer();

注:GetBuffer()后一定要ReleaseBuffer(),否则就没有释放缓冲区所占的空间.
++++++++++++++++++++++++++++++++++++++++++++++++++++
4. double ,int to string
#include <sstream>
using namespace std;

stringstream ss;
string result;
long n=11111;
stream << n; //从long型数据输入
stream >>result; //转换为 string


===================================================

5.char*  to int, double ,long

char *s; double x; int i; long l;

s = " -2309.12E-15"; /* Test of atof */
x = atof( s );
printf( "atof test: ASCII string: %s\tfloat: %e\n", s, x );

s = "7.8912654773d210"; /* Test of atof */
x = atof( s );
printf( "atof test: ASCII string: %s\tfloat: %e\n", s, x );

s = " -9885 pigs"; /* Test of atoi */
i = atoi( s );
printf( "atoi test: ASCII string: %s\t\tinteger: %d\n", s, i );

s = "98854 dollars"; /* Test of atol */
l = atol( s );
printf( "atol test: ASCII string: %s\t\tlong: %ld\n", s, l );
------------------------------------------------------------------------------------------------
6. string to int ,long ,double            
              int s;
 string str="123";
 stringstream ss;
 ss<<str;//从str输入
 ss>>s;//输出到int
 ss.clear();


——————————————————————————————————————————
7. date to string
#include <time>
using namespace std;

char dateStr [9];
char timeStr [9];
 _strdate( dateStr);
printf( "The current date is %s \n", dateStr);
_strtime( timeStr );
printf( "The current time is %s \n", timeStr);

--------实践证明是正确的版本--------------------------------------------------------------
#include <iostream>
#include <ctime>
#include <cerrno>
 
int main()
{
     //Find the current time
     time_t curtime = time(0);
     
      //convert it to tm
      tm now=*localtime(&curtime);
    
     //BUFSIZ is standard macro that expands to a integer constant expression
     //that is greater then or equal to 256. It is the size of the stream buffer
     //used by setbuf()
     char dest[BUFSIZ]={0};
    
     //Format string determines the conversion specification's behaviour
     const char format[]="%A, %B %d %Y. The time is %X";
    
     //strftime - converts date and time to a string
     if (strftime(dest, sizeof(dest)-1, format, &now)>0)
       std::cout<<dest<<std::endl;
     else
       std::cerr<<"strftime failed. Errno code: "<<errno<<std::endl;
}

|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
8.string to cstring

+++++++++++++++++++++++++++++++++++++++++++++++++++++
非Unicode下:
int 转 CString:
CString.Format("%d",int);
...............................
string 转 CString 
CString.format("%s", string.c_str()); 
用c_str()确实比data()要好. 
.......................................
char* 转 CString 
CString.format("%s", char*); 
 CString strtest; 
 char * charpoint; 
 charpoint="give string a value"; 
 strtest=charpoint; //直接付值
.....................................................
CString 转 int
 CString  ss="1212.12"; 
 int temp=atoi(ss); //atoi _atoi64或atol
...................................................................................................................................
9.在Unicode下的CString to double
CSting sTemp("123.567");
double dTemp = _wtof(sTemp.GetString());

 

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/susaijie/archive/2009/04/10/4063495.aspx

posted @ 2009-09-28 08:46 Mitnick 阅读(2622) | 评论 (0)编辑 收藏
今天主要写了接到几个任务:
1.常驻退出:需要通知UI,并且捕获系统注销或者关机消息。
2.非常驻退出:UI通知底层自己退出,底层也要退出。
3.全面测试各种功能,在交付给测试之前。
4.仔细读需求文档与拉起文档。
posted @ 2009-09-25 18:07 Mitnick 阅读(70) | 评论 (0)编辑 收藏
仅列出标题
共8页: 1 2 3 4 5 6 7 8