empireman
发表于 2006-8-31 18:27:00
多谢
apsmould
发表于 2006-9-13 12:10:00
<P>王老师,请教一下,我想单独用arx写个显示屏幕刷新命令。</P>
<P><BR>#include "StdAfx.h"<BR>#include "StdArx.h"</P>
<P>// This is command 'REE'<BR>void apsree()<BR>{<BR> acutPrintf("刷新实体:");<BR> actrTransactionManager->flushGraphics(); <BR> acedUpdateDisplay(); </P>
<P> acutPrintf("OK!");<BR> return;<BR> // TODO: Implement the command</P>
<P>}</P>
<P>编译结果如下,请问怎么解决?</P>
<P>--------------------Configuration: ree - Win32 Debug--------------------<BR>Compiling...<BR>reeCommands.cpp<BR> Compiling STL header files in release mode.<BR>E:\test\ree\reeCommands.cpp(14) : error C2065: 'actrTransactionManager' : undeclared identifier<BR>E:\test\ree\reeCommands.cpp(14) : error C2227: left of '->flushGraphics' must point to class/struct/union<BR>Error executing cl.exe.</P>
<P>reeCommands.obj - 2 error(s), 0 warning(s)<BR></P>
王咣生
发表于 2006-9-16 16:24:00
引用actrans.h没有?
JOLMO
发表于 2006-9-24 21:01:00
谢谢,,MSN:<A href="mailto:exceedyjh@hotmail.com" target="_blank" >exceedyjh@hotmail.com</A>(同岩),我也是刚学学,多多指教,多多交流。
apsmould
发表于 2006-10-10 17:00:00
<P>引用了#include"actrans.h"还是同样的错误.......</P>
<P>是不是还缺少哪个库文件?</P>
ingerseu
发表于 2006-11-3 10:10:00
<P>好帖</P>
<P> </P>
JOLMO
发表于 2006-11-9 18:16:00
<P>最近我遇到个问题,我自己下载了个DockBar作为控件,没用Acui的,但是还是存在首次Dock到CAD边界时候,高度不够,没有填充完整。</P>
<P>希望那位大哥解惑</P>
<P> </P>
<P>// add the define</P>
<P><BR>#include "StdAfx.h"<BR>#include "DockBar.h"<BR>#include "Resource.h"<BR>#ifdef _DEBUG<BR>#define new DEBUG_NEW<BR>#undef THIS_FILE<BR>static char THIS_FILE[] = __FILE__;<BR>#endif</P>
<P> </P>
<P>/////////////////////////////////////////////////////////////////////////////<BR>// CMyBar</P>
<P>CMyDockBar::CMyDockBar()<BR>{<BR>}</P>
<P>CMyDockBar::~CMyDockBar()<BR>{<BR>}</P>
<P><BR>BEGIN_MESSAGE_MAP(CMyDockBar, baseCMyBar)<BR> //{{AFX_MSG_MAP(CMyDockBar)<BR> ON_WM_CREATE()<BR> ON_WM_LBUTTONUP()</P>
<P><BR> <BR> //}}AFX_MSG_MAP</P>
<P> <BR> ON_NOTIFY(TCN_SELCHANGE, IDC_TAB, OnTcnSelchangeTab)<BR> ON_NOTIFY(NM_DBLCLK, IDC_TREE, OnNMDblclkTree)<BR>// ON_NOTIFY(WM_WINDOWPOSCHANGED,IDD_DOCKBAR,OnWindowPosChanging)<BR> <BR>END_MESSAGE_MAP()</P>
<P>//ON_NOTIFY(TCN_SELCHANGE, IDC_TAB, OnTcnSelchangeTab)</P>
<P><BR>/////////////////////////////////////////////////////////////////////////////<BR>// CMyDockBar message handlers</P>
<P>int CMyDockBar::OnCreate(LPCREATESTRUCT lpCreateStruct) <BR>{</P>
<P> </P>
<P> CAcModuleResourceOverride resourceOverride ;</P>
<P> if (baseCMyBar::OnCreate(lpCreateStruct) == -1)<BR> return -1;</P>
<P> SetSCBStyle(GetSCBStyle() | SCBS_SIZECHILD);</P>
<P> </P>
<P> </P>
<P> </P>
<P><BR> //m_wndChild = new CChildDlg;</P>
<P> //m_wndChild->Create(IDD_DIALOG1,this);<BR> ////m_wndChild->OnInitDialog();<BR> //m_wndChild->MoveWindow(0, 0, 100, 100, TRUE);<BR> <BR> /*if (!m_wndChild.Create(WS_CHILD|WS_VISIBLE|<BR> ES_MULTILINE|ES_WANTRETURN|ES_AUTOVSCROLL,<BR> CRect(0,0,0,0), this, 123))<BR> return -1;*/<BR> /*if (!m_wndIBTab.Create(WS_CHILD|WS_VISIBLE|WS_TABSTOP,CRect(0, 0, 0, 0), this, 100))<BR> {</P>
<P> m_wndIBTab.ModifyStyleEx(0, WS_EX_CLIENTEDGE);</P>
<P> m_wndIBTab.InsertItem(0,_T("隧道设计"));<BR> m_wndIBTab.InsertItem(1,_T("隧道监测"));<BR> m_wndIBTab.InsertItem(2,_T("隧道施工"));<BR> <BR> }<BR> m_wndIBTab.MoveWindow(0,0,200,600,TRUE);*/</P>
<P><BR> <BR> <BR> <BR> <BR> //if (!m_wndIBTree.Create(WS_CHILD|WS_VISIBLE|<BR> // TVS_HASLINES|TVS_HASBUTTONS|TVS_LINESATROOT,<BR> // Trect, this, 100))<BR> //{<BR> // TRACE0("Failed to create instant bar child\n");<BR> // return -1; // fail to create<BR> //}</P>
<P> //m_wndIBTree.ModifyStyleEx(0, WS_EX_CLIENTEDGE);</P>
<P><BR> //// populate the treectrl<BR> //HTREEITEM hti = m_wndIBTree.InsertItem(_T("Node 1"));<BR> //m_wndIBTree.InsertItem(_T("Node 2"));<BR> //m_wndIBTree.InsertItem(_T("SubNode 11"), hti);<BR> //m_wndIBTree.InsertItem(_T("SubNode 12"), hti);<BR> //m_wndIBTree.InsertItem(_T("SubNode 13"), hti);<BR> //m_wndIBTree.InsertItem(_T("SubNode 14"), hti);<BR> //m_wndIBTree.InsertItem(_T("SubNode 15"), hti);<BR> //m_wndIBTree.InsertItem(_T("SubNode 16"), hti);<BR> //m_wndIBTree.InsertItem(_T("SubNode 17"), hti);<BR> //m_wndIBTree.InsertItem(_T("SubNode 18"), hti);<BR> //m_wndIBTree.InsertItem(_T("SubNode 19"), hti);<BR> //m_wndIBTree.InsertItem(_T("SubNode 121"), hti);<BR> //m_wndIBTree.InsertItem(_T("SubNode 122"), hti);</P>
<P><BR> //m_wndIBTree.MoveWindow(0,0,100,600,TRUE);</P>
<P> <BR> <BR> <BR> <BR>if (m_Tab.Create(WS_CHILD|WS_VISIBLE,CRect(0,0,200,6000),this,IDC_TAB))<BR>{</P>
<P> m_Tab.ModifyStyleEx(0, WS_EX_CLIENTEDGE);</P>
<P> m_Tab.InsertItem(0,_T("隧道设计"));<BR> m_Tab.InsertItem(1,_T("隧道监测"));<BR> m_Tab.InsertItem(2,_T("隧道施工"));</P>
<P> //m_Tab.MoveWindow(0,0,200,600);</P>
<P> </P>
<P> if (!m_wndIBTree.Create(WS_CHILD|WS_VISIBLE|<BR> TVS_HASLINES|TVS_HASBUTTONS|TVS_LINESATROOT,<BR> CRect(0,30,200,6000), &m_Tab, IDC_TREE))<BR> {<BR> TRACE0("Failed to create instant bar child\n");<BR> return -1; // fail to create<BR> }</P>
<P> m_wndIBTree.ModifyStyleEx(0, WS_EX_CLIENTEDGE);</P>
<P><BR> // populate the treectrl<BR> HTREEITEM hti = m_wndIBTree.InsertItem(_T("Node 1"));<BR> m_wndIBTree.InsertItem(_T("Node 2"));<BR> m_wndIBTree.InsertItem(_T("SubNode 11"), hti);<BR> m_wndIBTree.InsertItem(_T("SubNode 12"), hti);<BR> m_wndIBTree.InsertItem(_T("SubNode 13"), hti);<BR> m_wndIBTree.InsertItem(_T("SubNode 14"), hti);<BR> m_wndIBTree.InsertItem(_T("SubNode 15"), hti);<BR> m_wndIBTree.InsertItem(_T("SubNode 16"), hti);<BR> m_wndIBTree.InsertItem(_T("SubNode 17"), hti);<BR> m_wndIBTree.InsertItem(_T("SubNode 18"), hti);<BR> m_wndIBTree.InsertItem(_T("SubNode 19"), hti);<BR> m_wndIBTree.InsertItem(_T("SubNode 121"), hti);<BR> m_wndIBTree.InsertItem(_T("SubNode 122"), hti);</P>
<P><BR> m_wndIBTree.MoveWindow(0,30,200,600,TRUE);</P>
<P> <BR>}</P>
<P> // --- end instant bar creation and child setup ---</P>
<P> </P>
<P> //m_wndChild.ModifyStyleEx(0, WS_EX_CLIENTEDGE);</P>
<P> //// older versions of Windows* (NT 3.51 for instance)<BR> //// fail with DEFAULT_GUI_FONT<BR> //if (!m_font.CreateStockObject(DEFAULT_GUI_FONT))<BR> // if (!m_font.CreatePointFont(80, _T("MS Sans Serif")))<BR> // return -1;</P>
<P> //m_wndChild.SetFont(&m_font);</P>
<P> return 0;<BR>}</P>
<P> void CMyDockBar::OnTcnSelchangeTab(NMHDR *pNMHDR, LRESULT *pResult)<BR>{<BR> // TODO: Add your control notification handler code here<BR> if (m_Tab.GetCurSel()==0)<BR> {<BR> m_wndIBTree.ShowWindow(SW_SHOW);<BR> <BR> }<BR> if (m_Tab.GetCurSel()==1)<BR> {<BR> m_wndIBTree.ShowWindow(SW_HIDE);<BR> </P>
<P> }<BR> if (m_Tab.GetCurSel()==2)<BR> {<BR> m_wndIBTree.ShowWindow(SW_HIDE);</P>
<P> }</P>
<P>}</P>
<P> void CMyDockBar::OnNMDblclkTree(NMHDR *pNMHDR, LRESULT *pResult)<BR> {<BR> // TODO: Add your control notification handler code here<BR> NMTVDISPINFO* pNMTreeView = (NMTVDISPINFO*)pNMHDR;</P>
<P> CString szText;<BR> HTREEITEM Item2; </P>
<P><BR> Item2 = m_wndIBTree.GetSelectedItem();<BR> szText = m_wndIBTree.GetItemText(Item2);<BR> if (szText==_T("SubNode 11"))<BR> {<BR> CChildDlgII dlg1;<BR> dlg1.DoModal();<BR> }</P>
<P> if (szText==_T("SubNode 12"))<BR> {<BR> CChildDlgII Dlg2;<BR> Dlg2.DoModal();<BR> }</P>
<P> *pResult = 0;<BR> }</P>
<P> void CMyDockBar::OnLButtonUp(UINT nFlags, CPoint point)<BR> {<BR> if (m_bTracking)<BR> StopTracking();</P>
<P> baseCMyBar::OnLButtonUp(nFlags, point);</P>
<P> MoveWindow(0,0,200,600);<BR> }</P>
<P> void CMyDockBar::OnSize(UINT nType, int cx, int cy)<BR> {<BR> baseCMyBar::OnSize(nType, cx, cy);</P>
<P> SetWindowPos(acedGetAcadFrame(),0,0,200,600,TRUE);<BR> }</P>
<P> </P>
<P><BR>//////////////////////////////////////////////////////////////////////////</P>
<P>BOOL InitApp()<BR>{<BR> CMyDockBar *m_wndInstantBar = NULL;<BR> //CTreeCtrl m_wndIBTree;<BR> //HTREEITEM TreeItem;</P>
<P> CAcModuleResourceOverride res;</P>
<P> // --- instant bar ---<BR> </P>
<P> if ( !m_wndInstantBar)<BR> {<BR> m_wndInstantBar = new CMyDockBar;</P>
<P> </P>
<P> <BR> if (!m_wndInstantBar->Create(_T("Instant Bar"), acedGetAcadFrame(), <BR> IDD_DOCKBAR,WS_CHILD|WS_VISIBLE|CBRS_ALIGN_LEFT|CBRS_SIZE_DYNAMIC))<BR> {<BR> TRACE0("Failed to create instant bar\n");<BR> return -1; // fail to create<BR> }<BR> m_wndInstantBar->SetSCBStyle(m_wndInstantBar->GetSCBStyle() |<BR> SCBS_SIZECHILD);</P>
<P> acedGetAcadFrame()->EnableAutomation();</P>
<P> </P>
<P> <BR> //if (!m_wndIBTree.Create(WS_CHILD|WS_VISIBLE|<BR> // TVS_HASLINES|TVS_HASBUTTONS|TVS_LINESATROOT,<BR> // CRect(0, 0, 0, 0), m_wndInstantBar, 100))<BR> //{<BR> // TRACE0("Failed to create instant bar child\n");<BR> // return -1; // fail to create<BR> //}<BR> //m_wndIBTree.ModifyStyleEx(0, WS_EX_CLIENTEDGE);</P>
<P> //<BR> //// populate the treectrl<BR> //HTREEITEM hti = m_wndIBTree.InsertItem(_T("Node 1"));<BR> //m_wndIBTree.InsertItem(_T("Node 2"));<BR> //m_wndIBTree.InsertItem(_T("SubNode 11"), hti);<BR> //m_wndIBTree.InsertItem(_T("SubNode 12"), hti);<BR> // --- end instant bar creation and child setup ---</P>
<P> m_wndInstantBar->SetBarStyle(m_wndInstantBar->GetBarStyle() |<BR> CBRS_TOOLTIPS | CBRS_FLYBY );</P>
<P> m_wndInstantBar->EnableAutomation();<BR> </P>
<P> //m_wndInstantBar.EnableDocking(CBRS_ALIGN_LEFT|CBRS_ALIGN_RIGHT);<BR> m_wndInstantBar->EnableDocking(CBRS_ALIGN_LEFT|CBRS_ALIGN_RIGHT|CBRS_ALIGN_TOP);</P>
<P><BR> //<BR> //#ifdef _SCB_REPLACE_MINIFRAME<BR> // m_pFloatingFrameClass = RUNTIME_CLASS(CSCBMiniDockFrameWnd);<BR> //<BR> // <BR> //#endif //_SCB_REPLACE_MINIFRAME AFX_IDW_DOCKBAR_LEFT</P>
<P> <BR> //acedGetAcadFrame()->DockControlBar(m_wndInstantBar,AFX_IDW_DOCKBAR_TOP,NULL);</P>
<P> acedGetAcadFrame()->FloatControlBar (m_wndInstantBar, CPoint(100, 100), CBRS_ALIGN_LEFT|CBRS_ALIGN_TOP|CBRS_ALIGN_RIGHT);<BR> <BR> acedGetAcadFrame ()->ShowControlBar (m_wndInstantBar, !m_wndInstantBar->IsVisible(), TRUE);<BR> //acedGetAcadFrame()->FloatControlBar (m_wndInstantBar, CPoint(100, 100), CBRS_ALIGN_LEFT|CBRS_ALIGN_TOP|CBRS_ALIGN_RIGHT);</P>
<P> </P>
<P> //RestoreControlBar(AFX_IDW_DOCKBAR_LEFT , lpRect);<BR> <BR> acedGetAcadFrame()->RecalcLayout(TRUE);<BR> <BR> }</P>
<P> if(!m_wndInstantBar->IsVisible())<BR> {<BR> acedGetAcadFrame ()->ShowControlBar (m_wndInstantBar, !m_wndInstantBar->IsVisible(), TRUE);<BR> <BR> }<BR> //DockControlBar(&m_wndInstantBar, AFX_IDW_DOCKBAR_LEFT);<BR> //ShowControlBar(&m_wndInstantBar, !m_wndInstantBar.IsVisible(), FALSE);</P>
<P><BR> return TRUE;</P>
<P><BR>}</P>
hounengwei
发表于 2006-12-1 16:02:00
真好,这位老兄!有源码就更好的! <BR>
hounengwei
发表于 2006-12-1 16:04:00
真好,这位老兄!有源码就更好的! <BR>
hounengwei
发表于 2006-12-1 16:11:00
向版主致敬!向版主学习!
页:
1
2
3
4
5
6
7
8
9
10
[11]
12
13
14
15
16
17