/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
公历日期与农历日期的相互转换程序
【极限范围】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正月初一*/
......................
阅读全部
|
wp231957
贴于 2013年1月10日 15:48
hide
bbsi
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
......................
阅读全部
|
wp231957
贴于 2013年1月9日 22:25
hide
bbsi
#include<stdio.h>
int main()
{
int a[]={1,2,3,4,5};
int *p=a;
printf("%d,%d,%d,%d,%d,%d,%d,%d\n",*p,*(++p),(*p)++,*p,*p--,--(*p),*p);
}
输出的结果为啥第一个是2
阅读全部
|
zyd550153
贴于 2013年1月9日 20:56
hide
bbsi
// listtestDlg.cpp : 实现文件
//
#include "stdafx.h"
#include "listtest.h"
#include "listtestDlg.h"
#include "afxdialogex.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
......................
阅读全部
|
wp231957
贴于 2013年1月9日 14:37
hide
bbsi
// listtestDlg.cpp : 实现文件
//
#include "stdafx.h"
#include "listtest.h"
#include "listtestDlg.h"
#include "afxdialogex.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
......................
阅读全部
|
wp231957
贴于 2013年1月9日 11:29
hide
bbsi
<?php
$ad[1]="http://www.19e8.com/"; //页面1
$ad[2]="http://www.google.com.hk/search?q=%E7%94%B5%E8%84%91%E7%BB%B4%E4%BF%AE%E5%86%9B%E5%9B%A2%E4%B8%BB%E6%9D%BF%E7%BB%B4%E4%BF%AE%E5%85%A8%E9%9B%86&hl=zh-CN&newwindow=1&safe=strict&tbo=d&ei=3u_HUK-vGoijiAexloDIBA&start=130&sa=N"; //页面2
$ad[3]="http://www.google.com.hk/search?hl=zh-CN&newwindow=1&safe=strict&tbo=d&q=%203d%20max%E7%B2%92%E5%AD%90%E6%B1%87%E8%81%9A"; //页面3
$ad[4]="http://www.google.com.hk/search?client=aff-360daohang&hl=zh-CN&ie=utf-8&newwindow=1&q=%E7%90%86%E5%8F%91%E5%85%A5%E9%97%A8%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%8B"; //页面4
$ad[5]="http://www.google.com.hk/search?q=%E5%AE%8C%E7%BE%8E%E5%8F%B6%E5%AD%90%E7%BC%96%E7%BB%87%E8%A7%86%E9%A2%91%E7%AC%AC%E4%BA%94%E5%8D%81%E5%85%AB%E9%9B%86&ie=UTF-8&oe=UTF-8&hl=zh-hans&client=safari&hl=zh-CN&sourceid=cndr"; //页面5
$ad[6]="http://www.google.com.hk/search?hl=zh-CN&newwindow=1&safe=strict&tbo=d&q=3dmax%E7%89%87%E5%A4%B4%E5%8A%A8%E7%94%BB%E6%95%99%E5%AD%A6&btnG=Google+%E6%90%9C%E7%B4%A2"; //页面6
$out=rand(1, 6);//随机取得这5个页面的一个,有几个就写几, 此例有5个页面,就写 5
header("location:$ad[$out]"); //在需要的地方调用本句,页面转向
?>
阅读全部
|
liliang456
贴于 2013年1月8日 14:51
hide
bbsi
用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();
得到文件的路径及文件名
......................
阅读全部
|
wp231957
贴于 2013年1月8日 14:38
hide
bbsi
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有关,没怎么用到过。
......................
阅读全部
|
wp231957
贴于 2013年1月8日 14:08
hide
bbsi
VS2010/MFC编程入门之二十九(常用控件:列表视图控件List Control 下)
来自:鸡啄米 | 时间:2012-07-04 20:35:57
原文链接: http://www.jizhuomi.com/software/197.html
相关主题: 11090039 11010015
上一节是关于 列表视图控件List Control的上半部分 ,简单介绍了列表视图控件,其通知消息的处理和有关结构体的定义。本节继续讲解下半部分,包括列表视图控件的创建、CListCtrl类的主要成员函数和CListCtrl类应用实例。
列表视图控件的创建
MFC 同样为列表视图控件的操作提供了CListCtrl类。
......................
阅读全部
|
wp231957
贴于 2013年1月8日 12:23
hide
bbsi
#include <stdio.h>
#include <afx.h>
#include <windows.h>
const WORD START_YEAR =1901;
const WORD END_YEAR =2050;
/******************************************************************************
下面为阴历计算所需的数据,为节省存储空间,所以采用下面比较变态的存储方法.
......................
阅读全部
|
wp231957
贴于 2013年1月6日 23:31
hide
bbsi