ProSolid下的遍历访问封装代码

  在ProE二次开发中,时常需要遍历ProSolid下的面、点、轴等几何元素。我们知道,ProToolkit下的遍历函数还是有点小麻烦的,而ProWebLink中就简单很多,比如要遍历某ProSolid下的所有Group,代码如下:

1 var  groupList = sld.ListGroups();
2 for (var i=0; i<groupList.Count; ++i)
3 {
4   ...
5 }

  那么,ProToolkit下是否可以封装类似的代码呢?当然可以。

  先贴一段我封装之后遍历访问ProSolid下所有Datum Point的代码:

 1     ProError err;
 2     ProMdl mdl_curr;
 3     err = ProMdlCurrentGet(&mdl_curr);
 4     
 5     try
 6     {
 7         // 利用当前Model构造CProSolid对象,并遍历访问其下的所有Datum Point
 8         CProSolid sld((ProSolid)mdl_curr);
 9         CProList<ProPoint> pntList = sld.ListPoints();
10         CString cstr;
11         cstr.Format(TEXT("%d"), pntList.size());
12         AfxMessageBox(cstr);
13 
14         // 对每个Datum Point执行操作
15         for (int i=0; i<pntList.size(); ++i)
16         {
17             ProPoint pnt = pntList[i];
18             int id;
19             err = ProPointIdGet(pnt, &id);
20             CString cstr;
21             cstr.Format(TEXT("Point Id: %d."), id);
22             AfxMessageBox(cstr);
23         }
24 
25     }
26     catch (exception& e)
27     {
28         AfxMessageBox(TEXT("exception."));
29     }

再贴上我封装的代码:

1、CProArray.h    在前一篇博文<<类似vector的ProArray封装类CProArray>>中已贴出。

2、CProList.h

View Code
  1 #ifndef _C_PRO_LIST_H_
  2 #define _C_PRO_LIST_H_
  3 
  4 #include <ProToolkit.h>
  5 #include "CProArray.h"
  6 #include <exception>
  7 #include <stdexcept>
  8 
  9 using std::exception;
 10 using std::out_of_range;
 11 using std::bad_alloc;
 12 
 13 template<class TYPE, size_t reallocationSize = 5>
 14 class CProList
 15 {
 16 public:
 17     CProList() 
 18         //throw(bad_alloc)
 19         : m_pArr(new CProArray<TYPE, reallocationSize>())
 20     {}
 21 
 22     CProList(const CProList& rhs)
 23         : m_pArr(rhs.m_pArr)
 24     {
 25         ++(m_pArr->use);
 26     }
 27 
 28     CProList& operator=(const CProList& rhs)
 29     {
 30         if (--(m_pArr->use) == 0)
 31             delete m_pArr;
 32         ++(rhs.m_pArr->use);
 33         m_pArr = rhs.m_pArr;
 34     }
 35 
 36     ~CProList()
 37     {
 38         if (--(m_pArr->use) == 0)
 39             delete m_pArr;
 40     }
 41 
 42 public:
 43     size_t size() const
 44     {
 45         return m_pArr->size();
 46     }
 47 
 48     bool is_empty() const
 49     {
 50         return m_pArr->is_empty();
 51     }
 52 
 53     void clear()
 54     {
 55         m_pArr->clear();
 56     }
 57 
 58     void push_back(const TYPE& val)
 59     {
 60         m_pArr->push_back(val);
 61     }
 62 
 63     void pop_back()
 64     {
 65         m_pArr->pop_back();
 66     }
 67 
 68     const TYPE& front() const 
 69         //throw(out_of_range)
 70     {
 71         try
 72         {
 73             return m_pArr->front();
 74         }
 75         catch (const out_of_range&)
 76         {
 77             throw out_of_range("empty CProList.");
 78         }
 79         catch (...)
 80         {
 81             throw;
 82         }
 83     }
 84 
 85     TYPE& front() 
 86         //throw(out_of_range)
 87     {
 88         return const_cast<TYPE&>(const_cast<const CProList*>(this)->front());
 89     }
 90 
 91     const TYPE& back() const 
 92         //throw(out_of_range)
 93     {
 94         try
 95         {
 96             return m_pArr->back();
 97         }
 98         catch (const out_of_range&)
 99         {
100             throw out_of_range("empty CProList.");
101         }
102         catch (...)
103         {
104             throw;
105         }
106     }
107 
108     TYPE& back() 
109         //throw(out_of_range)
110     {
111         return const_cast<TYPE&>(const_cast<const CProList*>(this)->back());
112     }
113 
114     const TYPE& operator[](size_t index) const 
115         //throw(out_of_range)
116     {
117         if (is_empty())
118             throw out_of_range("empty CProList.");
119         try
120         {
121             return m_pArr->operator[](index);
122         }
123         catch (const out_of_range&)
124         {
125             throw out_of_range("invalid index of CProList.");
126         }
127         catch (...)
128         {
129             throw;
130         }
131     }
132 
133     TYPE& operator[](size_t index)
134         //throw(out_of_range)
135     {
136         return const_cast<TYPE&>(const_cast<const CProList*>(this)->operator[](index));
137     }
138 
139     const TYPE& at(size_t index) const 
140         //throw(out_of_range)
141     {
142         if (is_empty())
143             throw out_of_range("empty CProList.");
144         try
145         {
146             return m_pArr->at(index);
147         }
148         catch (const out_of_range&)
149         {
150             throw out_of_range("invalid index of CProList.");
151         }
152         catch (...)
153         {
154             throw;
155         }
156     }
157 
158     TYPE& at(size_t index) 
159         //throw(out_of_range)
160     {
161         return const_cast<TYPE&>(const_cast<const CProList*>(this)->at(index));
162     }
163 
164     void insert_at(size_t index, const TYPE& val) 
165         //throw(out_of_range, bad_alloc)
166     {
167         if (size() < index)
168             throw out_of_range("invalid index of CProList.");
169 
170         m_pArr->insert_at(index, val);
171     }
172 
173     void insert_at(size_t index, size_t cnt, const TYPE *pVal) 
174         //throw(out_of_range, bad_alloc)
175     {
176         if (size() < index)
177             throw out_of_range("invalid index of CProList.");
178 
179         m_pArr->insert_at(index, cnt, pVal);
180     }
181 
182     void remove_at(size_t index, size_t cnt = 1) 
183         //throw(out_of_range)
184     {
185         if (size() <= index)
186             throw out_of_range("invalid index of CProList.");
187         if (size() - index < cnt)
188             throw out_of_range("count to remove is out of range");
189 
190         m_pArr->remove_at(index, cnt);
191     }
192 
193     operator ProArray() const
194     {
195         return m_pArr->operator ProArray();
196     }
197 
198 private:
199     CProArray<TYPE, reallocationSize> *m_pArr;
200 };
201 
202 #endif

3、CProSolid.h

View Code
  1 #ifndef _C_PRO_SOLID_H_
  2 #define _C_PRO_SOLID_H_
  3 
  4 #include <ProToolkit.h>
  5 #include <ProSolid.h>
  6 #include <ProCsys.h>
  7 #include <ProSurface.h>
  8 #include <ProAxis.h>
  9 #include <ProPoint.h>
 10 #include <ProQuilt.h>
 11 #include <ProFeature.h>
 12 #include <profeattype.h>
 13 #include "CProList.h"
 14 #include <exception>
 15 
 16 ProError _VisitSolidAllCsyses_(ProCsys  p_csys,
 17                                ProAppData app_data);
 18 
 19 ProError _VisitSolidAllSurfs_(ProSurface p_surface,
 20                               ProAppData app_data);
 21 
 22 ProError _VisitSolidAllAxises_(ProAxis  p_axis,
 23                                ProAppData app_data);
 24 
 25 ProError _VisitSolidAllQuilts_(ProQuilt p_quilt,
 26                                ProAppData app_data);
 27 
 28 ProError _VisitSolidAllFeats_(ProFeature* p_feature,
 29                               ProAppData app_data);
 30 
 31 ProError _VisitFeatAllPoints_(ProGeomitem *p_handle,
 32                               ProAppData  app_data);
 33 
 34 ProError _VisitQuiltAllSurfaces_(ProSurface surface,
 35                                  ProAppData app_data);
 36 
 37 ProError _VisitSolidAllDatumPlaneFeats_(ProFeature* p_feature,
 38                                         ProAppData app_data);
 39 
 40 class CProSolid
 41 {
 42 public:
 43     explicit CProSolid(ProSolid sld) : m_sld(sld) {}
 44 
 45     //
 46     // 列出所有的坐标系
 47     // 
 48     CProList<ProCsys> ListCsyses()
 49     {
 50         ProError err;
 51         CProList<ProCsys> csysList;
 52         err = ProSolidCsysVisit(m_sld, NULL, _VisitSolidAllCsyses_, &csysList);
 53         if (err != PRO_TK_NO_ERROR 
 54             && err != PRO_TK_E_NOT_FOUND)
 55             throw exception("ListCsyses() failed.");
 56 
 57         return csysList;
 58     }
 59 
 60     //
 61     // 列出所有的soild surface
 62     //
 63     CProList<ProSurface> ListSurfaces()
 64     {
 65         ProError err;
 66         CProList<ProSurface> surfList;
 67         err = ProSolidSurfaceVisit(m_sld, NULL, _VisitSolidAllSurfs_, &surfList);
 68         if (err != PRO_TK_NO_ERROR
 69             && err != PRO_TK_E_NOT_FOUND)
 70             throw exception("ListSurfaces failed.");
 71 
 72         return surfList;
 73     }
 74 
 75     //
 76     // 列出所有的datum surface
 77     //
 78     CProList<ProSurface> ListDatumSurfaces()
 79     {
 80         ProError err;
 81         CProList<ProSurface> datumSurfList;
 82 
 83         // get all quilts
 84         CProList<ProQuilt> quiltList;
 85         err = ProSolidQuiltVisit(m_sld, NULL, _VisitSolidAllQuilts_, &quiltList);
 86         if (err != PRO_TK_NO_ERROR
 87             && err != PRO_TK_E_NOT_FOUND)
 88             throw exception("ListDatumSurfaces failed.");
 89 
 90         // get all datum surfaces in every quilt
 91         for (int i=0; i<quiltList.size(); ++i)
 92         {
 93             err = ProQuiltSurfaceVisit(quiltList[i], NULL, 
 94                 _VisitQuiltAllSurfaces_, &datumSurfList);
 95             if (err != PRO_TK_NO_ERROR
 96                 && err != PRO_TK_E_NOT_FOUND)
 97                 throw exception("ListDatumSurfaces failed.");
 98         }
 99 
100         return datumSurfList;
101     }
102 
103     //
104     // 列出所有的datum plane
105     //
106     CProList<ProSurface> ListDatumPlanes()
107     {
108         ProError err;
109         CProList<ProSurface> datumPlaneList;
110     
111         // get all feats which feat type is PRO_FEAT_DATUM
112         CProList<ProFeature> datumPlaneFeatList;
113         err = ProSolidFeatVisit(m_sld, NULL, _VisitSolidAllDatumPlaneFeats_, &datumPlaneFeatList);
114         if (err != PRO_TK_NO_ERROR
115             && err != PRO_TK_E_NOT_FOUND)
116             throw exception("ListDatumPlanes failed.");
117 
118         // get datum plane in every datum plane feat
119         // but exclude which is inactive
120         for (int i=0; i<datumPlaneFeatList.size(); ++i)
121         {
122             ProSurface datumPlane;
123             err = ProSurfaceInit(datumPlaneFeatList[i].owner, datumPlaneFeatList[i].id+1, 
124                 &datumPlane);
125             ProGeomitem surf_geom_item;
126             err = ProSurfaceToGeomitem(m_sld, datumPlane, &surf_geom_item);
127             ProBoolean bIsInActive;
128             err = ProGeomitemIsInactive(&surf_geom_item, &bIsInActive);
129 
130             if (bIsInActive == PRO_B_FALSE)
131                 datumPlaneList.push_back(datumPlane);
132         }
133 
134         return datumPlaneList;
135     }
136 
137     //
138     // 列出所有的轴
139     //
140     CProList<ProAxis> ListAxises()
141     {
142         ProError err;
143         CProList<ProAxis> axisList;
144         err = ProSolidAxisVisit(m_sld, NULL, _VisitSolidAllAxises_, &axisList);
145         if (err != PRO_TK_NO_ERROR
146             && err != PRO_TK_E_NOT_FOUND)
147             throw exception("ListAxises failed.");
148 
149         return axisList;
150     }
151 
152     //
153     // 列出所有的Datum Points
154     // Note: 不包含Inactive的Datum Point
155     //
156     CProList<ProPoint> ListPoints()
157     {
158         ProError err;
159         CProList<ProPoint> pntList;
160 
161         // get all feats
162         CProList<ProFeature> featList;
163         err = ProSolidFeatVisit(m_sld, NULL, _VisitSolidAllFeats_, &featList);
164         if (err != PRO_TK_NO_ERROR
165             && err != PRO_TK_E_NOT_FOUND)
166             throw exception("ListPoints failed.");
167 
168         // get all points in every feat but exclude which is inactive
169         for (int i=0; i<featList.size(); ++i)
170         {
171             CProList<ProGeomitem> pntGeomitemList;
172             err = ProFeatureGeomitemVisit(&featList[i], PRO_POINT, NULL, 
173                 _VisitFeatAllPoints_, &pntGeomitemList);
174             if (err != PRO_TK_NO_ERROR
175                 && err != PRO_TK_E_NOT_FOUND)
176                 throw exception("ListPoints failed.");
177             for (int i=0; i<pntGeomitemList.size(); ++i)
178             {
179                 ProBoolean bIsInActive;
180                 ProGeomitemIsInactive(&pntGeomitemList[i], &bIsInActive);
181                 if (bIsInActive == PRO_B_TRUE)
182                     break;
183                 ProPoint pnt;
184                 ProGeomitemToPoint(&pntGeomitemList[i], &pnt);
185                 pntList.push_back(pnt);
186             }
187         }
188         
189         return pntList;
190     }
191 
192     //
193     // 列出所有的面組
194     //
195     CProList<ProQuilt> ListQuilts()
196     {
197         ProError err;
198         CProList<ProQuilt> quiltList;
199         err = ProSolidQuiltVisit(m_sld, NULL, _VisitSolidAllQuilts_, &quiltList);
200         if (err != PRO_TK_NO_ERROR
201             && err != PRO_TK_E_NOT_FOUND)
202             throw exception("ListQuilts failed.");
203 
204         return quiltList;
205     }
206 
207     //
208     // 列出所有的特征
209     //
210     CProList<ProFeature> ListFeats()
211     {
212         ProError err;
213         CProList<ProFeature> featList;
214         err = ProSolidFeatVisit(m_sld, NULL, _VisitSolidAllFeats_, &featList);
215         if (err != PRO_TK_NO_ERROR
216             && err != PRO_TK_E_NOT_FOUND)
217             throw exception("ListFeats failed.");
218 
219         return featList;
220     }
221 
222 public:
223     ProSolid m_sld;
224 };
225 
226 #endif

4、CProSolid.cpp

View Code
 1 #include "CProSolid.h"
 2 
 3 ProError _VisitSolidAllCsyses_(ProCsys  p_csys,
 4                                ProAppData app_data)
 5 {
 6     CProList<ProCsys> *pCsysList = (CProList<ProCsys>*)app_data;
 7     pCsysList->push_back(p_csys);
 8 
 9     return PRO_TK_NO_ERROR;
10 }
11 
12 ProError _VisitSolidAllSurfs_(ProSurface p_surface,
13                               ProAppData app_data)
14 {
15     CProList<ProSurface> *pSurfList = (CProList<ProSurface>*)app_data;
16     pSurfList->push_back(p_surface);
17 
18     return PRO_TK_NO_ERROR;
19 }
20 
21 ProError _VisitSolidAllAxises_(ProAxis  p_axis,
22                                ProAppData app_data)
23 {
24     CProList<ProAxis> *pAxisList = (CProList<ProAxis>*)app_data;
25     pAxisList->push_back(p_axis);
26 
27     return PRO_TK_NO_ERROR;
28 }
29 
30 ProError _VisitSolidAllQuilts_(ProQuilt p_quilt,
31                                ProAppData app_data)
32 {
33     CProList<ProQuilt> *pQuiltList = (CProList<ProQuilt>*)app_data;
34     pQuiltList->push_back(p_quilt);
35 
36     return PRO_TK_NO_ERROR;
37 }
38 
39 ProError _VisitSolidAllFeats_(ProFeature* p_feature,
40                               ProAppData app_data)
41 {
42     CProList<ProFeature> *pFeatList = (CProList<ProFeature>*)app_data;
43     pFeatList->push_back(*p_feature);
44 
45     return PRO_TK_NO_ERROR;
46 }
47 
48 ProError _VisitFeatAllPoints_(ProGeomitem *p_handle,
49                               ProAppData  app_data)
50 {
51     CProList<ProGeomitem> *pPntGeomitemList = (CProList<ProGeomitem>*)app_data;
52     pPntGeomitemList->push_back(*p_handle);
53 
54     return PRO_TK_NO_ERROR;
55 }
56 
57 ProError _VisitQuiltAllSurfaces_(ProSurface p_surface,
58                                  ProAppData app_data)
59 {
60     CProList<ProSurface> *pDatumSurfaceList = (CProList<ProSurface>*)app_data;
61     pDatumSurfaceList->push_back(p_surface);
62 
63     return PRO_TK_NO_ERROR;
64 }
65 
66 ProError _VisitSolidAllDatumPlaneFeats_(ProFeature* p_feature,
67                                         ProAppData app_data)
68 {
69     CProList<ProFeature> *pDatumPlaneFeatList = (CProList<ProFeature>*)app_data;
70     ProError err;
71     ProFeattype feat_type;
72     err = ProFeatureTypeGet(p_feature, &feat_type);
73     if (feat_type == PRO_FEAT_DATUM)
74         pDatumPlaneFeatList->push_back(*p_feature);
75 
76     return PRO_TK_NO_ERROR;
77 }

 使用及代码说明:

1、使用时请包含以下头文件即可:

     #include "CProArray.h" 

  #include "CProList.h" 

  #include "CProSolid.h" 

2、之所以可以向WebLink那样使用,关键是CProList类的封装,该类有一个CProArray类的指针,并且CProArray类中包含一个引用计数,表明当前有多少个CProList对象引用了CProArray对象,这样,CProList对象的直接赋值实际上并没有重新分配数组对象,仅仅是增加了引用的数组CProArray的引用计数。

3、CProList对象会自动释放申请的数组内存,当引用计数变为0时。所以,使用者无需自己释放数组内存。

转载于:https://www.cnblogs.com/Hisin/archive/2012/07/29/2613698.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/296774.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

mybatis 多租户saas_MybatisPlus 多租户架构(SaaS)实现

1. 引言读写分离要做的事情就是对于一条SQL该选择哪个数据库去执行&#xff0c;至于谁来做选择数据库这件事儿&#xff0c;无非两个&#xff0c;要么中间件帮我们做&#xff0c;要么程序自己做。因此&#xff0c;一般来讲&#xff0c;读写分离有两种实现方式。第一种是依靠中间…

Floodlight 在 ChannelPipeline 图

我们知道&#xff0c;在Netty架构&#xff0c;一个ServerBootstrap用于生成server端的Channel的时候都须要提供一个ChannelPipelineFactory类型的參数&#xff0c;用于服务于建立连接的Channel&#xff0c;流水线处理来自某个client的请求。所以这里的 OpenflowPipelineFactory…

html超文本链接本页面,从HTML语言到网上家园 第三章 超文本链接(1)-网页设计,HTML/CSS...

超文本链接是 html 语言最大的特点之一&#xff0c;使用超文本链接可以极大的增加文件访问的灵活度&#xff0c;人们可以通过点击页面中的链接指针查看所需的内容&#xff0c;进退自如&#xff0c;灵活方便&#xff0c;这更加符合人的跳跃、交叉的思维方式。凡是浏览过网页的人…

PS景观彩色平面图技巧

1、关于水系&#xff0c;园林学习网 PS景观彩色平面图 水要有阴影&#xff0c;不过是内投影。可以用图层特效来做&#xff0c;也可以用高斯模糊。 要有光感&#xff0c;可以用退晕&#xff0c;也可以用滤镜打光。 2、草地 草地在红线内外一定要区分开色象和明度饱和度&#xff…

牛顿如果穿越到现在,能看懂相对论和量子力学吗?

全世界只有3.14 % 的人关注了爆炸吧知识今天要讲给大家讲一个从朋友BOSS那里听来的故事&#xff0c;而故事的主人公就是赫赫有名的牛顿大神。话说那一天&#xff0c;BOSS在牛顿的苹果树下思考人生。突然牛顿就从苹果树下的棺材里爬了出来&#xff0c;棺材板怎么压都压不住。于是…

【啊哈!算法】之二、插入排序

作者&#xff1a;jofranks 原创作品&#xff0c;转载请标明出处&#xff01;版权所有&#xff0c;侵权必究! 来源&#xff1a;http://blog.csdn.net/jofranks 插入排序包括&#xff1a;直接插入排序&#xff0c;折半插入排序&#xff0c;希尔排序~&#xff01; OK&#xff0c;下…

02Prism WPF 入门实战 - 建项

1.概要Prism介绍Github: https://github.com/PrismLibrary/Prism开发文档&#xff1a;https://prismlibrary.com/docs/Prism是一个框架&#xff0c;用于在WPF、Xamarin Forms、Uno Platform和WinUI中构建松散耦合、可维护和可测试的XAML应用程序。设计目标 为了实现下列目的&a…

rowspan 动态变化_使用colspan和rowspan动态删除html表中的多个列

好的&#xff0c;您的代码中的一个问题是&#xff0c;您删除了当前正在使用for进行迭代的单元格。我改变了你的第一个循环来完成所有反向&#xff1a;for (var i (rows[0].cells.length -1); i > 0; i--)&#xff0c;从后到前...所以没有索引在删除时发生变化。第二个问题是…

[转]Linux中如何自动启动服务

linux自动启动服务很简单&#xff0c;最简单的是把启动命令放到/etc/rc.d/rc.local文件里。这样就可以每次启动的时候自动启动服务了。例如对于 apache&#xff0c;编译好apache后会在安装目录的bin下生成apachectl文件&#xff0c;这是个启动脚本&#xff0c;我们只需要把这个…

一个C实现的线程池(产品暂未运用)

https://github.com/Pithikos/C-Thread-Pool

html首页 slider图片切换效果,jQuery插件Slider Revolution实现响应动画滑动图片切换效果...

jQuery插件Slider Revolution实现响应动画滑动图片切换效果2018-12-31编程之家https://www.jb51.cc这是一款非常强大的内容切换插件&#xff0c;它基于jQuery&#xff0c;它充分响应&#xff0c;支持移动设备&#xff0c;支持手机触摸&#xff0c;键盘翻页&#xff1b;它内置幻…

Asp.Net+Jquery.Ajax详解5-$.getScript

目录&#xff08;已经更新的文章会有连接&#xff0c;从7月25日开始&#xff0c;每2到3天更新一篇&#xff09;&#xff1a; Asp.NetJquery.Ajax详解1-开篇&#xff08;2012.07.25发&#xff09; Asp.NetJquery.Ajax详解2-$.Load&#xff08;2012.07.26发&#xff09; Asp.NetJ…

大数据告诉你:学历真的能改变命运!!

全世界只有3.14 % 的人关注了爆炸吧知识央视新闻曾做过关于高考的调查&#xff0c;结果有七成网友支持高考取消数学&#xff0c;看到新闻后&#xff0c;有一位网友却一针见血地评论道&#xff1a;数学考试存在的意义就是把这七成网友筛选掉。的确&#xff0c;虽然买菜不需要专业…

.net core 中如何有效屏蔽重复提交

咨询区 Guilherme Ferreira&#xff1a;我通过 post 方式向我的一个webapi中提交数据&#xff0c;然后插入到数据库中&#xff0c;在 ui端&#xff0c;当用户点击某一个 button 之后&#xff0c;代码会将 button 禁用&#xff0c;但因为某些原因&#xff0c;点击按钮的速度比禁…

小米8ios图标包下载_小米互传PC端抢先下载,免流量、高速互传,支持多设备共享...

小米早在MIUI初期就已经在开始探索手机与电脑之间互传文件的问题&#xff0c;MIUI"无线数据线"功能一直备受喜欢。手机与电脑之间互传&#xff0c;90%的用户都选择使用WX或者QQ来实现&#xff0c;它们互传的通道是互联网&#xff0c;无网时不可使用。为解决这个问题&…

sql server2008中怎样用sql语句创建数据库和数据表

这是简单用代码实现创建数据库和数据表的sql语句&#xff0c;如下&#xff1a; --调用系统数据库-- use master go /***防止你要创建的数据库同名&#xff0c;先把它删除掉****/ if Exists(select * from dbo.sysdatabases where nameTestDB) begin drop database TestDB end g…

[C++][IO]读写二进制文件

1. 以二进制方式读写结构体 struct Student {string name;string sex;int age; }void write(string filePath, const struct Student* stu, int n) {FILE *fp;int i;if((fpfopen(filePath,"wb"))NULL){printf("cant open the file");return;}for(i0;i<n…

HTML怎么做类似QQ聊天气泡,h5实现QQ聊天气泡的实例介绍

这篇文章主要介绍了HTML5实现QQ聊天气泡效果&#xff0c;用 HTML/CSS 做了个类似QQ的聊天气泡&#xff0c;具有一定的参考价值&#xff0c;感兴趣的小伙伴们可以参考一下今天自己用 HTML/CSS 做了个类似QQ的聊天气泡&#xff0c;以下是效果图&#xff1a;以下说下关键地方的样式…

高等数学的用处之一

1 只能说计算的真精准2 龙虾&#xff1a;我都准备半天了&#xff0c;你俩到底上不上&#xff1f;3 猫(≧^.^≦)&#xff1a;我为这个宿舍付出太多了&#xff01;4 请举一个日常生活中利用高等数学来解决问题的案例。5 男生做什么会让女生不开心7 人家拍的泸沽湖的水性杨花和我拍…

wp7 blogs

http://blog.csdn.net/jazywoo123/article/month/2012/04/3转载于:https://www.cnblogs.com/songtzu/archive/2012/08/09/2630573.html