Chinaunix首页 | 论坛 | 博客
  • 博客访问: 838197
  • 博文数量: 158
  • 博客积分: 4380
  • 博客等级: 上校
  • 技术积分: 2367
  • 用 户 组: 普通用户
  • 注册时间: 2006-09-21 10:45
文章分类

全部博文(158)

文章存档

2012年(158)

我的朋友

分类: C/C++

2012-11-23 15:27:25

专门保存代码片断

阅读(8959) | 评论(66) | 转发(0) |
给主人留下些什么吧!~~

网友评论2012-11-23 15:33:47

周星星
#include <atlstr.h>
#include <atlcomcli.h>
#import <msxml4.dll>
//using namespace MSXML2;
// http://msdn.microsoft.com/en-us/library/ms765387(VS.85).aspx

struct ValidateXMLbyXSD_RETURN_INFO
{
    long errorCode;
    long line;
    long linepos;
    CString reas

网友评论2012-11-23 15:33:28

周星星
#include <stdio.h>
#include <io.h>
#include <string>
int foo( const char* command, std::string& out )
{
    FILE* fpipe = _popen( command, "r" );
    if( !fpipe )
        return false;

    int fd = _fileno( fpipe );

    //if( fstat(fd,&pipestat) != 0 ) return false;.
    char buf[1024]

网友评论2012-11-23 15:33:13

周星星


#include <iostream>
#include <string>
#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <shlobj.h>
//Import library shell32.lib
using namespace std;

static int CALLBACK BffCallBack( HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData )
{
    switch( uMsg )
    {
    case BFFM_INITIALIZED:
      &n

网友评论2012-11-23 15:32:56

周星星
#include <time.h>
#include <stdio.h>

void printtime( const struct tm* ptm )
{
    printf( "%04d年%02d月%02d日 %02d时%02d分%02d秒\n"
        , ptm->tm_year+1900, ptm->tm_mon+1, ptm->tm_mday
        , ptm->tm_hour, ptm->tm_min, ptm->tm_sec );
    printf( "本年第%03d天,星期%01d\n"
      

网友评论2012-11-23 15:32:41

周星星
struct NullType;
template <typename T0 = NullType, typename T1 = NullType, typename T2 = NullType,
          typename T3 = NullType, typename T4 = NullType, typename T5 = NullType>
struct typelist
{
    typedef T0 Head;
    typedef typelist<T1, T2, T3, T4, T5> Tail;
    enum { length = 1 + Tail::length };
};
template <>
struct typelist<