易截截图软件、单文件、免安装、纯绿色、仅160KB

宽字符支持(linux,MinGW,Qt)


1。要使用宽字符支持,使用w开头的一系列东西,如wstring,wofstream等。在使用wstring的时候,常量字符串前面要加上L,这样才能转换成wchar_t型的
else if(fileName.substr(fileName.rfind(L"."))==L".prj")
2。一个文件流(无论是ofstream还是wofstream),只支持const char*作为文件名,对于宽字符的wstring的文件名,该做一些处理。
 DTchar mbsFileName[512];
 DTint mbsSize=std::wcstombs(mbsFileName,m_dumpFileName.c_str(),m_dumpFileName.size()*sizeof(wchar_t));
 mbsFileName[mbsSize]=0;
 m_pDumpStream=new std::fstream(mbsFileName,std::ios::out|std::ios::binary);
上面的代码要注意的是,wcstombs转换后的char序列并没有0字符串结尾符,所以拿出去直接当字符串使用会出错。
或者“You can use wcstombs() to narrow the filename or if you're feeling adventurous, the narrow() member function of the ctype facet of a std::locale.”
见http://www.gamedev.net/community/forums/topic.asp?topic_id=358254&whichpage=1?
3。MinGW不支持wchar_t,好像是因为linux下的wchar_t是4字节的,而windows下vc运行时的wchar_t是2字节的。
见Qt中qstring.cpp中的一段doxygen注释
#ifndef QT_NO_STL
/*! fn QString QString::fromStdWString(const std::wstring &str)
    Returns a copy of a str. a str is assumed to be encoded in
    utf16 if the size of wchar_t is 2 bytes (e.g. on windows) and ucs4
    if the size of wchar_t is 4 bytes (most Unix systems).
    This constructor is only available if Qt is configured with STL
    compabitility enabled.
    sa fromUtf16(), fromLatin1(), fromLocal8Bit(), fromUtf8()
*/
见MinGW的官方声明:http://www.mingw.org/MinGWiki/index.php/wide%20characters
其中还有2个连接。
另外:一个hp的家伙hack的方法:
http://lists.zerezo.com/mingw-users/msg00753.html
很复杂,我又不懂,唉。。。。绝望。
在linux下的支持宽字符的,没法在windows下移植了。。。。。。。。。。
4.MinGW下的Qt是支持宽字符的,我还测试了一下,如果文件路径中含有“桌面”二字,我的非宽字符支持的程序会r


相关文档:

linux sock_raw原始套接字编程

from:http://blog.chinaunix.net/u2/62281/showart_1096746.html
sock_raw原始套接字编程可以接收到本机网卡上的数据帧或者数据包,对与监听网络的流量和分析是很有作用的.一共可以有3种方式创建这种socket
 
1.socket(AF_INET, SOCK_RAW, IPPROTO_TCP|IPPROTO_UDP|IPPROTO_ICMP)发送接收ip数据包
2.socket(PF_PACK ......

从硬盘启动linux系统

 -------------------------------------------------------------------------------------------------------
//By:yuyongbao
//QQ:673360056
//平台powerpc mpc8379e linux 2.6.22
1、先用fdisk 给硬盘分一个区,用作文件系统。参照u-boot-ppc编译说明一文。
2、用mke2fs格式化硬盘的一个分区mke2fs /dev/sd ......

Linux执行以及虚拟内存之用

Linux Execution and Virtual Memory Utilization 
Linux执行以及虚拟内存之用
When Linux boots, it starts with the MMU disabled, so initially it deals only with physical 
memory. The kernel image is copied to physical address 0x8000 in DRAM and executed. First a master page table is created ......

Linux 无线网络技术: WLAN

当今,不考虑 Linux 和无线网络技术的话,就无法谈到计算机和网络。在这篇文章中,Sreekrishnan Venkateswaran 用
Linux 观点阐释了通过 WLAN、Bluetooth、GPRS、GSM 以及 IrDA
实现无线联网。他使用各种不同的无线设备和相应的内核层,以及用户空间工具来示范它们在 Linux 下如何工作。
无线技术,例如
WLAN (Wireles ......

linux 硬链接 软链接

linux中关于链接类型分为硬链接和软链接
  硬链接指令 ln  文件  链接名称
  软链接指令 ln -s 文件  链接名称
共同点:
  都可以通过链接名称去访问被链接的文件
不同点:
  硬链接会产生一个和源文件相同的文件 不论大小和属性
  删除源文件不会对链接文件产生影响
&nbs ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号