try it, then you know it____________just do it , as love easily fade.

一次只有一个目标,步子迈小些,抑制一次实现所有功能的冲动。 过程如何结果就如何,行动是欢喜的,不管是兴奋还是沮丧的情绪都对结果无益。贵在持之以恒

导航

随笔分类 -  VC++

1 2 下一页

WinExec
摘要:WinAPI: WinExec - 运行外部程序//声明WinExec( lpCmdLine: LPCSTR; {文件名和参数; 如没指定路径会按以下顺序查找: 程序目录/当前目录/System32/Windows/PATH环境变量} uCmdShow: UINT {启动选项}): UINT;//返回值:大于 31 {调用成功}等于 0 {内存不足}ERROR_FILE_NOT_FOUND = 2; {文件名错误}ERROR_PATH_NOT_FOUND = 3; {路径名错误}ERROR_BAD_FORMAT = 11; {EXE 文件无效}//... 阅读全文

posted @ 2013-12-27 17:43 吾一 阅读(1055) 评论(0) 推荐(0)

VC++ excel date handle
摘要:1,use a VARIANT type to read dates of the worksheet sheet1Range objRange;VARIANT vaRead;objRange = sheet1.GetUsedRange(); //get all dates in the tabl... 阅读全文

posted @ 2013-12-10 18:37 吾一 阅读(243) 评论(0) 推荐(0)

window date type
摘要:Most string operations can use the same logic forUnicodeand forWindows code pages. The only difference is that the basic unit of operation is a 16-bit character (also known as a wide character) for Unicode and an 8-bit character for Windows code pages. The Windows header files provide several type d 阅读全文

posted @ 2013-12-10 12:27 吾一 阅读(285) 评论(0) 推荐(0)

Variant OLE automation
摘要:TheVariantdata type is thedata typefor allvariables. can contain any kind of data except fixed-lengthStringdata.You can use theVariantdata type in pl... 阅读全文

posted @ 2013-12-07 16:43 吾一 阅读(303) 评论(0) 推荐(0)

VC++ chap13 文档与串行化
摘要:Lesson 13 文档与串行化13.1使用CArchive类对文件进行读写操作//让对象数据持久性的过程称之为串行化,或者序列化void CGraphicView::OnFileWrite(){ // TODO: Add your command handler code here CFile file("1.txt",CFile::modeCreate|CFile::modeWrite); //build CFile object CArchive ar(&file,CArchive::store); //build archive object int i=4 阅读全文

posted @ 2013-12-04 11:59 吾一 阅读(238) 评论(0) 推荐(0)

vc++ basic chapt1
摘要:______API 和SDK_像c程序可以调用各种函数库一样,windows操作系统提供应用程序编程的接口application programming interface简称API函数。所以主要的windows函数斗争windows.h头文件中进行了声明。_Windows操作系统提供了1000多种API函数,其拼写和语法可以在MSDN中查找。_Win32 SDK。 SDK全称software development kit,中文译名软件开发包。sdk是开发资源的一个集合。win32 SDK,即Windows32位平台下的软件开发包,包括了API函数、帮助文档、微软提供的一些辅助开发工具。__ 阅读全文

posted @ 2013-10-14 15:19 吾一 阅读(256) 评论(0) 推荐(0)

MFC 创建 excel 链接
摘要:http://support.microsoft.com/kb/178783 阅读全文

posted @ 2013-09-11 22:09 吾一 阅读(317) 评论(0) 推荐(0)

VC++ excel 2 operations
摘要:LPDISPATCH lpDisp; //lpdispatch,接口指针// 设置为FALSE时,加上app.Quit();// 否则EXCEL.EXE进程会一直存在,并且每操作一次就会多开一个进程app.SetVisible(TRUE);books.AttachDispatch(app.GetWorkbooks(),true);// 得到Worksheetssheets.AttachDispatch(book.GetWorksheets(),true);// 得到Worksheetsheet.AttachDispatch(sheets.GetItem(_variant_t((short)(1 阅读全文

posted @ 2013-09-11 15:50 吾一 阅读(299) 评论(0) 推荐(0)

VC++ operate excel
摘要:利用VC操作Excel的方法至少有两种1 .利用ODBC把Excel文件当成数据库文件,来进行读、写、修改等操作,网上有人编写了CSpreadSheet类,提供支持。2. 利用Automation(OLD Automation)方法。将Excel当成组件服务器,利用VBA。又分为基于MFC的和SDK两种。主要研究了一下第二种基于MFC的OLE编程方法。一、Excel的对象模型 在对Excel编程之前首先要了解微软Excel 对象(Object)模型。(Parent-Child关系) 图 1 Office 应用程序对象模型(Excel)From msdn其中: _application:代表.. 阅读全文

posted @ 2013-09-11 12:35 吾一 阅读(651) 评论(1) 推荐(0)

cursor
摘要:BeginWaitCursor(); // display the hourglass cursor // do some lengthy processing Sleep(3000); EndWaitCursor(); // remove the hourglass cursorstrangely: Note, in my vc++6.0, when only apply BeginWaitCursor() in a subroutine; useless, nothing change, 阅读全文

posted @ 2013-09-08 18:08 吾一 阅读(254) 评论(0) 推荐(0)

afx , afxMessageBox , MessageBox
摘要:afx开头的是全局函数,可以在任何地方使用MessageBox是CWnd的子函数,只能在CWnd窗口类对象里面用,AfxMessageBox的函数原型intAfxMessageBox( LPCTSTR lpszText, UINT nType = MB_OK, UINT nIDHelp = 0 );int AFXAPIAfxMessageBox( UINT nIDPrompt, UINT nType = MB_OK, UINT nIDHelp = (UINT) –1 );在第一种形式中,lpszText表示在消息框内部显示的文本,消息框的标题为应用程序的可执行文件名(如Hello)。在第二种形 阅读全文

posted @ 2013-09-07 22:54 吾一 阅读(611) 评论(0) 推荐(0)

VC++ chap12 file
摘要:file operation_______C语言对文件操作的支持fopenaccepts paths that are valid on the file system at the point of execution;____writeFILE *pFile = fopen("1,txt","w"); //firstly, file should be opened fwrite("a carrot",1,strlen("a carrot"),pFile); fseek(pFile,10,SEEK_END); 阅读全文

posted @ 2013-09-04 16:38 吾一 阅读(264) 评论(0) 推荐(0)

VC++ CEdit
摘要:CEDIT_1, //selectionpEdit1->SetSel(0,strBuffer-m_strInput,0);pEdit1->SetFocus(); //theselectedwillbehighlighted_2, //commentfilternstrBuffer=m_strInpu... 阅读全文

posted @ 2013-08-04 16:33 吾一 阅读(314) 评论(0) 推荐(0)

CString
摘要:______CString::Left.Return Value: ACStringobject containing a copy of the specified range of characters. Note that the returnedCStringobject may be empty.// example for CString::LeftCString s( _T("abcdef") );ASSERT( s.Left(2) == _T("ab") );//intGetLength()const;The count does not 阅读全文

posted @ 2013-07-29 22:44 吾一 阅读(318) 评论(0) 推荐(0)

VC++ chap19 动态链接库 VC++ 孙鑫
摘要:19.2win32DLL的创建和使用1.VC++新建Win32Dynamic-LinkLibrary类型的工程,选项anemptydllproject2,添加C++源文件Dll.cpp,编写代码,加法和减法19.2.1Dumpbin命令1,安装目录vc98\bin目录下,执行dumpbin命令。如无法执行,运行vcvars32.bat这个批处理文件,建立环境信息2,如果要查看一个DLL提供的导出函数,使用/exports选项来运行dumpbin命令。在DLL1.dll文件所在目录下,输入下述命令并回车Dumpbin-exportsdll1.dll19.2.2为了让dll导出一些函数,在需要被导 阅读全文

posted @ 2013-07-11 17:32 吾一 阅读(207) 评论(0) 推荐(0)

VC++ chap12 hook 和 数据库访问
摘要:Lesson20 hook和数据库访问20.1HOOK编程20.1.1基本知识1,将特殊消息屏蔽,安装一个HOOK过程,称为钩子过程。2,操作系统在传递消息时,将我们感兴趣的消息先传递给hook过程,在此函数中进行检查,然后决定是否放行该消息。3,安装钩子过程Setwindowshookex20.1.2进程内钩子1,安装鼠标钩子_1,定义相应的鼠标钩子过程LRESULTCALLBACKMouseProc(intnCode,//hookcodeWPARAMwParam,//messageidentifierLPARAMlParam//mousecoordinates){return1;}_2,在 阅读全文

posted @ 2013-07-11 17:30 吾一 阅读(190) 评论(0) 推荐(0)

doing VC++
摘要:1, when you met strange question , not knowing how it occure, delete the project and restart, because the compiler has problem, they just have problem... 阅读全文

posted @ 2013-07-10 14:03 吾一 阅读(181) 评论(0) 推荐(0)

转 vc调试技巧
摘要:VC调试技巧收集整理 调试是一个程序员最基本的技能,其重要性甚至超过学习一门语言。不会调试的程序员就意味着他即使会一门语言,却不能编制出任何好的软件。 这里我简要的根据自己的经验列出调试中比较常用的技巧,希望对大家有用。本文约定,在选择菜单时,通过/表示分级菜单,例如File/Open表示顶级菜单File的子菜单open。 1 设置 为了调试一个程序,首先必须使程序中包含调试信息。一般情况下,一个从AppWizard创建的工程中包含的Debug Configuration自动包含调试信息,但是是不是Debug版本并不是程序包含调试信息的决定因素,程序设计者可以在任意的Con... 阅读全文

posted @ 2013-07-09 17:37 吾一 阅读(610) 评论(0) 推荐(0)

vc++ 编译器工具
摘要:1,在命令行界面下 实现复制 和 粘贴选中数据后,按下回车键即可实现数据的复制功能,单击鼠标右键即可实现数据粘贴功能2,VC++ 建立一个C++工程win32 console application:1,选择建立一个程序。如果建立一个windows程序win32 application(1)Win32 Application就是普通的常见的窗口应用程序,当然有的界面做得比较个性化,比如圆形的、不规则形状的…它们都是所谓的GUI(Graphics User Interface图形用户接口),我们可以通过鼠标点击来完成控制。Win32 Application是为你开发windows应用程序所准备的 阅读全文

posted @ 2013-07-08 21:30 吾一 阅读(486) 评论(0) 推荐(0)

lesson 17 进程间通信 孙鑫 VC++
摘要:Lesson17进程间通信17.1剪贴板1,建立发送和接收对话框,用于拷贝和粘贴2,拷贝到剪贴板-1,打开剪贴板OpenClipboard();-2,清空剪贴板EmptyClipboard();-3,从堆上分配指定的字帖HGLOBALGlobalAlloc(UINTuFlags,SIZE_TdwBytes);-4,对全局内存加锁,然后返回该对象内存第一个字节的指针LPVOIDGlobalLock(HGLOBALhMem);-5,将数据拷贝到全部内存中Strcpy(pBuf,str);-6对该内存解锁LPVOIDGlobalLock(HGLOBALhMem);-7,向剪贴板中放置数据HANDLE 阅读全文

posted @ 2013-07-08 20:07 吾一 阅读(323) 评论(0) 推荐(0)

1 2 下一页