scintilla在对话框中的应用 在网上找了一些资料,试了几次,都没有成功.请高人指教啊!怎样把scintilla应用到MFC的对话框程序中.我在导入.DLL的时候就出错了.最好是有详细的步骤.有截图最好了,谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 创建的时候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; }没成功 可以参考这个:http://blog.csdn.net/jack_china2008 看你这代码就是来自 《语法高亮编辑控件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); } 哈哈,我又回来了 如何让一个对话框程序在双击运行后直接最小化? 关于孙鑫vc socket教程 的编译 WebBrowser窗口中JS刷新问题 <<高分>>数据库问题 List Control 如何选中整行? 救命啊,用ADO访问ACCESS,调试成功,换到另外一台电脑就不行了 【急问高手】关于ATL开发ActiveX控件的问题!在线等待! 你好 VC 6.0中可以正常编译但是按F5无法运行程序 关于自定义消息的问题 如何判断一个窗口已经完全隐藏
{
AfxMessageBox("Can't create scintilla!");
return -1;
}
没成功
//-------------------------------------------------------
// 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);
}