`
dqifa
  • 浏览: 112241 次
社区版块
存档分类
最新评论
文章列表
需求: 1.可以支持中英文折行保存 2.输入字符串,可以对本字符串整理后返回整理后的字符串 3.可以指定每行的英文或数字字数。     我的实现函数如下: 我的代码实现: int CleanUpString(char* chCleanStr, int iLineLen) { //传入字符长度 int inputLen = strlen(chCleanStr); //没有内容不清理 if (inputLen == 0) { return -1; } //iLienLen小于等于0时 ...

vector内存释放

光clear是不释放内存的,将你这段代码修改了一下,你看看,应该能明白了,不明白运行一下就知道了。 int main() { vector<double>it; double a[100000]; for(int i=0; i<100000; i++) { a[i]=i; } cout << "未放元素时容器大小为: " << it.size() << "容器容量为: " << it.capacity() &l ...
1 vector 向量 相当于一个数组在内存中分配一块连续的内存空间进行存储。支持不指定vector大小的存储。STL内部实现时,首先分配一个非常大的内存空间预备进行存储,即 capacituy()函数返回的大小,当超过此分配的空间时再整 ...
作者: 阮一峰 日期: 2007年10月28日   今天中午,我突然想搞清楚Unicode和UTF-8之间的关系,于是就开始在网上查资料。 结果,这个问题比我想象的复杂,从午饭后一直看到晚上9点,才算初步搞清楚。 下面就是我的笔记,主要用来整理自己的思路。但是,我尽量试图写得通俗易懂,希望能对其他朋友有用。毕竟,字符编码是计算机技术的基石,想要熟练使用计算机,就必须懂得一点字符编码的知识。   1. ASCII码 我们知道,在计算机内部,所有的信息最终都表示为一个二进制的字符串。每一个二进制位(bit)有0和1两种状态,因此八个二进制位就可以组合出256种状态,这被称为一个字 ...
写在开始 不能用代码同时实现半透明和不规则形状的水印,只能选其一,有哪位高手指点一下不胜感激   此例中的半透明是在Fireworks中处理图片实现,不是用代码实现的   #include <wx/dcmemory.h> #include <wx/dcclient.h> #include <wx/dc.h> enum Alignment { aLeftTop=0, aLeftBottom=1, aRightTop=2, aRightBottom=3, aCenter=4 }; vo ...
=====文件名:DrawShape.h===== #ifndef __DRAWINGS_H_INCLUDED__ #define __DRAWINGS_H_INCLUDED__ #include <wx/dc.h> #include <wx/dcmemory.h> //------------------------------------------------------------------------------ wxColour ChangeBrightness(const wxColour &ar_col ...
    wxMathPlot wxMathPlot is a library to add 2D scientific plot functionality to wxWidgets. It allows to embed inside your program a window for plotting scientific, statistical or mathematical data, with additions like legend or coordinate display in overlay. wxMathPlot is distributed under th ...
1、从wxPrintout派生一个类Printout,类源码如下:   =====文件名:printout.h===== #ifndef PRINTOUT_H #define PRINTOUT_H #include <wx/wx.h> #include <wx/print.h> #include <wx/printdlg.h> #include "wxPrintMain.h" class wxPrintFrame; class Printout : public wxPrintout { ...
包含头文件: #include <wx/dir.h> #include <wx/dirdlg.h>    源码:   wxDirDialog dirDialog(this,wxT("Choose a folder")); if (dirDialog.ShowModal() != wxID_OK) { return; } size_t n = 0; wxArrayString files; wxString path = dirDialog.Ge ...

wxFileName

wxFileName wxFileName encapsulates a file name. This class serves two purposes: first, it provides the functions to split the file names into components and to recombine these components in the full file name which can then be passed to the OS file functions (and wxWidgets functions wrapping t ...
wxAutomationObject wordObject, documentObject; if ( wordObject.CreateInstance ( _T("Word.Application") ) ) { wxVariant openParams[2]; openParams[0] = rtfFile; openParams[1] = false; wordObject.CallMethod(_("documents.open"), 2, openParams); if (!word ...
最近在学习怎么用wxwidgets来操纵word,寻找之中发现MedeoSoftware,里面有很多wxwidgets的用法,不过我最关心的还是其中的dmxMSWordDocument,操作word的方法比较全,很值得学习。代码如下(并附上全部源码):     dmxMSWordDocument.h #ifndef _DMX_MSWORD_DOCUMENT_H_ #define _DMX_MSWORD_DOCUMENT_H_ #include "wxCommon.h" /////////////////////////////////////////// ...
Literals A literal is a string written in code with "quotes around it". A literal is not a wxString, and (in wxWidgets 2.8) will not be implicitly converted to one. This means that you can never pass in a raw literal into a wxWidget function or method (unless you don't care about your ...
写道 此文章不断更新中……   将汉字写入excel中时产生乱码,将wxWidgets更新为2.9.4版本后乱码消失。    #include <wx/msw/ole/automtn.h> wxAutomationObject excelObject, rangeObject; if (!excelObject.GetInstance(wxT("Excel.Application"))) { // Start Excel if it is not running if (!excelObject.CreateInstan ...
在VC中实现窗体的半透明很是酷毙,也想使用wxWidgets来实现这一效果,经过苦苦搜索始终没有找到解决办法,只好引入API了,经过一段时间的摸索终于搞出来了,感觉还不错,记录下来吧!   以下是需要添加的代码(详细代码见附件工程): 1、添加支持API的头文件   #include "windows.h"   2、实现透明效果的代码: HWND hwnd = (HWND)GetHandle(); HINSTANCE hInst = LoadLibrary(wxT("User32.DLL")); if(hInst) { ...
Global site tag (gtag.js) - Google Analytics