zoukankan      html  css  js  c++  java
  • error C2065: 'theApp' : undeclared identifier

    解决办法一:
    在你要访问的地方的 .cpp 文件中加入
    extern C***App theApp;

    解决办法二:
    得到指向app的指针
    如 ((C***App *)AfxGetApp())->你的成员变量

    我是在主程序的头文件里添加就可以了:

    // five.h : main header file for the FIVE application
    //

    #if !defined(AFX_FIVE_H__0B197DD2_A92A_4BC8_9B02_88A17EC40DBE__INCLUDED_)
    #define AFX_FIVE_H__0B197DD2_A92A_4BC8_9B02_88A17EC40DBE__INCLUDED_

    #if _MSC_VER > 1000
    #pragma once
    #endif // _MSC_VER > 1000

    #ifndef __AFXWIN_H__
    #error include 'stdafx.h' before including this file for PCH
    #endif

    #include "resource.h" // main symbols

    /////////////////////////////////////////////////////////////////////////////
    // CFiveApp:
    // See five.cpp for the implementation of this class
    //

    class CFiveApp : public CWinApp
    {
    public:
    CFiveApp();

    // Overrides
    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CFiveApp)
    public:
    virtual BOOL InitInstance();
    //}}AFX_VIRTUAL

    // Implementation

    //{{AFX_MSG(CFiveApp)
    // NOTE - the ClassWizard will add and remove member functions here.
    // DO NOT EDIT what you see in these blocks of generated code !
    //}}AFX_MSG
    DECLARE_MESSAGE_MAP()
    public:
    CDatabase m_DB;
    };

    extern CFiveApp theApp;
    /////////////////////////////////////////////////////////////////////////////

    //{{AFX_INSERT_LOCATION}}
    // Microsoft Visual C++ will insert additional declarations immediately before the previous line.

    #endif // !defined(AFX_FIVE_H__0B197DD2_A92A_4BC8_9B02_88A17EC40DBE__INCLUDED_)
  • 相关阅读:
    Oracle函数列表速查
    Oreilly.Oracle.PL.SQL.Language.Pocket.Reference.2nd.Edition.eBookLiB
    SAP 查询跟踪监控,sql 执行计划
    删除IDOC
    Oracle可变参数的优化(转)
    ORACLE用户连接的管理
    批量处理change pointer 生成IDOC
    设置SAP后台的显示和修改
    如何增加SAP_ALL的权限
    BizTalk开发小技巧分拆和组装消息实例
  • 原文地址:https://www.cnblogs.com/xiaocai0923/p/2255593.html
Copyright © 2011-2022 走看看