首页 新闻 论坛 群组 Blog 文档 下载 读书 Tag 网摘 搜索 .NET Java 游戏 视频 人才 外包 培训 数据库 书店 程序员
中国软件网
欢迎您:游客 | 登录 注册 帮助
  • 运行VC写的程序,出现的错误...请高手指点...??? [已结贴,结贴人:ismycxp]
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2008-05-17 19:14:32 楼主
    在本机运行很正常,BUG和Release都试过了,都出现异常

    如下:

    this application has requested the runtime to terminate it in an unusual way.please contact the application's support team for more information

    试了7台电脑,其中有二台电脑出现这样的异常,其它正常...

    请问应该如何解决这样的问题,

    我用的是VS2008编译的...

    请高手指点...谢谢!
    100  修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2008-05-17 19:27:411楼 得分:0
    debug啊,根据这个哪能知道原因,不debug是不可能知道答案得。首先要尽量加日志,知道代码在哪出现异常
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2008-05-17 19:47:182楼 得分:0
    会不会是运行时文件冲突的原因?
    把所需的运行时文件重新拷到那些机子上再运行看看。
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2008-05-17 19:48:363楼 得分:0
    找到错误源了,原来是我引用过来的CXML类出现了问题

    其中有这样的代码
    XML.H
    C/C++ code
    #pragma once #import "msxml3.dll" // msxml3.dll or msxml4.dll or msxml5.dll or msxml6.dll #include <memory> #ifndef ASSERT #define ASSERT ATLASSERT #endif #ifndef TRACE #define TRACE ATLTRACE #endif namespace MSXML2 { struct __declspec(uuid("f6d90f11-9c73-11d3-b32e-00c04f990bb4")) DOMDocument; struct __declspec(uuid("f5078f1b-c551-11d3-89b9-0000f81fe221")) DOMDocument26; struct __declspec(uuid("f5078f32-c551-11d3-89b9-0000f81fe221")) DOMDocument30; struct __declspec(uuid("88d969c0-f192-11d4-a65f-0040963251e5")) DOMDocument40; struct __declspec(uuid("88d969e5-f192-11d4-a65f-0040963251e5")) DOMDocument50; struct __declspec(uuid("88d96a05-f192-11d4-a65f-0040963251e5")) DOMDocument60; } #ifndef RELEASE_PTR #define RELEASE_PTR(x) \ if( x != NULL ) \ { \ x.Release(); \ x = NULL; \ } #endif namespace Generic { class CXml; class CXmlNode; class CXmlNodes; typedef std::auto_ptr<CXmlNode> CXmlNodePtr; typedef std::auto_ptr<CXmlNodes> CXmlNodesPtr; } #include "XmlNodes.h" namespace Generic { class CXmlNode { friend class CXml; friend class CXmlNode; friend class CXmlNodes; protected: MSXML2::IXMLDOMNodePtr m_pNode; CXmlNode( MSXML2::IXMLDOMNodePtr pNode); BOOL _GetValue(CString & strValue) const; BOOL _SetValue(CString & strValue) const; BOOL _GetAttribute( CString & strName, CString & strValue) const; BOOL _SetAttribute( CString & strName IN , CString & strValue IN , CString & strPrefix IN , CString & strNamespaceURI IN ) const; public: // _____________ //______| constructor |___________________________________________________________________ CXmlNode(void); CXmlNode(const CXmlNode & refNode IN); CXmlNode(const CXmlNodePtr pNode IN); ~CXmlNode(void); // _______________ //______| override = |___________________________________________________________________ CXmlNodePtr operator = (CXmlNodePtr pNode); CXmlNode & operator = (const CXmlNode & refNode); BOOL IsNull(void) const; // Whether the current element exist CString GetName(void) const;// Get the name of the current node CXmlNode & Detach(void); // Detach the current node void Release(void); // Release this node // _______________ //______|Parent - Child |___________________________________________________________________ CXmlNodePtr GetChild( CString strName, BOOL bBuildIfNotExist = TRUE); CXmlNodePtr NewChild( CString strName ); CXmlNodePtr GetParent(void); CXmlNodesPtr GetChildren(); void AttachChild( CXmlNodePtr & pChildNode); void AttachChild( CXmlNode & refChildNode); BOOL HasChildren(void); BOOL RemoveChildren(void); // _______________ //______| attribute |___________________________________________________________________ CString GetAttribute( CString strName, LPCTSTR lpszDefault = NULL) const; bool GetAttribute( CString strName, bool bDefault) const; int GetAttribute( CString strName, int nDefault) const; long GetAttribute( CString strName, long lDefault) const; __int64 GetAttribute( CString strName, __int64 llDefault) const; float GetAttribute( CString strName, float fDefault) const; double GetAttribute( CString strName, double dDefault) const; DWORD GetAttribute( CString strName, DWORD dwDefault) const; BOOL SetAttribute( CString strName, LPCTSTR lpszValue , CString strPrefix = _T(""), CString strNamespaceURI = _T("")); BOOL SetAttribute( CString strName, bool bValue , CString strPrefix = _T(""), CString strNamespaceURI = _T("")); BOOL SetAttribute( CString strName, int nValue , CString strPrefix = _T(""), CString strNamespaceURI = _T("")); BOOL SetAttribute( CString strName, long lValue , CString strPrefix = _T(""), CString strNamespaceURI = _T("")); BOOL SetAttribute( CString strName, __int64 llValue , CString strPrefix = _T(""), CString strNamespaceURI = _T("")); BOOL SetAttribute( CString strName, float fValue , CString strPrefix = _T(""), CString strNamespaceURI = _T("")); BOOL SetAttribute( CString strName, double dValue , CString strPrefix = _T(""), CString strNamespaceURI = _T("")); BOOL SetAttribute( CString strName, DWORD dwValue , CString strPrefix = _T(""), CString strNamespaceURI = _T("")); BOOL RemoveAttribute( CString strName ); // _______ //______| value |___________________________________________________________________ CString GetValue( LPCTSTR lpszDefault = NULL ) const; bool GetValue( bool bDefault ) const; int GetValue( int nDefault) const; long GetValue( long lDefault) const; __int64 GetValue( __int64 llDefault) const; float GetValue( float fDefault) const; double GetValue( double dDefault) const; DWORD GetValue( DWORD dwDefault) const; BOOL SetValue( LPCTSTR lpszValue ); BOOL SetValue( bool bValue ); BOOL SetValue( int nValue ); BOOL SetValue( long lValue ); BOOL SetValue( __int64 llValue ); BOOL SetValue( float fValue ); BOOL SetValue( double dValue ); BOOL SetValue( DWORD dwValue ); CXmlNodePtr SelectSingleNode(LPCTSTR lpszPath); CXmlNodesPtr SelectNodes(LPCTSTR lpszPath); // _______________________ //______| InnerXml OuterXml |___________________________________________________________________ CString GetOuterXml(void) const; CString GetInnerXml(void) const; }; }


    可是为什么会出错,我还是不知道...如何是好?
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2008-05-17 19:50:384楼 得分:0
    就是因为加入了XML操作才出现的问题,

    现在却不知道是哪错了...为什么会出错...

    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2008-05-17 20:10:005楼 得分:0
    谁有更好的XML操作类...太痛苦了..............
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2008-05-17 20:17:156楼 得分:50
    CMarkup,XML操作类。google一下资源很多。也有使用方法!
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2008-05-17 20:25:287楼 得分:0
    CMarkup依赖于MSXML吗?
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2008-05-17 20:44:408楼 得分:0
    学习
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2008-05-17 21:01:099楼 得分:50
    如果你用XML文件作为配置文件的话,建议用开源的tinyXML,轻量、高效,使用简单。
    修改 删除 举报 引用 回复

    网站简介广告服务网站地图帮助联系方式诚聘英才English 问题报告
    北京创新乐知广告有限公司 版权所有 京 ICP 证 070598 号
    世纪乐知(北京)网络技术有限公司 提供技术支持
    Copyright © 2000-2008, CSDN.NET, All Rights Reserved