| | |
| | | #include "afxdialogex.h"
|
| | | #include "PropSysReg1.h"
|
| | |
|
| | |
|
| | | #include <atlbase.h>
|
| | | #include <msxml6.h>
|
| | |
|
| | | #pragma comment(lib, "msxml6.lib")
|
| | |
|
| | | MHash gsd1;
|
| | |
|
| | |
|
| | | // CDialogSysRegSet 对话框
|
| | |
|
| | | IMPLEMENT_DYNAMIC(CDialogSysRegSet, CDialogEx)
|
| | |
| | | CDialogSysRegSet::CDialogSysRegSet(CWnd* pParent /*=nullptr*/)
|
| | | : CDialogEx(IDD_DIALOG_SYSREG_SET, pParent)
|
| | | {
|
| | |
|
| | | |
| | | }
|
| | |
|
| | | CDialogSysRegSet::~CDialogSysRegSet()
|
| | |
| | |
|
| | | // CDialogSysRegSet 消息处理程序
|
| | |
|
| | | int CDialogSysRegSet::LoadDeviceDescriptionFile()
|
| | | {
|
| | | // TODO: 在此处添加实现代码.
|
| | | gsd1.LoadFromFile(_T("FP0Ext.cfg"));
|
| | | CString s1;
|
| | |
|
| | | s1 = gsd1["configs"]["output1"];
|
| | |
|
| | | SysLog(s1);
|
| | |
|
| | | s1 = MyCfg1["dafd"]["sdfdf"];
|
| | |
|
| | | return 0;
|
| | | }
|
| | |
|
| | | int CDialogSysRegSet::AddPropPage(CString sName, CDialogEx & rDlg)
|
| | | {
|
| | | // TODO: 在此处添加实现代码.
|
| | |
| | | return 0;
|
| | | }
|
| | |
|
| | | int CDialogSysRegSet::testXmlParser()
|
| | | {
|
| | | // TODO: 在此处添加实现代码.
|
| | | CString s1;
|
| | | using namespace std;
|
| | |
|
| | | // TODO: 在此添加额外的初始化
|
| | | CoInitialize(NULL);
|
| | | //定义DOM模型中的文档对象
|
| | | CComPtr<IXMLDOMDocument> spXmldoc;
|
| | | //初始化库对象
|
| | | HRESULT hr = spXmldoc.CoCreateInstance(CLSID_DOMDocument60);
|
| | | s1.Format(_T("Create Instance Hr = %d "), hr);
|
| | | SysLog(s1);
|
| | | if (SUCCEEDED(hr))
|
| | | {
|
| | | //读取 xml 文件
|
| | | char *pPath = "config1.xml";
|
| | | CComBSTR Path = CComBSTR(pPath);
|
| | | //将XML文件导入内存中的文档对象
|
| | | VARIANT_BOOL success;
|
| | | hr = spXmldoc->load(CComVariant(Path), &success);
|
| | | s1.Format(_T("Load File Hr = %d "), hr);
|
| | | SysLog(s1);
|
| | | CComPtr<IXMLDOMNodeList> spChildren;
|
| | |
|
| | | spXmldoc->get_childNodes(&spChildren);
|
| | |
|
| | | int i = 0;
|
| | | long numChildren = 0;
|
| | | spChildren->get_length(&numChildren);
|
| | | s1.Format(_T("num of Children = %d "), numChildren);
|
| | | SysLog(s1);
|
| | | for (int i = 0; i < numChildren; i++) {
|
| | | CComPtr<IXMLDOMNode> spNode;
|
| | | CComBSTR NodeName;
|
| | | spChildren->get_item(i, &spNode);
|
| | | spNode->get_nodeName(&NodeName);
|
| | | CComPtr<IXMLDOMNodeList> spChildren2;
|
| | | spNode->get_childNodes(&spChildren2);
|
| | | long numChildren2 = 0;
|
| | | spChildren2->get_length(&numChildren2);
|
| | |
|
| | | CString s2;
|
| | | s2 = NodeName;
|
| | | s1.Format(_T("Root node %d name = %s num of Child %d "), i, s2, numChildren2);
|
| | | SysLog(s1);
|
| | | }
|
| | |
|
| | | // spXmldoc |
| | |
|
| | | // spXmldoc->Release();
|
| | | // spXmldoc.Release();
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | BOOL CDialogSysRegSet::OnInitDialog()
|
| | | {
|
| | | CDialogEx::OnInitDialog();
|
| | |
|
| | | // TODO: 在此添加额外的初始化
|
| | | testXmlParser();
|
| | | LoadDeviceDescriptionFile();
|
| | |
|
| | |
|
| | | m_listSel1.GetCount();
|
| | | AddPropPage(_T("工作模式设置1"), m_propmodecfg1);
|
| | |
| | | */
|
| | | m_nCurProp = j;
|
| | | }
|
| | |
|