- 博客(86)
- 收藏
- 关注
原创 arx 常用操作
AcDbObjectId CArxProject1App::CreateLine(void){ AcGePoint3d ptStart(0, 0, 0); AcGePoint3d ptEnd(100, 100, 0); AcDbLine *pLine = new AcDbLine(ptStart, ptEnd); AcDbBlockTable *pBlockTable; acdbHostApplicationServices()->workingDatabas...
2022-05-10 14:12:38
950
原创 arx 对话框
void CArxDialog::OnBnClickedButton2(){ // TODO: 在此添加控件通知处理程序代码 AfxMessageBox(_T("2") ,0,0) ;}void CArxDialog::OnBnClickedButton4(){ // TODO: 在此添加控件通知处理程序代码 BeginEditorCommand(); ads_point pt ; if(acedGetPoint (NULL , _T("\...
2022-05-08 12:16:07
290
原创 vector 统计元素出现的次数
// Test.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include <iostream>#include <vector>#include <algorithm>using namespace std;void show (int p){ cout << p << endl;}int main...
2022-04-28 16:26:41
1146
原创 MFC CComboBox 使用例子
//手动设置显示高度(控件右侧小箭头) CComboBox* m_pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO1); CString str; for (int i = 0; i < 20; i++) { str.Format(_T("item string %d"), i); m_pComboBox->AddString(str); }...
2022-04-20 18:49:37
270
原创 链表内的数据操作算法
1. 先把链表中的数据放入一个按关键值取出,放入一个向量表,有重复的不加入2. 按向量表的关键值再依次对比计算出链表中的每个对应关键值的数量
2022-04-10 15:09:30
241
原创 CTypedPtrList 操作
double CTestView::GetVal(CString name){ double temp = -999999; // Dump the list elements to the debug window. POSITION pos = pSeriesList->GetHeadPosition(); for (int i = 0; i < pSeriesList->GetCount(); i++) { ...
2022-04-07 23:27:47
493
原创 ReadExcel
void COutToExcel::TestRead(){ //读入EXCEL CString sItem1, sItem2,sItem3, sItem4; CString sDriver; CString sDsn; CString sFile = _T( "./data/SeriesData.xls" ); // 将被读取的Excel文件名 // 检索是否安装有Excel驱动 "Microsoft Excel Driver (*.xls)"...
2022-04-07 00:44:27
786
原创 odbc 捕获异常
try { database.ExecuteSQL(_T( "DROP TABLE test " )); } catch (CDBException *pe) { // The error code is in pe->m_nRetCod...
2022-04-04 08:50:42
670
原创 MFC--文件对话框
BOOL CSeriesDataDlg::OnInitDialog(){ CDialog::OnInitDialog(); // TODO: Add extra initialization here DWORD dwExtStyles = m_ListCtrl.GetExtendedStyle(); m_ListCtrl.SetExtendedStyle(dwExtStyles | LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);...
2022-04-01 14:02:59
534
原创 固定玻璃输出到excel表中
//#include "Box.h"#include <afxtempl.h>typedef CTypedPtrList<CObList , CBox*> CBoxList;typedef CTypedPtrMap <CMapStringToPtr, CString, int*> CRecords;///////////////////////////////////////////////////////////////////////////// ..
2022-03-31 23:53:04
479
原创 OLE DB EXCEL
#include <afxdb.h>#include <odbcinst.h>void CTestExcelDlg::OnButton3(){ // TODO: Add your control notification handler code here //写入EXCEL CDatabase database; CString sDriver = _T( "MICROSOFT EXCEL DRIVER (*.XLS)" ...
2022-03-28 23:26:08
331
原创 List To BinarySearchTree
void CTestView::OnDraw(CDC* pDC){ CTestDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); // TODO: add draw code for native data here //EmptyAndSerializeToList(); if(pT) { if(pT->GetRoot()) { pT-> ...
2022-03-27 14:51:39
1200
原创 BinarySearchTree
#include "Box.h"#include <afxtempl.h>typedef CTypedPtrList<CObList , CBox*> CBoxList;typedef CTypedPtrMap <CMapStringToPtr, CString, int*> CRecords;struct BinarySearchTreeNode{ CBox * data ; BinarySearchTreeNode *leftC...
2022-03-27 14:43:25
886
原创 MFC-VIEW 缩放 平移
public: CPoint pt1; CPoint pt0; int sc;CTestDxfView::CTestDxfView(){ // TODO: add construction code here sc = 1;}void CTestDxfView::OnDraw(CDC* pDC){ CTestDxfDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); // TODO: ad...
2022-03-22 20:40:19
843
原创 CtypedPtrMap 例子
#include <afxtempl.h>typedef CTypedPtrMap <CMapStringToPtr, CString, int*> CRecords; CRecords m_Records; CString str = "abc"; int *pRecord = new int(47); m_Records.SetAt(str, pRecord); POSITION pos = m_Records.GetStar...
2022-03-19 08:49:56
537
原创 可串行化的类样式
#include "MyObject.h"#include <AFXTEMPL.H> typedef CTypedPtrList<CObList, CMyObject*> CMyList; CMyList ml;CTestDoc::~CTestDoc(){ while (!ml.IsEmpty()) { delete ml.GetHead(); ml.RemoveHead(); }}...
2022-03-13 12:31:05
590
原创 MFC 简单数据串行化
int X[8];BOOL CTestDoc::OnNewDocument(){ if (!CDocument::OnNewDocument()) return FALSE; // TODO: add reinitialization code here // (SDI documents will reuse this document) for(int i= 0 ; i<8 ; i++) { X[i] = -1;...
2022-03-13 09:29:30
207
原创 为链表的输入排序
DataInput dlg ; int num = 0 ; if(dlg.DoModal() == IDOK) num = dlg.m_Input ; //为用户的输入设置限制 if(num > 0) { //以下功能为链表的输入排序 CAge* a =new CAge(num); if(pListx->IsEmpty()) { ...
2022-03-12 16:29:18
173
原创 二叉树 串行化 Serialize(CArchive& ar)
void CTestDoc::Serialize(CArchive& ar){ T.Serialize(ar); if (ar.IsStoring()) { // TODO: add storing code here } else { // TODO: add loading code here }}void BinarySearchTree::Serialize(CArch...
2022-03-12 01:04:50
547
原创 利用兼容DC创建缩略图
void CTestView::OnDrawIcon(CDC *pDC){ CClientDC dc(this); CDC m_compatibleDc ; if (m_compatibleDc.CreateCompatibleDC(&dc)) //判断是否创建了兼容DC { CRect rect; GetClientRect(&rect); //获得客户区矩形的区域 CBit...
2022-03-12 00:45:43
414
原创 CListCtrl操作方法
/////////////////////////////////////////////////// m_ListCtrl.Create( WS_VISIBLE //| WS_TABSTOP | WS_CHILD //| WS_BORDER //| TVS_HASBUTTONS //| TVS_LINESATROOT /...
2022-03-08 23:52:42
270
原创 加载弹出式菜单
//加载菜单 CMenu menu; menu.LoadMenu(IDR_MENU1); // 读取资源 ClientToScreen(&point); menu.GetSubMenu(0) -> TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, this ); //先转换座标, 再赋值 ...
2022-03-04 06:48:35
162
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人