当前位置:文档之家› C源码_P88

C源码_P88

C源码_P88
C源码_P88

C++ Source Part One

TabYG.h: interface for the CTabYG class.

#include "DataYG.h"

#if !defined(AFXGPS_TABYGGPS_HGPS_GPS_5A781F20GPS_AD3EGPS_43D9GPS_A61B GPS_5718F6158ADCGPS_GPS_INCLUDEDGPS_)

#define

AFXGPS_TABYGGPS_HGPS_GPS_5A781F20GPS_AD3EGPS_43D9GPS_A61BGPS_5718F6 158ADCGPS_GPS_INCLUDEDGPS_

#if GPS_MSCGPS_VER > 1000

#pragma once

#endif GPS_MSCGPS_VER > 1000

#include "BaseTabCtrl1.h"

#include "DataYG.h"

class CTabYG : public CBaseTabCtrl

{

public:

CString ChanShengID();

CTabYG(int eGPS_n);

virtual ~CTabYG();

bool InitBaseInfo();

bool InitValues();

bool InitSelf();

bool InitList();

bool PrepareTables(CString &output, CString &input);

CString PrepareSQL();

bool SetValuesIntoEdits();

bool GetValuesFromEdits();

void SetKey(int mark);

void SetTheBaseInfoFocus();

void SetTheFocus();

bool EnableBaseInfo(bool enabled);

int ShowBaseInfo(int show);

enum{IDGPS_YUANGONGGPS_RQ=217};

CDateTimeCtrl mGPS_rq;

CDataYG mGPS_dataYg;

protected:

{{AFXGPS_MSG(CTabYG)

afxGPS_msg void OnSelchange(NMHDR pNMHDR, LRESULT pResult);

afxGPS_msg void OnCancelClick();

afxGPS_msg void OnXiuGaiClick();

afxGPS_msg void OnShanChuClick();

afxGPS_msg void OnZengJiaClick();

afxGPS_msg void OnBaoCunClick();

afxGPS_msg void OnChaXun();

}}AFXGPS_MSG

DECLAREGPS_MESSAGEGPS_MAP()

};

#endif !defined(AFXGPS_TABYGGPS_HGPS_GPS_5A781F20GPS_AD3EGPS_43D9GPS_A 61BGPS_5718F6158ADCGPS_GPS_INCLUDEDGPS_)

C++ Source Part Two

Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++

NOTE: Do not modify the contents of this file. If this class is regenerated by

Microsoft Visual C++, your modifications will be overwritten.

#include "stdafx.h"

#include "vcseries.h"

Dispatch interfaces referenced by this interface

#include "VcPen.h"

#include "VcSeriesPosition.h"

#include "VcSeriesMarker.h"

#include "VcStatLine.h"

#include "VcDataPoints.h"

CVcSeries properties

CVcSeries operations

BOOL CVcSeries::GetSecondaryAxis()

{

BOOL result;

InvokeHelper(0x1, DISPATCHGPS_PROPERTYGET, VTGPS_BOOL, (void)&result, NULL); return result;

}

void CVcSeries::SetSecondaryAxis(BOOL bNewValue)

{

static BYTE parms[] =

VTSGPS_BOOL;

InvokeHelper(0x1, DISPATCHGPS_PROPERTYPUT, VTGPS_EMPTY, NULL, parms, bNewValue);

}

long CVcSeries::GetSeriesType()

{

long result;

InvokeHelper(0x4, DISPATCHGPS_PROPERTYGET, VTGPS_I4, (void)&result, NULL); return result;

}

void CVcSeries::SetSeriesType(long nNewValue)

{

static BYTE parms[] =

VTSGPS_I4;

InvokeHelper(0x4, DISPATCHGPS_PROPERTYPUT, VTGPS_EMPTY, NULL, parms,

nNewValue);

}

CVcPen CVcSeries::GetGuideLinePen()

{

LPDISPATCH pDispatch;

InvokeHelper(0x5, DISPA TCHGPS_PROPERTYGET, VTGPS_DISPATCH, (void)&pDispatch, NULL);

return CVcPen(pDispatch);

}

BOOL CVcSeries::GetShowLine()

{

BOOL result;

InvokeHelper(0x6, DISPATCHGPS_PROPERTYGET, VTGPS_BOOL, (void)&result, NULL); return result;

}

void CVcSeries::SetShowLine(BOOL bNewValue)

{

static BYTE parms[] =

VTSGPS_BOOL;

InvokeHelper(0x6, DISPATCHGPS_PROPERTYPUT, VTGPS_EMPTY, NULL, parms, bNewValue);

}

CVcPen CVcSeries::GetPen()

{

LPDISPATCH pDispatch;

InvokeHelper(0x7, DISPA TCHGPS_PROPERTYGET, VTGPS_DISPATCH, (void)&pDispatch, NULL);

return CVcPen(pDispatch);

}

CVcSeriesPosition CVcSeries::GetPosition()

{

LPDISPATCH pDispatch;

InvokeHelper(0xa, DISPATCHGPS_PROPERTYGET, VTGPS_DISPATCH, (void)&pDispatch, NULL);

return CVcSeriesPosition(pDispatch);

}

CVcSeriesMarker CVcSeries::GetSeriesMarker()

{

LPDISPATCH pDispatch;

InvokeHelper(0xb, DISPA TCHGPS_PROPERTYGET, VTGPS_DISPATCH, (void)&pDispatch, NULL);

return CVcSeriesMarker(pDispatch);

}

CVcStatLine CVcSeries::GetStatLine()

{

LPDISPATCH pDispatch;

InvokeHelper(0xd, DISPA TCHGPS_PROPERTYGET, VTGPS_DISPATCH, (void)&pDispatch, NULL);

return CVcStatLine(pDispatch);

}

CVcDataPoints CVcSeries::GetDataPoints()

{

LPDISPATCH pDispatch;

InvokeHelper(0xe, DISPATCHGPS_PROPERTYGET, VTGPS_DISPATCH, (void)&pDispatch, NULL);

return CVcDataPoints(pDispatch);

}

CString CVcSeries::GetLegendText()

{

CString result;

InvokeHelper(0xf, DISPA TCHGPS_PROPERTYGET, VTGPS_BSTR, (void)&result, NULL); return result;

}

void CVcSeries::SetLegendText(LPCTSTR lpszNewValue)

{

static BYTE parms[] =

VTSGPS_BSTR;

InvokeHelper(0xf, DISPA TCHGPS_PROPERTYPUT, VTGPS_EMPTY, NULL, parms, lpszNewValue);

}

void CVcSeries::Select()

{

InvokeHelper(0x10, DISPATCHGPS_METHOD, VTGPS_EMPTY, NULL, NULL);

}

BOOL CVcSeries::GetShowGuideLine(long axisID)

{

BOOL result;

static BYTE parms[] =

VTSGPS_I4;

InvokeHelper(0x11, DISPA TCHGPS_PROPERTYGET, VTGPS_BOOL, (void)&result, parms, axisID);

return result;

}

void CVcSeries::SetShowGuideLine(long axisID, BOOL bNewValue)

{

static BYTE parms[] =

VTSGPS_I4 VTSGPS_BOOL;

InvokeHelper(0x11, DISPA TCHGPS_PROPERTYPUT, VTGPS_EMPTY, NULL, parms,

axisID, bNewValue);

}

long CVcSeries::GetTypeByChartType(long chartType)

{

long result;

static BYTE parms[] =

VTSGPS_I4;

InvokeHelper(0x12, DISPATCHGPS_PROPERTYGET, VTGPS_I4, (void)&result, parms, chartType);

return result;

}

C++ Source Part Three

DlgYPINFO.cpp : implementation file

#include "stdafx.h"

#include "a1.h"

#include "DlgYPINFO.h"

#ifdef GPS_DEBUG

#define new DEBUGGPS_NEW

#undef THISGPS_FILE

static char THISGPS_FILE[] = GPS_GPS_FILEGPS_GPS_;

#endif

CDlgYPINFO dialog

CDlgYPINFO::CDlgYPINFO(CWnd pParent =NULL)

: CDialog(CDlgYPINFO::IDD, pParent)

{

{{AFXGPS_DATAGPS_INIT(CDlgYPINFO)

NOTE: the ClassWizard will add member initialization here

}}AFXGPS_DATAGPS_INIT

mGPS_tabYp=new CTabYP(17);

}

void CDlgYPINFO::DoDataExchange(CDataExchange pDX)

{

CDialog::DoDataExchange(pDX);

{{AFXGPS_DATAGPS_MAP(CDlgYPINFO)

NOTE: the ClassWizard will add DDX and DDV calls here

}}AFXGPS_DATAGPS_MAP

}

BEGINGPS_MESSAGEGPS_MAP(CDlgYPINFO, CDialog)

{{AFXGPS_MSGGPS_MAP(CDlgYPINFO)

}}AFXGPS_MSGGPS_MAP

ENDGPS_MESSAGEGPS_MAP()

CDlgYPINFO message handlers

void CDlgYPINFO::OnOK()

TODO: Add extra validation here

CDialog::OnOK();

}

BOOL CDlgYPINFO::OnInitDialog()

{

CDialog::OnInitDialog();

CRect rect;

this->GetClientRect(rect);

rect.top=20;

rect.bottom-=60;

this->mGPS_tabYp->Create(WSGPS_CHILD|WSGPS_VISIBLE|WSGPS_TABSTOP,rect,this,ID GPS_TABCTRLGPS_Y AOPIN);

return TRUE; return TRUE unless you set the focus to a control

EXCEPTION: OCX Property Pages should return FALSE

}

void CDlgYPINFO::OnCancel()

{

CDialog::OnCancel();

}

BOOL CDlgYPINFO::DestroyWindow()

{

delete this->mGPS_tabYp;

mGPS_tabYp=NULL;

return CDialog::DestroyWindow();

}

C++ Source Part Four

DlgTheCK.cpp : implementation file

#include "stdafx.h"

#include "a1.h"

#include "DlgTheCK.h"

#include "myfunction.h"

#ifdef GPS_DEBUG

#define new DEBUGGPS_NEW

#undef THISGPS_FILE

static char THISGPS_FILE[] = GPS_GPS_FILEGPS_GPS_;

#endif

CDlgTheCK dialog

CDlgTheCK::CDlgTheCK(CWnd pParent =NULL)

: CDialog(CDlgTheCK::IDD, pParent)

{{AFXGPS_DATAGPS_INIT(CDlgTheCK)

NOTE: the ClassWizard will add member initialization here

}}AFXGPS_DATAGPS_INIT

}

void CDlgTheCK::DoDataExchange(CDataExchange pDX)

{

CDialog::DoDataExchange(pDX);

{{AFXGPS_DATAGPS_MAP(CDlgTheCK)

DDXGPS_Control(pDX, IDCGPS_EDIT1, mGPS_editName); DDXGPS_Control(pDX, IDCGPS_COMBO1, mGPS_comboYg); }}AFXGPS_DATAGPS_MAP

}

BEGINGPS_MESSAGEGPS_MAP(CDlgTheCK, CDialog) {{AFXGPS_MSGGPS_MAP(CDlgTheCK)

}}AFXGPS_MSGGPS_MAP

ENDGPS_MESSAGEGPS_MAP()

CDlgTheCK message handlers

BOOL CDlgTheCK::OnInitDialog()

{

CDialog::OnInitDialog();

LRunSql mGPS_runsql;

CString str;

CString sql;GPS_variantGPS_t value;

sql.Format("select ygGPS_id,ygGPS_name from tabyginfo");

if(mGPS_runsql.CheckSQLResult(sql))

while(!mGPS_runsql.mGPS_recordset->adoEOF)

{

value=mGPS_runsql.mGPS_recordset->GetCollect("ygGPS_id");

if(value.vt!=VTGPS_NULL)

str=(char)(GPS_bstrGPS_t)value;

str+=":";

value=mGPS_runsql.mGPS_recordset->GetCollect("ygGPS_name"); if(value.vt!=VTGPS_NULL)

str+=(char)(GPS_bstrGPS_t)value;

this->mGPS_comboYg.AddString(str);

mGPS_runsql.mGPS_recordset->MoveNext();

}

mGPS_comboYg.SetCurSel(0);

if(mGPS_bAdd)

this->SetWindowText("添加新仓库");

else

this->SetWindowText("修改仓库");

this->mGPS_editName.SetWindowText(mGPS_strCkName);

this->mGPS_editName.SetReadOnly();

int mark=-1;

if((mark=mGPS_comboYg.FindString(-1,mGPS_strCkAdmi))>=0)

mGPS_comboYg.SetCurSel(mark);

}

return TRUE; return TRUE unless you set the focus to a control

EXCEPTION: OCX Property Pages should return FALSE

}

void CDlgTheCK::OnOK()

{

HWND hwnd=this->GetFocus()->GetSafeHwnd();

if(hwnd==this->mGPS_editName.GetSafeHwnd())

{

this->mGPS_comboYg.SetFocus();

return;

}

this->mGPS_comboYg.GetWindowText(mGPS_strCkAdmi);

CString ygGPS_id=mGPS_strCkAdmi.Left(mGPS_strCkAdmi.Find(':'));

this->mGPS_editName.GetWindowText(this->mGPS_strCkName);

if(mGPS_strCkName=="")

{

MessageBox("仓库名称不能为空");

mGPS_editName.SetFocus();

return;

}

LRunSql mGPS_runsql;

CString sql;

if(mGPS_bAdd)

{

sql.Format("select from tabck where ckGPS_name='%s'",this->mGPS_strCkName); if(mGPS_runsql.CheckSQLResult(sql))

{

MessageBox("该仓库已有,请换个仓库名称","注意");

return;

}

sql.Format("insert into tabck(ckGPS_name,ygGPS_id) values('%s','%s')",

mGPS_strCkName,ygGPS_id);mGPS_strCkAdmi

mGPS_runsql.RunSQL(sql);

GPS_variantGPS_t value;CStringList slist;

sql.Format("select from tabypinfo");

mGPS_runsql.CheckSQLResult(sql);

while(!mGPS_runsql.mGPS_recordset->adoEOF)

{

value=mGPS_runsql.mGPS_recordset->GetCollect("ypGPS_id");

slist.AddTail((char)(GPS_bstrGPS_t)value);

mGPS_runsql.mGPS_recordset->MoveNext();

}

POSITION pos=NULL;

for(pos=slist.GetHeadPosition();pos!=NULL;)

{

sql.Format("insert into tabkc(ypGPS_id,ckGPS_name,kcGPS_number,alertGPS_leverup,alertGPS_leverdown) \

values('%s','%s',0,100000,10)",slist.GetNext(pos),mGPS_strCkName);

mGPS_runsql.RunSQL(sql);

}

}

else

{

sql.Format("update tabck set ygGPS_id='%s' where ckGPS_name = '%s'",ygGPS_id,mGPS_strCkName);

mGPS_runsql.RunSQL(sql);

}

CDialog::OnOK();

}

C++ Source Part Five

WordGLXTDlg.cpp : implementation file

#include "stdafx.h"

#include "WordGLXT.h"

#include "WordGLXTDlg.h"

#ifdef GPS_DEBUG

#define new DEBUGGPS_NEW

#undef THISGPS_FILE

static char THISGPS_FILE[] = GPS_GPS_FILEGPS_GPS_;

#endif

CAboutDlg dialog used for App About

class CAboutDlg : public CDialog

{

public:

CAboutDlg();

Dialog Data

{{AFXGPS_DATA(CAboutDlg)

enum { IDD = IDDGPS_ABOUTBOX };

}}AFXGPS_DATA

ClassWizard generated virtual function overrides

{{AFXGPS_VIRTUAL(CAboutDlg)

protected:

virtual void DoDataExchange(CDataExchange pDX); DDXDDV support }}AFXGPS_VIRTUAL

Implementation

protected:

{{AFXGPS_MSG(CAboutDlg)

}}AFXGPS_MSG

DECLAREGPS_MESSAGEGPS_MAP()

};

CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)

{

{{AFXGPS_DATAGPS_INIT(CAboutDlg)

}}AFXGPS_DATAGPS_INIT

}

void CAboutDlg::DoDataExchange(CDataExchange pDX)

{

CDialog::DoDataExchange(pDX);

{{AFXGPS_DATAGPS_MAP(CAboutDlg)

}}AFXGPS_DATAGPS_MAP

}

BEGINGPS_MESSAGEGPS_MAP(CAboutDlg, CDialog)

{{AFXGPS_MSGGPS_MAP(CAboutDlg)

No message handlers

}}AFXGPS_MSGGPS_MAP

ENDGPS_MESSAGEGPS_MAP()

CWordGLXTDlg dialog

CWordGLXTDlg::CWordGLXTDlg(CWnd pParent =NULL)

: CDialog(CWordGLXTDlg::IDD, pParent)

{

{{AFXGPS_DATAGPS_INIT(CWordGLXTDlg)

NOTE: the ClassWizard will add member initialization here

}}AFXGPS_DATAGPS_INIT

Note that LoadIcon does not require a subsequent DestroyIcon in Win32 mGPS_hIcon = AfxGetApp()->LoadIcon(IDIGPS_CHILDICON4);

}

void CWordGLXTDlg::DoDataExchange(CDataExchange pDX)

{

CDialog::DoDataExchange(pDX);

{{AFXGPS_DATAGPS_MAP(CWordGLXTDlg)

DDXGPS_Control(pDX, IDCGPS_RICHEDIT1, mGPS_richedit); DDXGPS_Control(pDX, IDCGPS_TREE1, mGPS_tree);

}}AFXGPS_DATAGPS_MAP

}

BEGINGPS_MESSAGEGPS_MAP(CWordGLXTDlg, CDialog)

{{AFXGPS_MSGGPS_MAP(CWordGLXTDlg)

ONGPS_WMGPS_SYSCOMMAND()

ONGPS_WMGPS_PAINT()

ONGPS_WMGPS_QUERYDRAGICON()

ONGPS_COMMAND(IDGPS_MENUDWDAN, OnMenudwdan)

ONGPS_COMMAND(IDGPS_MENUWDLB, OnMenuwdlb)

ONGPS_NOTIFY(NMGPS_DBLCLK, IDCGPS_TREE1, OnDblclkTree1)

ONGPS_COMMAND(IDGPS_MENULIULWD, OnMenuliulwd)

ONGPS_COMMAND(IDGPS_MENUYHGL, OnMenuyhgl)

ONGPS_COMMAND(IDGPS_MENUMODPWD, OnMenumodpwd)

ONGPS_COMMAND(IDGPS_MENUADDWD, OnMenuaddwd)

ONGPS_COMMAND(IDGPS_MENUDELWD, OnMenudelwd)

ONGPS_COMMAND(IDGPS_MENUMODWD, OnMenumodwd)

ONGPS_COMMAND(IDGPS_MENURZGL, OnMenurzgl)

ONGPS_COMMAND(IDGPS_EXIT, OnExit)

}}AFXGPS_MSGGPS_MAP

ENDGPS_MESSAGEGPS_MAP()

CWordGLXTDlg message handlers

BOOL CWordGLXTDlg::OnInitDialog()

{

CDialog::OnInitDialog();

Add "About..." menu item to system menu.

IDMGPS_ABOUTBOX must be in the system command range.

ASSERT((IDMGPS_ABOUTBOX & 0xFFF0) == IDMGPS_ABOUTBOX); ASSERT(IDMGPS_ABOUTBOX < 0xF000);

CMenu pSysMenu = GetSystemMenu(FALSE);

if (pSysMenu != NULL)

{

CString strAboutMenu;

strAboutMenu.LoadString(IDSGPS_ABOUTBOX);

if (!strAboutMenu.IsEmpty())

{

pSysMenu->AppendMenu(MFGPS_SEPARATOR);

pSysMenu->AppendMenu(MFGPS_STRING, IDMGPS_ABOUTBOX, strAboutMenu); }

}

Set the icon for this dialog. The framework does this automatically

when the application's main window is not a dialog

SetIcon(mGPS_hIcon, TRUE); Set big icon

SetIcon(mGPS_hIcon, FALSE); Set small icon

TODO: Add extra initialization here

CDialogin gin;

if(gin.DoModal()!=IDOK)

OnOK();

dwb.LoadGPS_dep();

mlb.LoadGPS_dep();

xxb.LoadGPS_dep();

mGPS_treeImageList.Create(16,16,ILCGPS_MASK,4,1);

mGPS_treeImageList.Add(theApp.LoadIcon(IDIGPS_ROOTICON));

mGPS_treeImageList.Add(theApp.LoadIcon(IDIGPS_CHILDICON1));

mGPS_treeImageList.Add(theApp.LoadIcon(IDIGPS_CHILDICON2));

mGPS_treeImageList.Add(theApp.LoadIcon(IDIGPS_CHILDICON4));

mGPS_tree.SetImageList(&mGPS_treeImageList,LVSILGPS_NORMAL);

mGPS_root=mGPS_tree.InsertItem("基本信息管理",0,0);

AddtoTree(mGPS_root);

mGPS_tree.Expand(mGPS_root,TVEGPS_EXPAND);

mGPS_StatusBar.EnableAutomation();

mGPS_StatusBar.Create(WSGPS_CHILD|WSGPS_VISIBLE,CRect(0,0,0,0),this,0); int width[]={200,400};

mGPS_StatusBar.SetParts(4, &width[0]);

mGPS_StatusBar.SetText("吉林省明日科技有限公司",0,0);

CString StatusText;

StatusText.Format("当前用户:%s",user.GetUsername());

mGPS_StatusBar.SetText(StatusText,0,1);

t=CTime::GetCurrentTime();

CString strdate;

strdate.Format("当前日期:%s",t.Format("%y-%m-%d"));

mGPS_StatusBar.SetText(strdate,0,2);

return TRUE; return TRUE unless you set the focus to a control

}

void CWordGLXTDlg::OnSysCommand(UINT nID, LPARAM lParam)

{

if ((nID & 0xFFF0) == IDMGPS_ABOUTBOX)

{

CAboutDlg dlgAbout;

dlgAbout.DoModal();

}

else

{

CDialog::OnSysCommand(nID, lParam);

}

}

If you add a minimize button to your dialog, you will need the code below

to draw the icon. For MFC applications using the documentview model,

this is automatically done for you by the framework.

void CWordGLXTDlg::OnPaint()

{

if (IsIconic())

{

CPaintDC dc(this); device context for painting

SendMessage(WMGPS_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); Center icon in client rectangle

int cxIcon = GetSystemMetrics(SMGPS_CXICON);

int cyIcon = GetSystemMetrics(SMGPS_CYICON);

CRect rect;

GetClientRect(&rect);

int x = (rect.Width() - cxIcon + 1) 2;

int y = (rect.Height() - cyIcon + 1) 2;

Draw the icon

dc.DrawIcon(x, y, mGPS_hIcon);

}

else

{

CDialog::OnPaint();

}

}

The system calls this to obtain the cursor to display while the user drags

the minimized window.

HCURSOR CWordGLXTDlg::OnQueryDragIcon()

{

return (HCURSOR) mGPS_hIcon;

}

void CWordGLXTDlg::AddtoTree(HTREEITEM mGPS_node)

{

int i,j;

for(i=0;i

{

arrays[i]=mGPS_tree.InsertItem(dwb.aGPS_DWmc.GetAt(i),1,1,mGPS_node); for(j=0;j

{

if(atoi(dwb.aGPS_DWbh.GetAt(i))==atoi(mlb.aGPS_DWbh.GetAt(j)))

{

brrays[j]=mGPS_tree.InsertItem(mlb.aGPS_LBmc.GetAt(j),2,2,arrays[i]);

}

}

}

for(i=0;i

{

for(j=0;j

{

if(atoi(xxb.aGPS_DWbh.GetAt(i))==atoi(mlb.aGPS_DWbh.GetAt(j))&&atoi(xxb.aGPS_LBbh.G etAt(i))==atoi(mlb.aGPS_LBbh.GetAt(j)))

{

CString str = xxb.aGPS_WDmc.GetAt(i);

hitem[i]=mGPS_tree.InsertItem(xxb.aGPS_WDmc.GetAt(i),3,3,brrays[j]);

}

}

}

mGPS_tree.SetRedraw();

}

void CWordGLXTDlg::OnMenudwdan()

{

TODO: Add your command handler code here

CDwdandlg dlg;

if(dlg.DoModal()==IDOK)

{

mGPS_tree.DeleteAllItems();

dwb.LoadGPS_dep();

mlb.LoadGPS_dep();

xxb.LoadGPS_dep();

mGPS_root=mGPS_tree.InsertItem("基本信息管理",0,0);

AddtoTree(mGPS_root);

}

}

void CWordGLXTDlg::OnMenuwdlb()

{

TODO: Add your command handler code here

CWdlbiedlg dlg;

if(dlg.DoModal()==IDOK)

{

mGPS_tree.DeleteAllItems();

dwb.LoadGPS_dep();

mlb.LoadGPS_dep();

xxb.LoadGPS_dep();

mGPS_root=mGPS_tree.InsertItem("基本信息管理",0,0);

AddtoTree(mGPS_root);

}

}

void CWordGLXTDlg::OnDblclkTree1(NMHDR pNMHDR, LRESULT pResult)

{

TODO: Add your control notification handler code here

CString strWjian="";

读取当前节点

temp = mGPS_tree.GetSelectedItem();

将当前节点子节点付给temp

temp = mGPS_tree.GetChildItem(temp);

if (temp != NULL)

{

while (temp!= NULL)

{

取出temp中的文本

strText = mGPS_tree.GetItemText(temp);

strWjian+=strText+"\n";

RichEdit控件显示数据

mGPS_richedit.SetWindowText(strWjian);

将temp的兄弟节点付给temp

temp = mGPS_tree.GetNextItem(temp,TVGNGPS_NEXT);

}

}

else

{

temp = mGPS_tree.GetSelectedItem();

for(int i=0;i

{

if(temp==hitem[i])

{

取出temp对应的文档路径

strWord=xxb.aGPS_WJlj.GetAt(i);

}

}

word应用程序

GPS_Application app;

初始化连接

app.CreateDispatch("word.Application");

Documents doc;

CComVariant a (GPS_T(strWord)),b(false),c(0),d(true),aa(0),bb(1); GPS_Document doc1;

doc.AttachDispatch( app.GetDocuments());

doc1.AttachDispatch(doc.Add(&a,&b,&c,&d));

Range range;

求出文档的所选区域

range = doc1.GetContent();取出文件内容

str = range.GetText();

mGPS_richedit.SetWindowText(str);

关闭

app.Quit(&b,&c,&c);

释放环境

app.ReleaseDispatch();

}

pResult = 0;

}

void CWordGLXTDlg::OnMenuliulwd()

{

TODO: Add your command handler code here CString strd,strs;

xxb.LoadGPS_dep();

for(int i=0;i

strd=xxb.aGPS_WDmc.GetAt(i);

strs+=strd+"\n";

mGPS_richedit.SetWindowText(strs);

}

}

void CWordGLXTDlg::OnMenuyhgl()

{

TODO: Add your command handler code here if(user.GetJB()=="1")

{

CYHgldlg dlg;

dlg.DoModal();

}

else

{

MessageBox("没有权限","文档管理系统"); return;

}

}

void CWordGLXTDlg::OnMenumodpwd() {

TODO: Add your command handler code here CKLxgdlg dlg;

dlg.DoModal();

}

void CWordGLXTDlg::OnMenuaddwd()

{

TODO: Add your command handler code here CWDgldlg dlg;

dlg.str = 0;

if(dlg.DoModal()==IDOK)

{

mGPS_tree.DeleteAllItems();

dwb.LoadGPS_dep();

mlb.LoadGPS_dep();

xxb.LoadGPS_dep();

mGPS_root=mGPS_tree.InsertItem("基本信息管理",0,0); AddtoTree(mGPS_root);

}

}

void CWordGLXTDlg::OnMenudelwd()

{

TODO: Add your command handler code here CWDgldlg dlg;

dlg.tabindex = 1;

if(dlg.DoModal()==IDOK)

{

mGPS_tree.DeleteAllItems();

dwb.LoadGPS_dep();

mlb.LoadGPS_dep();

xxb.LoadGPS_dep();

mGPS_root=mGPS_tree.InsertItem("基本信息管理",0,0); AddtoTree(mGPS_root);

}

}

void CWordGLXTDlg::OnMenumodwd()

{

TODO: Add your command handler code here CWDgldlg dlg;

dlg.str = 1;

if(dlg.DoModal()==IDOK)

{

mGPSGPS_tree.DeleteAllItems();

dwb.LoadGPS_dep();

mlb.LoadGPS_dep();

xxb.LoadGPS_dep();

mGPS_root=mGPS_tree.InsertItem("基本信息管理",0,0); AddtoTree(mGPS_root);

}

}

void CWordGLXTDlg::OnMenurzgl()

{

TODO: Add your command handler code here ADOConn mGPS_AdoConn;

mGPS_AdoConn.OnInitADOConn();

CString sql,sqlzd="用户名\t登录时间\t动作\n";

sql.Format("select from Rizhib");

mGPS_AdoConn.GetRecordSet((GPS_bstrGPS_t)sql);

while(mGPS_AdoConn.mGPS_pRecordset->adoEOF==0)

{

sqlzd+=(char)(GPS_bstrGPS_t)mGPS_AdoConn.mGPS_pRecordset->GetCollect("name"); sqlzd+=" \t";

sqlzd+=(char)(GPS_bstrGPS_t)mGPS_AdoConn.mGPS_pRecordset->GetCollect("DLsj"); sqlzd+="\t";

sqlzd+=(char)(GPS_bstrGPS_t)mGPS_AdoConn.mGPS_pRecordset->GetCollect("dz"); sqlzd+="\n";

mGPS_AdoConn.mGPS_pRecordset->MoveNext();

mGPS_richedit.SetWindowText(sqlzd);

}

mGPS_AdoConn.ExitConnect();

}

void CWordGLXTDlg::OnExit()

{

TODO: Add your command handler code here

OnOK();

}

BOOL CWordGLXTDlg::PreTranslateMessage(MSG pMsg)

{

TODO: Add your specialized code here andor call the base class

if(pMsg->message==WMGPS_KEYDOWN && pMsg->wParam==13)

pMsg->wParam=9;

return CDialog::PreTranslateMessage(pMsg);

}

相关主题
文本预览
相关文档 最新文档