首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
代码贴wp231957的代码贴全部
#include <string.h>
#include <stdio.h>
#include <Windows.h>
#include <string.h>
#include "StdAfx.h"
#define days1800  341
int nongli[]=
{
    /*************************************** 
    * 农历1800-2100年大月小月与闰月 * 
    * (连同111个闰月在内共3723个月) * 
    * 公元1800-01-01为腊月(大)初七 * 
......................
阅读全部 | 2013年1月11日 16:03
#include <string.h>
#include <stdio.h>
#include <Windows.h>
#include <string.h>
#include "StdAfx.h"
#define days1800  341
int nongli[]=
{
    /*************************************** 
    * 农历1800-2100年大月小月与闰月 * 
    * (连同111个闰月在内共3723个月) * 
    * 公元1800-01-01为腊月(大)初七 * 
......................
阅读全部 | 2013年1月11日 10:06
#include <string.h>
#include <stdio.h>
#include <Windows.h>
#include <string.h>
int nongli[]=
{
    /*************************************** 
    * 农历1800-2100年大月小月与闰月 * 
    * (连同111个闰月在内共3723个月) * 
    * 公元1800-01-01为腊月(大)初七 * 
    * 公元1800-01-25为农历正月初一 * 
    ***************************************/ 
......................
阅读全部 | 2013年1月10日 23:05
#include <string.h>
#include <stdio.h>
#include <Windows.h>
#include <string.h>
#define leap(y) (y%4==0&&y%100||y%400==0) 

char days[]={0,31,28,31,30,31,30,31,31,30,31,30,31}; 
char *xq[]={"日","一","二","三","四","五","六", "七","八","九","十","冬","腊" }; 

struct date{ int year,month,day; };
typedef struct 

......................
阅读全部 | 2013年1月10日 16:27
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* 
 公历日期与农历日期的相互转换程序  
 【极限范围】1800-1-25~2101-1-28  
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 
#include<stdio.h> 
#include<string.h> 
#define leap(y) (y%4==0&&y%100||y%400==0) 
char days[]={0,31,28,31,30,31,30,31,31,30,31,30,31}; 
char *xq[]={"日","一","二","三","四","五","六", 
 "七","八","九","十","冬","腊" }; 
struct date{ int year,month,day; } 
d1={ 1800,1,25 },/*阴历1800正月初一*/  
......................
阅读全部 | 2013年1月10日 15:48
void ClisttestDlg::OnBnClickedOk()
{
    // TODO: 在此添加控件通知处理程序代码
    //CDialogEx::OnOK();
    // TODO: 在此添加控件通知处理程序代码
    CFileDialog dlg(true);
    if (dlg.DoModal() == IDOK)
    {
        //this->MessageBox(L"选择的文件地址:" + dlg.GetPathName() + " | 选择的文件名:" + dlg.GetFileName() ,
        //    L"提示:",MB_OK);
    }
    else
......................
阅读全部 | 2013年1月9日 22:25
// listtestDlg.cpp : 实现文件
//

#include "stdafx.h"
#include "listtest.h"
#include "listtestDlg.h"
#include "afxdialogex.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

......................
阅读全部 | 2013年1月9日 14:37
// listtestDlg.cpp : 实现文件
//

#include "stdafx.h"
#include "listtest.h"
#include "listtestDlg.h"
#include "afxdialogex.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

......................
阅读全部 | 2013年1月9日 11:29
用fopen()函数来读写文件  很多使用过Turbo C的朋友喜欢用fopen()函数来读写文件,在Visual C++环境中您也可以使用fopen()来读写文件。而且您还可以使用Visual C++中的标准的打开文件对话框,这样可以使选取读写文件的路径更方便。具体的做法是这样的。

  首先您需要使用到MFC基本类库,在您原有的Visual C++中加上一个由CFileDialog类派生的新类,例如是CMyFileDialog,然后用这个新类定义一个对象,例如是:myDlg,使用这个对象的DoModal()方法,就可以呼出打开文件的对话框。这样,您只要把被选中的路径名及文件名传送给fopen()函数就可以打开读写这个文件了。

CMyFileDialog myDlg(true);
定义一个对话框对象
myDlg.DoModal();
呼出打开文件对话框
CString fileName;
定义一个Cstring类型的字符串来存储文件的路径及文件名
fileName=myDlg.GetPathName();
得到文件的路径及文件名
......................
阅读全部 | 2013年1月8日 14:38
1、string 转 CString       CString.format("%s", string.c_str());
2、char * 转 CString      CString.format("%s", char*);
3、char * 转 string    string s(char *);
、string 转 char *     char *p = string.c_str();
5、CString 转 string      string s(CString.GetBuffer(CString.GetLength()));
6、CString 转 char *       charpoint=strtest.GetBuffer(strtest.GetLength());      
   不建议用(LPCTSTR)进行强制类型转化,这样strtest大小发生变化时会出现错误。
7、CString 转 char[100]      
   char a[100];      CString str("aaaaaa");       strncpy(a,(LPCTSTR)str,sizeof(a));


BSTR:是一个OLECHAR*类型的Unicode字符串,是一个COM字符串,带长度前缀,与VB有关,没怎么用到过。
......................
阅读全部 | 2013年1月8日 14:08
上一页 6 7 8 9 10 11 12 13 14 15 下一页
wp231957