wheroy
路人甲
路人甲
  • 注册日期2004-09-04
  • 发帖数159
  • QQ
  • 铜币251枚
  • 威望0点
  • 贡献值0点
  • 银元0个
50楼#
发布于:2004-09-04 12:56
<P>你的浏览器不需要mapgis 狗不?</P>
举报 回复(0) 喜欢(0)     评分
鸟语花香
路人甲
路人甲
  • 注册日期2004-08-04
  • 发帖数102
  • QQ
  • 铜币51枚
  • 威望0点
  • 贡献值0点
  • 银元0个
51楼#
发布于:2004-09-02 09:20
牛<img src="images/post/smile/dvbbs/em02.gif" />
举报 回复(0) 喜欢(0)     评分
zjjtwmj
路人甲
路人甲
  • 注册日期2003-08-02
  • 发帖数370
  • QQ
  • 铜币988枚
  • 威望0点
  • 贡献值0点
  • 银元0个
52楼#
发布于:2004-08-06 09:42
<img src="images/post/smile/dvbbs/em02.gif" /><img src="images/post/smile/dvbbs/em05.gif" />我们大家学习的楷模。
举报 回复(0) 喜欢(0)     评分
tom_jz
路人甲
路人甲
  • 注册日期2004-07-29
  • 发帖数23
  • QQ
  • 铜币156枚
  • 威望0点
  • 贡献值0点
  • 银元0个
53楼#
发布于:2004-07-29 17:22
支持啊!
举报 回复(0) 喜欢(0)     评分
peng8748
论坛版主
论坛版主
  • 注册日期2003-08-07
  • 发帖数1712
  • QQ
  • 铜币52枚
  • 威望0点
  • 贡献值0点
  • 银元0个
54楼#
发布于:2004-07-13 21:16
好,这样VB、VC都有了,固个顶吧。
有什么要求PM我 email : peng8748@163.com
举报 回复(0) 喜欢(0)     评分
lym0813
路人甲
路人甲
  • 注册日期2004-06-14
  • 发帖数284
  • QQ
  • 铜币8枚
  • 威望0点
  • 贡献值0点
  • 银元0个
55楼#
发布于:2004-07-13 20:30
<img src="images/post/smile/dvbbs/em01.gif" />
举报 回复(0) 喜欢(0)     评分
lxwd
路人甲
路人甲
  • 注册日期2003-08-03
  • 发帖数14
  • QQ
  • 铜币132枚
  • 威望0点
  • 贡献值0点
  • 银元0个
56楼#
发布于:2004-07-13 13:43
<P>如何打包</P>
举报 回复(0) 喜欢(0)     评分
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15951
  • QQ
  • 铜币25345枚
  • 威望15368点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
57楼#
发布于:2004-07-13 11:55
<P><FONT color=#386490>void CCGisView_Demo1View::OnQueryLin()
{
long *p;
short *pOldLst;
int i,j,ai;
LPTSTR pstr;
ATT_STRU *stru;
char expStr[256];
LIN_INFO lin_info;
char c[2];
c[0]='"'; c[1]='\0';</FONT></P><P><FONT color=#386490>_GetAreaList(;pOldLst); //取当前视窗口对应的工作区,若没有,则pOldLst返回NULL
if(pOldLst) //pOldLst!=NULL,说明当前视窗口已经有对应的工作区,保存原来对应的工作区
{
for(i=1;i<=pOldLst[0];i++) {
ai=pOldLst;

if(_AType(ai)==LIN) {
if(_GetAttStru(ai,LIN,;stru))
if(_InputExpresion(hwnd,stru,expStr,256,"线属性查询",NULL))
{ //MessageBox(expStr,expStr,MB_OK);
p=_AttAskToList0(ai,LIN,expStr);

//_ _AttAskToList(ai,PNT);
if(p!=NULL) {
for(j=1;j<=p[0];j++) {
_FlashLin(ai,p+j,1 /*p[0]*/);
_GetLinInfo(ai,*(p+j),;lin_info);
_GotoWindowFxy(0.5*(lin_info.rect.xmin+lin_info.rect.xmax),
0.5*(lin_info.rect.ymin+lin_info.rect.ymax));</FONT></P><P><FONT color=#386490>//_ViewARcd(NULL/*GetSafeHwnd()*/,ai,PNT,*(p+j),"忻州地区滹沱河管理信息系统--浏览资料");
_ViewCurAtt(ai,LIN,*(p+j),"忻州地区滹沱河管理信息系统--浏览资料");</FONT></P><P><FONT color=#386490>}
}</FONT></P><P><FONT color=#386490>}
}
}
}
}</FONT></P><P>
 </P><P><FONT color=#386490>void CCGisView_Demo1View::OnQueryReg()
{
long *p;
short *pOldLst;</FONT></P><P><FONT color=#386490>int i,j,ai;
LPTSTR pstr;
ATT_STRU *stru;
char expStr[256];
REG_INFO reg_info;</FONT></P><P><FONT color=#386490>char c[2];
c[0]='"'; c[1]='\0';</FONT></P><P><FONT color=#386490>_GetAreaList(;pOldLst); //取当前视窗口对应的工作区,若没有,则pOldLst返回NULL
if(pOldLst) //pOldLst!=NULL,说明当前视窗口已经有对应的工作区,保存原来对应的工作区
{
for(i=1;i<=pOldLst[0];i++) {
ai=pOldLst;

if(_AType(ai)==REG) {
if(_GetAttStru(ai,REG,;stru))
if(_InputExpresion(hwnd,stru,expStr,256,"区属性查询",NULL))
{ //MessageBox(expStr,expStr,MB_OK);
p=_AttAskToList0(ai,REG,expStr);

//_ _AttAskToList(ai,PNT);
if(p!=NULL) {
for(j=1;j<=p[0];j++) {
_FlashReg(ai,p+j,1 /*p[0]*/);
_GetRegInfo(ai,*(p+j),;reg_info);
_GotoWindowFxy(0.5*(reg_info.rect.xmin+reg_info.rect.xmax),
0.5*(reg_info.rect.ymin+reg_info.rect.ymax));</FONT></P><P><FONT color=#386490>//_ViewARcd(NULL/*GetSafeHwnd()*/,ai,PNT,*(p+j),"忻州地区滹沱河管理信息系统--浏览资料");
_ViewCurAtt(ai,REG,*(p+j),"忻州地区滹沱河管理信息系统--浏览资料");</FONT></P><P><FONT color=#386490>}
}</FONT></P><P><FONT color=#386490>}
}
}
}
}</FONT></P><P><FONT color=#386490>
/*void CCGisView_Demo1View::OnTry3()
{
TCHAR szFullPath[256];
TCHAR szDir[256];
TCHAR szDrive[256];
::GetModuleFileName(NULL,szFullPath,256);
_splitpath(szFullPath,szDrive,szDir,NULL,NULL);
MessageBox(szFullPath,szDrive,MB_OK);
MessageBox(szFullPath,szDir,MB_OK);
::GetShortPathName(szFullPath,szDrive,256);
MessageBox(szFullPath,szDrive,MB_OK);</FONT></P><P><FONT color=#386490>
return;
}*/</FONT></P><P><FONT color=#386490>
void CCGisView_Demo1View::OnExtractPnt()
{
short *pOldLst;
short *pNewLst;
int i,j,ai,ai2,oldlist;
CCGisView_Demo1App *ptApp;
ptApp=(CCGisView_Demo1App *)AfxGetApp(); //取当前应用程序对象地址</FONT></P><P><FONT color=#386490>_GetAreaList(;pOldLst); //取当前视窗口对应的工作区,若没有,则pOldLst返回NULL
if(pOldLst) //pOldLst!=NULL,说明当前视窗口已经有对应的工作区,保存原来对应的工作区
{
oldlist=pOldLst[0];
for(i=1;i<=oldlist;i++)
{//MessageBox("gdjfgdjgdj","daddad",MB_OK);
_GetAreaList(;pOldLst);
ai=pOldLst;
if(_AType(ai)==PNT)
{
ai2=_OpenArea(ptApp->m_AHInst,PNT); //打开一个fType类型的空工作区
if(ai2<=0) //失败则返回
{//MessageBox("1111111","daddad",MB_OK);
return;}
if(pOldLst) //pOldLst!=NULL,说明当前视窗口已经有对应的工作区,保存原来对应的工作区
{
pNewLst=new short [pOldLst[0]+2];//
pNewLst[0]=pOldLst[0]+1;
for(j=1;j<=pOldLst[0];j++)
pNewLst[j]=pOldLst[j];
}
/* else
{
pNewLst=new short [2];
pNewLst[0]=1;
i=1;
}*/
pNewLst[j]=ai2; //再添加新的工作区
_SetAreaList(pNewLst); //重新设置当前视窗口对应的工作区
if(_AttAskToArea(ai,PNT,ai2))
{
//_SaveFile(ai2);
_CloseArea(ai2);
}
//MessageBox("adsasasas","daddad",MB_OK);
delete[] pNewLst;
}
}
_RestoreWindow(); //复位当前视窗口
}return;
}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnExtractLin()
{
short *pOldLst;
short *pNewLst;
int i,j,ai,ai2,oldlist;
// LPTSTR pstr;
// ATT_STRU *stru;
// char expStr[256];
CCGisView_Demo1App *ptApp;
ptApp=(CCGisView_Demo1App *)AfxGetApp(); //取当前应用程序对象地址</FONT></P><P><FONT color=#386490>_GetAreaList(;pOldLst); //取当前视窗口对应的工作区,若没有,则pOldLst返回NULL
if(pOldLst) //pOldLst!=NULL,说明当前视窗口已经有对应的工作区,保存原来对应的工作区
{
// sprintf(expStr,"area==%d\n",pOldLst[0]);
// MessageBox(expStr,expStr,MB_OK);
oldlist=pOldLst[0];
for(i=1;i<=oldlist;i++)
{//MessageBox("gdjfgdjgdj","daddad",MB_OK);
_GetAreaList(;pOldLst);
ai=pOldLst;
if(_AType(ai)==LIN)
{
ai2=_OpenArea(ptApp->m_AHInst,LIN); //打开一个fType类型的空工作区
if(ai2<=0) //失败则返回
{//MessageBox("1111111","daddad",MB_OK);
return;}
if(pOldLst) //pOldLst!=NULL,说明当前视窗口已经有对应的工作区,保存原来对应的工作区
{
pNewLst=new short [pOldLst[0]+2];//
pNewLst[0]=pOldLst[0]+1;
for(j=1;j<=pOldLst[0];j++)
pNewLst[j]=pOldLst[j];
}
/* else
{
pNewLst=new short [2];
pNewLst[0]=1;
i=1;
}*/
pNewLst[j]=ai2; //再添加新的工作区
_SetAreaList(pNewLst); //重新设置当前视窗口对应的工作区
if(_AttAskToArea(ai,LIN,ai2))
{
//_SaveFile(ai2);
_CloseArea(ai2);
}
//MessageBox("adsasasas","daddad",MB_OK);
delete[] pNewLst;
}
}

_RestoreWindow(); //复位当前视窗口
}return;
}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnExtractReg()
{
short *pOldLst;
short *pNewLst;
int i,j,ai,ai2,oldlist;
CCGisView_Demo1App *ptApp;
ptApp=(CCGisView_Demo1App *)AfxGetApp(); //取当前应用程序对象地址</FONT></P><P><FONT color=#386490>_GetAreaList(;pOldLst); //取当前视窗口对应的工作区,若没有,则pOldLst返回NULL
if(pOldLst) //pOldLst!=NULL,说明当前视窗口已经有对应的工作区,保存原来对应的工作区
{
oldlist=pOldLst[0];//保存工作区数
for(i=1;i<=oldlist;i++)
{//MessageBox("gdjfgdjgdj","daddad",MB_OK);
_GetAreaList(;pOldLst);
ai=pOldLst;
if(_AType(ai)==REG)
{
ai2=_OpenArea(ptApp->m_AHInst,REG); //打开一个fType类型的空工作区
if(ai2<=0) //失败则返回
{//MessageBox("1111111","daddad",MB_OK);
return;}
if(pOldLst) //pOldLst!=NULL,说明当前视窗口已经有对应的工作区,保存原来对应的工作区
{
pNewLst=new short [pOldLst[0]+2];//
pNewLst[0]=pOldLst[0]+1;
for(j=1;j<=pOldLst[0];j++)
pNewLst[j]=pOldLst[j];
}
/* else
{
pNewLst=new short [2];
pNewLst[0]=1;
i=1;
}*/
pNewLst[j]=ai2; //再添加新的工作区
_SetAreaList(pNewLst); //重新设置当前视窗口对应的工作区
if(_AttAskToArea(ai,REG,ai2))
{
//_SaveFile(ai2);
_CloseArea(ai2);
}
//MessageBox("adsasasas","daddad",MB_OK);
delete[] pNewLst;
}
}

_RestoreWindow(); //复位当前视窗口
} return;
}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnSelectarea()
{
CCGisView_Demo1App *ptApp;
int i,j;
short *tai;
CCGisView_Demo1Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
ptApp=(CCGisView_Demo1App *)AfxGetApp(); //取当前应用程序对象地址
if(tai=_SelectAreaList(ptApp->m_AHInst,hwnd,-1,"选择显示图件")) {
if(pDoc->ptai!=NULL) delete pDoc->ptai;
pDoc->ptai=new short [tai[0]+1];
for(i=0;i<=tai[0];i++) pDoc->ptai=tai;
_UpdateWindow();
}</FONT></P><P><FONT color=#386490>
}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnMapChina()
{
if(OpenMap("china.prj"))
GetParentFrame()->SetWindowText("中国地图");</FONT></P><P><FONT color=#386490>}</FONT></P><P><FONT color=#386490>
void CCGisView_Demo1View::OnYqmapBasmap()
{
if(OpenMap("basemap.prj"))//地理底图.prj"))
GetParentFrame()->SetWindowText("地理底图");

}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnYqmapKcms()
{ if(OpenMap("channel.prj"))//渠系现状图.prj"))
GetParentFrame()->SetWindowText("渠系现状图");

}
void CCGisView_Demo1View::OnYqmapWaterquality()
{
if(OpenMap("burydep.prj"))
GetParentFrame()->SetWindowText("潜水埋深图");

}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnYqmapWrcd()
{
if(OpenMap("level.prj"))
GetParentFrame()->SetWindowText("潜水等水位线图");

}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnYqmapGeology()
{
if(OpenMap("borehole.prj"))
GetParentFrame()->SetWindowText("孔位布置图");

}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnYqmapEnvhydrogeo()
{
if(OpenMap("soilsalt.prj"))
GetParentFrame()->SetWindowText("土壤含盐量分布图");

}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnYqmapProfile()
{
if(OpenMap("yanzitu.prj"))
GetParentFrame()->SetWindowText("盐渍土分类图");

}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnYqmapRecharge()
{
if(OpenMap("tuzi.prj"))//土质分布图.prj"))
GetParentFrame()->SetWindowText("土质分布图");

}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnYqmapHydrogeo()
{
if(OpenMap("hydrog.prj"))//水文地质图.prj"))
GetParentFrame()->SetWindowText("水文地质图");

}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnYqmapKarstwaterlevel()
{
if(OpenMap("karst.prj"))//岩溶水等水位线图.prj"))
GetParentFrame()->SetWindowText("岩溶水等水位线图");
}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnYqmapHardness()
{
if( OpenMap("T_hard.prj"))//总硬度矿化度图.prj"))
GetParentFrame()->SetWindowText("总硬度矿化度图");
}
/*
void CCGisView_Demo1View::OnExecute()
{
pb.ExcuteServiceCmd("YQ0009");

}
*/
void CCGisView_Demo1View::OnConnectToDbs()
{
if(connectToDbs==false) {
pb.CMDCAD="MyPBApp";
pb.LinkToService();
if(pb.hConv==0L) {MessageBox(" 数据库系统未准备好 \n 启动后再试...",
"数据传输信息",MB_OK); return;}
}
//else pb.UnLinkToService();
connectToDbs=!connectToDbs;
}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnUpdateConnectToDbs(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck(connectToDbs);
}
/*
void CCGisView_Demo1View::OnTry()
{
// TOD Add your command handler code here

}
*/</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnAreaSum()
{
short *pOldLst;
int i,j,ai;
LPTSTR pstr;
long *p;
double area_sum=0.0;
ATT_STRU *stru;
char *att;
char msg[200];
CString exp="面积>0.0";
CCGisView_Demo1App *ptApp;
ptApp=(CCGisView_Demo1App *)AfxGetApp(); //取当前应用程序对象地址</FONT></P><P><FONT color=#386490>_GetAreaList(;pOldLst); //取当前视窗口对应的工作区,若没有,则pOldLst返回NULL
if(pOldLst) //pOldLst!=NULL,说明当前视窗口已经有对应的工作区,保存原来对应的工作区
{
for(i=1;i<=pOldLst[0];i++) {
ai=pOldLst;
if(_AType(ai)==REG)
{
pstr = exp.GetBuffer(exp.GetLength());
p=_AttAskToList0(ai,REG,pstr);
if(p)
for(j=1;j<=p[0];j++) {
if(_GetAtt(ai,_AType(ai),p[j],;stru,;att)==1)
area_sum+=_GetFld(att,stru,"面积",NULL,NULL);
}
}
}

sprintf(msg," 总面积=%.3f \n",area_sum);
MessageBox(msg,"总面积统计",MB_OK);
}return;
}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnArcSum()
{
short *pOldLst;
int i,j,ai;
LPTSTR pstr;
long *p;
double area_sum=0.0;
ATT_STRU *stru;
char *att;
char msg[200];
CString exp="面积>0.0";
CCGisView_Demo1App *ptApp;
ptApp=(CCGisView_Demo1App *)AfxGetApp(); //取当前应用程序对象地址</FONT></P><P><FONT color=#386490>_GetAreaList(;pOldLst); //取当前视窗口对应的工作区,若没有,则pOldLst返回NULL
if(pOldLst) //pOldLst!=NULL,说明当前视窗口已经有对应的工作区,保存原来对应的工作区
{
for(i=1;i<=pOldLst[0];i++) {
ai=pOldLst;
if(_AType(ai)==REG)
{
pstr = exp.GetBuffer(exp.GetLength());
p=_AttAskToList0(ai,REG,pstr);
if(p)
for(j=1;j<=p[0];j++) {
if(_GetAtt(ai,_AType(ai),p[j],;stru,;att)==1)
area_sum+=_GetFld(att,stru,"周长",NULL,NULL);
}
}
}

sprintf(msg," 总周长=%.3f \n",area_sum);
MessageBox(msg,"总周长统计",MB_OK);
}return;
}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnLineSum()
{
short *pOldLst;
int i,j,ai;
LPTSTR pstr;
long *p;
double area_sum=0.0;
ATT_STRU *stru;
char *att;
char msg[200];
CString exp="长度>0.0";
CCGisView_Demo1App *ptApp;
ptApp=(CCGisView_Demo1App *)AfxGetApp(); //取当前应用程序对象地址</FONT></P><P><FONT color=#386490>_GetAreaList(;pOldLst); //取当前视窗口对应的工作区,若没有,则pOldLst返回NULL
if(pOldLst) //pOldLst!=NULL,说明当前视窗口已经有对应的工作区,保存原来对应的工作区
{
for(i=1;i<=pOldLst[0];i++) {
ai=pOldLst;
if(_AType(ai)==LIN)
{
pstr = exp.GetBuffer(exp.GetLength());
p=_AttAskToList0(ai,LIN,pstr);
if(p)
for(j=1;j<=p[0];j++) {
if(_GetAtt(ai,_AType(ai),p[j],;stru,;att)==1)
area_sum+=_GetFld(att,stru,"长度",NULL,NULL);
}
}
}

sprintf(msg," 总线长度=%.3f \n",area_sum);
MessageBox(msg,"线长度统计",MB_OK);
}
return;
}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnQueryBore()
{ querybore_flage=!querybore_flage; }</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnUpdateQueryBore(CCmdUI* pCmdUI)
{ pCmdUI->SetCheck(querybore_flage);
// TOD Add your command update UI handler code here }
</FONT></P>
GIS麦田守望者,期待与您交流。
举报 回复(0) 喜欢(0)     评分
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15951
  • QQ
  • 铜币25345枚
  • 威望15368点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
58楼#
发布于:2004-07-13 11:55
<P><FONT color=#386490>void CCGisView_Demo1View::OnReduce()
{
_SetCommandFlag(IDMN_REDUCE);
}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnMove()
{
_SetCommandFlag(IDMN_MOVE);
}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnRestore()
{
_RestoreWindow();//复位窗口
}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnUpdate()
{
_UpdateWindow();//更新窗口
}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnLastwin()
{
_PrevWindow();//上级窗口</FONT></P><P><FONT color=#386490>
}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnClear()
{
_CleanWindow();//清窗口
}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnLButtonDown(UINT nFlags, CPoint point)
{
LButtonPos=point;
CGisView::OnLButtonDown(nFlags, point);
}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnRButtonDown(UINT nFlags, CPoint point)
{
// TOD Add your message handler code here and/or call default
if(gotoanywhere_flage)
CheckMenuItem(m_hGisViewPopMn,ID_GOTOANYWHERE, MF_CHECKED );
else
CheckMenuItem(m_hGisViewPopMn,ID_GOTOANYWHERE, MF_UNCHECKED);</FONT></P><P><FONT color=#386490>_SetCommandFlag(0);
CGisView::OnRButtonDown(nFlags, point);
}</FONT></P><P><FONT color=#386490>int CCGisView_Demo1View::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CGisView::OnCreate(lpCreateStruct) == -1)
return -1;</FONT></P><P><FONT color=#386490>// TOD Add your specialized creation code hereID_BMP
AppendMenu( m_hGisViewPopMn, MF_SEPARATOR,NULL,NULL);
//AppendMenu( m_hGisViewPopMn, MF_BITMAP,ID_BMP, (LPCSTR)bmp1.GetSafeHandle());//(CBitmap::FromHandle(bmp1)));//MAKEINTRESOURCE(IDB_BITMAP1));
AppendMenu( m_hGisViewPopMn, MF_STRING,ID_TRY,"浏览属性");
AppendMenu( m_hGisViewPopMn, MF_SEPARATOR,NULL,NULL);
AppendMenu( m_hGisViewPopMn, MF_STRING,ID_START_FLASH,"浏览单个属性");
AppendMenu( m_hGisViewPopMn, MF_SEPARATOR,NULL,NULL);
AppendMenu( m_hGisViewPopMn, MF_STRING,IDMN_STOP_FLASH_PNT,"停止闪烁点");
AppendMenu( m_hGisViewPopMn, MF_STRING,IDMN_STOP_FLASH_LIN,"停止闪烁线");
AppendMenu( m_hGisViewPopMn, MF_STRING,IDMN_STOP_FLASH_REG,"停止闪烁区");
AppendMenu( m_hGisViewPopMn, MF_STRING,ID_STOPALL_FLASH,"停止全部闪烁");
AppendMenu( m_hGisViewPopMn, MF_SEPARATOR,NULL,NULL);
AppendMenu( m_hGisViewPopMn, MF_UNCHECKED ,ID_GOTOANYWHERE,"图形漫游");
return 0;
}</FONT></P><P><FONT color=#386490>BOOL CCGisView_Demo1View::OnCommand(WPARAM wParam, LPARAM lParam)
{
// TOD Add your specialized code here and/or call the base class
switch(wParam)
{
case ID_BMP://MessageBox("vvvvvv");
dialog2 dlg;
dlg.DoModal();
break;
}
return CGisView::OnCommand(wParam, lParam);
}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnTry()
{
CCGisView_Demo1App *ptApp;</FONT></P><P><FONT color=#386490>//AREA_HINST hinst=GetAreaInst();</FONT></P><P><FONT color=#386490>ptApp=(CCGisView_Demo1App *)AfxGetApp(); //取当前应用程序对象地址
//ai=_OpenArea(ptApp->m_AHInst
attHwnd=_ViewAtt(GetSafeHwnd() ,ptApp->m_AHInst,WS_CAPTION);
//if(_ViewAtt(GetSafeHwnd() ,ptApp->m_AHInst,WS_CAPTION)==NULL)
//MessageBox("error","",MB_OK);

}</FONT></P><P><FONT color=#386490>LRESULT CCGisView_Demo1View::OnMyMessage(WPARAM wParam,LPARAM lParam)
{
LIN_INFO lin_info;
REG_INFO reg_info;
PNT_INFO pnt_info;
/* sprintf(str,"area=%d type=%d element=%d \n",((MGMSG *) lParam)->ai,
((MGMSG *) lParam)->type,
((MGMSG *) lParam)->elmi);
*/ //MessageBox(str,"",MB_OK);</FONT></P><P><FONT color=#386490>curview_area=((MGMSG *) lParam)->ai;
curview_type=((MGMSG *) lParam)->type;
switch(((MGMSG *) lParam)->type){
case PNT:
_GetPntInfo(((MGMSG *) lParam)->ai,((MGMSG *) lParam)->elmi,;pnt_info);
_GotoWindowFxy(0.5*(pnt_info.rect.xmin+pnt_info.rect.xmax),
0.5*(pnt_info.rect.ymin+pnt_info.rect.ymax));
_FlashPnt(((MGMSG *) lParam)->ai, ;(((MGMSG *) lParam)->elmi), 1);
flashtype=PNT;
break;
case LIN:
_GetLinInfo(((MGMSG *) lParam)->ai,((MGMSG *) lParam)->elmi,;lin_info);
_GotoWindowFxy(0.5*(lin_info.rect.xmin+lin_info.rect.xmax),
0.5*(lin_info.rect.ymin+lin_info.rect.ymax));
_FlashLin(((MGMSG *) lParam)->ai, ;(((MGMSG *) lParam)->elmi), 1);
flashtype=LIN;
//MessageBox("flash lin","MSG",MB_OK);
break;
case REG:
_GetRegInfo(((MGMSG *) lParam)->ai,((MGMSG *) lParam)->elmi,;reg_info);
_GotoWindowFxy(0.5*(reg_info.rect.xmin+reg_info.rect.xmax),
0.5*(reg_info.rect.ymin+reg_info.rect.ymax));
_FlashReg(((MGMSG *) lParam)->ai, ;(((MGMSG *) lParam)->elmi), 1);
flashtype=REG;
break;
default:
break;

}</FONT></P><P><FONT color=#386490>return 0;
}</FONT></P><P><FONT color=#386490>LRESULT CCGisView_Demo1View::OnDestroyAttWnd(WPARAM wParam,LPARAM lParam){
if(lParam==0 ;; attHwnd!=NULL) {
attHwnd=NULL;
curview_area=-1;
curview_type=-1;
_StopFlash(LIN);_StopFlash(PNT);_StopFlash(REG);
}
return 0;
}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnLButtonDblClk(UINT nFlags, CPoint point)
{
RECT rc;
F_RECT frc;
long *ptLst;
short *ptAiLst;
short i;
ATT_STRU *stru;
char *att;
char ptStr[256];
long cmd=_GetCommandFlag();
if(cmd==ID_START_FLASH || attHwnd!=NULL)//闪烁图元
{
rc.left=point.x-10; rc.bottom=point.y+10;
rc.right=point.x+10; rc.top=point.y-10;
{
_WpToLp(rc.left , rc.top , ;(frc.xmin), ;(frc.ymax));
_WpToLp(rc.right, rc.bottom, ;(frc.xmax), ;(frc.ymin));
if(_GetAreaList(;ptAiLst))
{
for(i=1;i<=ptAiLst[0];i++)
{</FONT></P><P><FONT color=#386490>switch(_AType(ptAiLst))
{
case PNT:
ptLst=_RectAskPntToList(ptAiLst,;frc,NULL);
if(ptLst) {
if(attHwnd==NULL;; curview_area==-1) {
_FlashPnt(ptAiLst, ptLst+1,1); //ptLst[0]);
if(connectToDbs) {
_GetAtt(ptAiLst,PNT,*(ptLst+1),;stru,;att);
if(_CvtFldToString1(stru,att,"钻孔号",ptStr,256,NULL,NULL))
{// MessageBox(ptStr,ptStr,MB_OK);
pb.ExcuteServiceCmd(ptStr);}
else
_ViewARcd(GetSafeHwnd(),ptAiLst,PNT,*(ptLst+1),"忻州地区滹沱河管理信息系统--浏览资料");
}
else
_ViewARcd(GetSafeHwnd(),ptAiLst,PNT,*(ptLst+1),"忻州地区滹沱河管理信息系统--浏览资料");</FONT></P><P><FONT color=#386490>}
else if(flashtype==PNT) {
//_FlashPnt(ptAiLst, ptLst+1,1); //ptLst[0]);
::SendMessage(attHwnd,WM_COMMAND,GOTO_ATT,*(ptLst+1));
}</FONT></P><P><FONT color=#386490>
break;
}

case LIN:
ptLst=_RectAskLinToList(ptAiLst,;frc,NULL);
if(ptLst ;; querybore_flage==false)
{
if(attHwnd==NULL;; curview_area==-1) {
_FlashLin(ptAiLst, ptLst+1,1); // ptLst[0]);
_ViewARcd(GetSafeHwnd(),ptAiLst,LIN,*(ptLst+1),"忻州地区滹沱河管理信息系统--浏览资料");
}
else if(flashtype==LIN) {
//_FlashLin(ptAiLst, ptLst+1,1); // ptLst[0]);
::SendMessage(attHwnd,WM_COMMAND,GOTO_ATT,*(ptLst+1));
//MessageBox("flash lin","",MB_OK);
}
break;
}
case REG:
ptLst=_RectAskRegToList(ptAiLst,;frc,NULL);
if(ptLst ;; querybore_flage==false)
{
if(attHwnd==NULL;; curview_area==-1) {
_FlashReg(ptAiLst, ptLst+1,1); // ptLst[0]);
_ViewARcd(GetSafeHwnd(),ptAiLst,REG,*(ptLst+1),"忻州地区滹沱河管理信息系统--浏览资料");
}
else if(flashtype==REG) {
//_FlashLin(ptAiLst, ptLst+1,1); // ptLst[0]);
::SendMessage(attHwnd,WM_COMMAND,GOTO_ATT,*(ptLst+1));
//MessageBox("flash reg","regg",MB_OK);
}
break;
}
default:
break;
}
}
}
}
}
CGisView::OnLButtonDblClk(nFlags, point);
}</FONT></P><P><FONT color=#386490>
void CCGisView_Demo1View::OnDestroy()
{ short *ptAiLst;
int i;</FONT></P><P><FONT color=#386490>if(_GetAreaList(;ptAiLst))
{
for(i=1;i<=ptAiLst[0];i++)
{
//_SaveFile(ptAiLst);
_CloseArea(ptAiLst);
}
}
CGisView::OnDestroy();

//MessageBox("Close Child Frame view","",MB_OK);
}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnMouseMove(UINT nFlags, CPoint point)
{
F_DOT xy1;
//F_RECT frc;
RECT frc;
long dx,dy;
CPoint point2;
GetClientRect(;frc);
if(gotoanywhere_flage){
if(point.x<=frc.left+50) dx=50;
if(point.x>=frc.right-50) dx=-50;
if(point.y<=frc.top+50) dy=50;
if(point.y>=frc.bottom-50) dy=-50;
if(point.x<=frc.left+50 || point.x>=frc.right-50 ||
point.y<=frc.top+50 || point.y>=frc.bottom-50 ){
GetCursorPos(;point2);
point2.x+=dx; point2.y+=dy;
_WpToLp(;point,;xy1);
_GotoWindowFxy(xy1.x,xy1.y);
SetCursorPos(point2.x,point2.y);//0.5*(frc.left+frc.right),0.5*(frc.top+frc.bottom));
}
}</FONT></P><P><FONT color=#386490>CGisView::OnMouseMove(nFlags, point);</FONT></P><P><FONT color=#386490>}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnGotoanywhere()
{
gotoanywhere_flage=!gotoanywhere_flage;
}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnUpdateGotoanywhere(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck(gotoanywhere_flage); // TOD Add your command update UI handler code here

}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnStopallFlash()
{
_StopFlash(LIN);_StopFlash(PNT);_StopFlash(REG);
}
/*
void CCGisView_Demo1View::OnTry2()
{
//MessageBox("I am trying DDE Connection" ,"DDE OnTry2",MB_OK);
//OnStartFlash();
long *p;
short *pOldLst;
int i,ai;
LPTSTR pstr;
CString name;</FONT></P><P><FONT color=#386490>char c[2];
c[0]='"'; c[1]='\0';</FONT></P><P><FONT color=#386490>_GetAreaList(;pOldLst); //取当前视窗口对应的工作区,若没有,则pOldLst返回NULL
if(pOldLst) //pOldLst!=NULL,说明当前视窗口已经有对应的工作区,保存原来对应的工作区
{
for(i=1;i<=pOldLst[0];i++) {
ai=pOldLst;
name.Empty();
name="钻孔编号!=";
name=name+c;
name=name+"001";
name=name+c;
pstr = name.GetBuffer(name.GetLength());
MessageBox(pstr,pstr,MB_OK);
p=_AttAskToList0(ai,PNT,pstr);

//_ _AttAskToList(ai,PNT);
if(p!=NULL) {
_FlashPnt(ai,p+1,p[0]);
}
}
}
}
*/
BOOL CCGisView_Demo1View::OpenMap(char *prj)
{
CCGisView_Demo1App *ptApp;
short ai,i;
short *pOldLst;
short *pNewLst;
FILE *fp;
short fType;
CString name;
CString path;
int j,num_file;
LPTSTR p;
ptApp=(CCGisView_Demo1App *)AfxGetApp(); //取当前应用程序对象地址
char dir[256];
//GetCurrentDirectory(200,dir);
TCHAR szFullPath[256];
TCHAR szDir[256];
TCHAR szDrive[256];
::GetModuleFileName(NULL,szFullPath,256);
_splitpath(szFullPath,szDrive,szDir,NULL,NULL);</FONT></P><P><FONT color=#386490>name=szDrive;//dir;
//name=name.Left(2);
name=name+"\\mapgis32\\xzhmap";
path=name;
name=path+"\\"+prj;</FONT></P><P><FONT color=#386490>//MessageBox(name,name,MB_OK);
if((fp=fopen(name,"r"))!=NULL) {
fscanf(fp,"%d\n",;num_file);
for(j=1;j<=num_file;j++) {
fscanf(fp,"%s\n",dir);
name=dir;
name.MakeUpper();
fType=-1;
if(name.Find(".WL")!=-1) fType=LIN;
if(name.Find(".WT")!=-1) fType=PNT;
if(name.Find(".WP")!=-1) fType=REG;
if(fType==-1) continue;
name=path+name;
p = name.GetBuffer(name.GetLength());

ai=_OpenArea(ptApp->m_AHInst,fType); //打开一个fType类型的空工作区
if(ai<=0) //失败则返回
return false;</FONT></P><P><FONT color=#386490>if(!_LoadAFile(p/*"F:\\mapgis32\\yqmap\\china.wl"*/,ai,NULL,NULL,NULL))//_LoadFile(ai)) //装入文件到ai工作区,若失败则关闭工作区,然后返回
{
MessageBox(name,"文件不存在!!!",MB_OK);
_CloseArea(ai);
//return false;
continue;
}
_GetAreaList(;pOldLst); //取当前视窗口对应的工作区,若没有,则pOldLst返回NULL
if(pOldLst) //pOldLst!=NULL,说明当前视窗口已经有对应的工作区,保存原来对应的工作区
{
pNewLst=new short [pOldLst[0]+2];//
pNewLst[0]=pOldLst[0]+1;
for(i=1;i<=pOldLst[0];i++)
pNewLst=pOldLst;
}
else
{
pNewLst=new short [2];
pNewLst[0]=1;
i=1;
}
pNewLst=ai; //再添加新的工作区
_SetAreaList(pNewLst); //重新设置当前视窗口对应的工作区
delete[] pNewLst;
}
}
else {
MessageBox(name,"文件不存在!!!",MB_OK);
return false;
}
_RestoreWindow(); //复位当前视窗口
fclose(fp);
return true;
}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnQueryPnt()
{
long *p;
short *pOldLst;
int i,j,ai;
LPTSTR pstr;
ATT_STRU *stru;
char expStr[256];
char c[2];
PNT_INFO pnt_info;</FONT></P><P><FONT color=#386490>c[0]='"'; c[1]='\0';</FONT></P><P><FONT color=#386490>_GetAreaList(;pOldLst); //取当前视窗口对应的工作区,若没有,则pOldLst返回NULL
if(pOldLst) //pOldLst!=NULL,说明当前视窗口已经有对应的工作区,保存原来对应的工作区
{
for(i=1;i<=pOldLst[0];i++) {
ai=pOldLst;

if(_AType(ai)==PNT) {
if(_GetAttStru(ai,PNT,;stru))
if(_InputExpresion(hwnd,stru,expStr,256,"点属性查询",NULL))
{ //MessageBox(expStr,expStr,MB_OK);
p=_AttAskToList0(ai,PNT,expStr);

//_ _AttAskToList(ai,PNT);
if(p!=NULL) {
for(j=1;j<=p[0];j++) {
_FlashPnt(ai,p+j,1 /*p[0]*/);
_GetPntInfo(ai,*(p+j),;pnt_info);
_GotoWindowFxy(0.5*(pnt_info.rect.xmin+pnt_info.rect.xmax),
0.5*(pnt_info.rect.ymin+pnt_info.rect.ymax));</FONT></P><P><FONT color=#386490>//_ViewARcd(NULL/*GetSafeHwnd()*/,ai,PNT,*(p+j),"忻州地区滹沱河管理信息系统--浏览资料");
_ViewCurAtt(ai,PNT,*(p+j),"忻州地区滹沱河管理信息系统--浏览资料");</FONT></P><P><FONT color=#386490>}
}</FONT></P><P><FONT color=#386490>}
}
}
}
}</FONT></P>
GIS麦田守望者,期待与您交流。
举报 回复(0) 喜欢(0)     评分
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15951
  • QQ
  • 铜币25345枚
  • 威望15368点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
59楼#
发布于:2004-07-13 11:54
<P><FONT color=#386490>/////////////////////////////////////////////////////////////////////////////
// CCGisView_Demo1View diagnostics</FONT></P><P><FONT color=#386490>#ifdef _DEBUG
void CCGisView_Demo1View::AssertValid() const
{
CGisView::AssertValid();
}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::Dump(CDumpContext; dc) const
{
CGisView::Dump(dc);
}</FONT></P><P><FONT color=#386490>CCGisView_Demo1Doc* CCGisView_Demo1View::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CCGisView_Demo1Doc)));
return (CCGisView_Demo1Doc*)m_pDocument;
}
#endif //_DEBUG</FONT></P><P><FONT color=#386490>/////////////////////////////////////////////////////////////////////////////
// CCGisView_Demo1View message handlers</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::LoadAFile(short fType)
{
CCGisView_Demo1App *ptApp;
short ai,i;
short *pOldLst;
short *pNewLst;

ptApp=(CCGisView_Demo1App *)AfxGetApp(); //取当前应用程序对象地址
ai=_OpenArea(ptApp->m_AHInst,fType); //打开一个fType类型的空工作区
if(ai<=0) //失败则返回
return;
if(!_LoadFile(ai)) //装入文件到ai工作区,若失败则关闭工作区,然后返回
{
_CloseArea(ai);
return;
}
_GetAreaList(;pOldLst); //取当前视窗口对应的工作区,若没有,则pOldLst返回NULL
if(pOldLst) //pOldLst!=NULL,说明当前视窗口已经有对应的工作区,保存原来对应的工作区
{
pNewLst=new short [pOldLst[0]+2];//
pNewLst[0]=pOldLst[0]+1;
for(i=1;i<=pOldLst[0];i++)
pNewLst=pOldLst;
}
else
{
pNewLst=new short [2];
pNewLst[0]=1;
i=1;
}
pNewLst=ai; //再添加新的工作区
_SetAreaList(pNewLst); //重新设置当前视窗口对应的工作区
delete[] pNewLst;
_RestoreWindow(); //复位当前视窗口
return;
}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnLoadPnt()
{
LoadAFile(PNT); //装入点文件
}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnLoadLIN()
{
LoadAFile(LIN); //装入线文件
}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnLoadREG()
{
LoadAFile(REG); //装入区文件
}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnStartFlash()
{
// char _WillGetRect(char yesOrNo);
//是否将要取鼠标左键按住移动的矩型范围,该函数必须在_SetCommandFlag后面调用。
_SetCommandFlag(ID_START_FLASH);
_WillGetRect(1);
return;
}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnLButtonUp(UINT nFlags, CPoint point)
{
// TOD Add your message handler code here and/or call default
RECT rc;
F_RECT frc;
long *ptLst;
short *ptAiLst;
short i;
CGisView::OnLButtonUp(nFlags, point);</FONT></P><P><FONT color=#386490>long cmd=_GetCommandFlag();
switch(cmd)
{
case IDMN_ENLARGE: //放大窗口
_EnlargeWindowLxy(point.x,point.y);break;
case IDMN_REDUCE: //缩小窗口
_ReduceWindowLxy(point.x,point.y);break;
case IDMN_MOVE: //移动窗口
_MoveWindowLxy(LButtonPos.x-point.x,LButtonPos.y-point.y);break;
case IDMN_LASTWIN: //上级窗口
_PrevWindow();break;
// case IDMN_RESTORE: //复位窗口
// _RestoreWindow();break;
// case IDMN_UPDATE: //更新窗口
// _UpdateWindow();break;
// case IDMN_CLEAR: //清窗口
// _CleanWindow(); break;
case ID_START_FLASH://闪烁图元
if(_GetRect(;rc))
{
_WpToLp(rc.left , rc.top , ;(frc.xmin), ;(frc.ymax));
_WpToLp(rc.right, rc.bottom, ;(frc.xmax), ;(frc.ymin));
if(_GetAreaList(;ptAiLst))
{
for(i=1;i<=1 /*ptAiLst[0]*/;i++)
{
switch(_AType(ptAiLst))
{
case PNT:
ptLst=_RectAskPntToList(ptAiLst,;frc,NULL);
if(ptLst) {
_FlashPnt(ptAiLst, ptLst+1, ptLst[0]);
_ViewARcd(GetSafeHwnd(),ptAiLst,PNT,*(ptLst+1),"忻州地区滹沱河管理信息系统--浏览资料");
}
break;
case LIN:
ptLst=_RectAskLinToList(ptAiLst,;frc,NULL);
if(ptLst ;; querybore_flage==false) {
_FlashLin(ptAiLst, ptLst+1,1);//ptLst[0]);
_ViewARcd(GetSafeHwnd(),ptAiLst,LIN,*(ptLst+1),"忻州地区滹沱河管理信息系统--浏览资料");
}
break;
case REG:
ptLst=_RectAskRegToList(ptAiLst,;frc,NULL);
if(ptLst ;; querybore_flage==false) {
_FlashReg(ptAiLst, ptLst+1, ptLst[0]);
_ViewARcd(GetSafeHwnd(),ptAiLst,REG,*(ptLst+1),"忻州地区滹沱河管理信息系统--浏览资料");
}
break;
default:
break;
}
}
}
}break;
default:break;
}</FONT></P><P><FONT color=#386490>}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnStopFlashPnt()
{
_StopFlash(PNT);//停止闪烁点
}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnStopFlashLin()
{
_StopFlash(LIN);//停止闪烁线
}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnStopFlashReg()
{
_StopFlash(REG);//停止闪烁区
}</FONT></P><P><FONT color=#386490>void CCGisView_Demo1View::OnEnlarge()
{//MessageBox("sdsdsd","vfsfsfs",MB_OK);
_SetCommandFlag(IDMN_ENLARGE);

}</FONT></P><P>
</P>
GIS麦田守望者,期待与您交流。
举报 回复(0) 喜欢(0)     评分
游客

返回顶部