在网上找了一些资料,试了几次,都没有成功.请高人指教啊!怎样把scintilla应用到MFC的对话框程序中.我在导入.DLL的时候就出错了.最好是有详细的步骤.有截图最好了,谢谢!

解决方案 »

  1.   

    创建的时候if(!m_wndScintilla.Create(WS_EX_CLIENTEDGE, WS_CHILD | WS_VISIBLE, CRect(0,0,lpCreateStruct->cx,lpCreateStruct->cy),this,10000)) 

    AfxMessageBox("Can't create scintilla!");
    return -1;
    }
    没成功
      

  2.   

    可以参考这个:http://blog.csdn.net/jack_china2008
      

  3.   

    看你这代码就是来自 《语法高亮编辑控件Scintilla在MFC中的简单使用》 这个文章。如果是VC6,你不要用类向导去创建CScintillaWnd类,直接复制他这个文章里的代码。我在VC6和VS2010中的MFC都成功了。VS2010反正是怎么样都可以了。
    //-------------------------------------------------------    
    // ScintillaWnd.h    
    #pragma once    
       
    //注意:这俩文件来自Scintilla的include目录    
    #include "Scintilla.h"    
    #include "SciLexer.h"    
    // CScintillaWnd    
    class CScintillaWnd : public CWnd    
    {    
        DECLARE_DYNAMIC(CScintillaWnd)    
    public:    
        CScintillaWnd();    
        virtual ~CScintillaWnd();    
    protected:    
        DECLARE_MESSAGE_MAP()    
    public:    
        virtual BOOL Create(    
            DWORD dwExStyle, DWORD dwStyle,const RECT& rect,     
            CWnd* pParentWnd, UINT nID);    
       
    };    
       
    //-------------------------------------------------------    
       
    // ScintillaWnd.cpp : 实现文件    
    #include "stdafx.h"    
    #include "ColorTextBox.h"    
    #include "ScintillaWnd.h"    
       
    // CScintillaWnd    
    IMPLEMENT_DYNAMIC(CScintillaWnd, CWnd)    
    CScintillaWnd::CScintillaWnd()    
    {    
    }    
       
    CScintillaWnd::~CScintillaWnd(){}    
       
    BEGIN_MESSAGE_MAP(CScintillaWnd, CWnd)    
    END_MESSAGE_MAP()    
       
    // CScintillaWnd 消息处理程序    
    BOOL CScintillaWnd::Create(DWORD dwExStyle, DWORD dwStyle,const RECT& rect, CWnd* pParentWnd, UINT nID)    
       
    {    
        // TODO: 在此添加专用代码和/或调用基类    
        return CWnd::CreateEx(dwExStyle,"Scintilla","",dwStyle,rect,pParentWnd,nID);    
    }