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>&nbsp;acutPrintf("刷新实体:");<BR>&nbsp;&nbsp;&nbsp; actrTransactionManager-&gt;flushGraphics(); <BR>&nbsp;&nbsp;&nbsp; acedUpdateDisplay(); </P>
<P>&nbsp;acutPrintf("OK!");<BR>&nbsp;return;<BR>&nbsp;// TODO: Implement the command</P>
<P>}</P>
<P>编译结果如下,请问怎么解决?</P>
<P>--------------------Configuration: ree - Win32 Debug--------------------<BR>Compiling...<BR>reeCommands.cpp<BR>&nbsp;&nbsp;&nbsp;&nbsp; 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 '-&gt;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>&nbsp;</P>

JOLMO 发表于 2006-11-9 18:16:00

<P>最近我遇到个问题,我自己下载了个DockBar作为控件,没用Acui的,但是还是存在首次Dock到CAD边界时候,高度不够,没有填充完整。</P>
<P>希望那位大哥解惑</P>
<P>&nbsp;</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>&nbsp;</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>&nbsp;//{{AFX_MSG_MAP(CMyDockBar)<BR>&nbsp;ON_WM_CREATE()<BR>&nbsp;ON_WM_LBUTTONUP()</P>
<P><BR>&nbsp;<BR>&nbsp;//}}AFX_MSG_MAP</P>
<P>&nbsp;<BR>&nbsp;ON_NOTIFY(TCN_SELCHANGE, IDC_TAB, OnTcnSelchangeTab)<BR>&nbsp;ON_NOTIFY(NM_DBLCLK, IDC_TREE, OnNMDblclkTree)<BR>//&nbsp;ON_NOTIFY(WM_WINDOWPOSCHANGED,IDD_DOCKBAR,OnWindowPosChanging)<BR>&nbsp;<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>&nbsp;&nbsp; </P>
<P>&nbsp;CAcModuleResourceOverride resourceOverride ;</P>
<P>&nbsp;if (baseCMyBar::OnCreate(lpCreateStruct) == -1)<BR>&nbsp;&nbsp;return -1;</P>
<P>&nbsp;SetSCBStyle(GetSCBStyle() | SCBS_SIZECHILD);</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P><BR>&nbsp;//m_wndChild = new CChildDlg;</P>
<P>&nbsp;//m_wndChild-&gt;Create(IDD_DIALOG1,this);<BR>&nbsp;////m_wndChild-&gt;OnInitDialog();<BR>&nbsp;//m_wndChild-&gt;MoveWindow(0, 0, 100, 100, TRUE);<BR>&nbsp;<BR>&nbsp;/*if (!m_wndChild.Create(WS_CHILD|WS_VISIBLE|<BR>&nbsp;&nbsp;ES_MULTILINE|ES_WANTRETURN|ES_AUTOVSCROLL,<BR>&nbsp;&nbsp;CRect(0,0,0,0), this, 123))<BR>&nbsp;&nbsp;return -1;*/<BR>&nbsp;/*if (!m_wndIBTab.Create(WS_CHILD|WS_VISIBLE|WS_TABSTOP,CRect(0, 0, 0, 0), this, 100))<BR>&nbsp;{</P>
<P>&nbsp;&nbsp;m_wndIBTab.ModifyStyleEx(0, WS_EX_CLIENTEDGE);</P>
<P>&nbsp;&nbsp;m_wndIBTab.InsertItem(0,_T("隧道设计"));<BR>&nbsp;&nbsp;m_wndIBTab.InsertItem(1,_T("隧道监测"));<BR>&nbsp;&nbsp;m_wndIBTab.InsertItem(2,_T("隧道施工"));<BR>&nbsp;&nbsp;<BR>&nbsp;}<BR>&nbsp;m_wndIBTab.MoveWindow(0,0,200,600,TRUE);*/</P>
<P><BR>&nbsp;<BR>&nbsp;<BR>&nbsp;<BR>&nbsp;<BR>&nbsp;//if (!m_wndIBTree.Create(WS_CHILD|WS_VISIBLE|<BR>&nbsp;//&nbsp;TVS_HASLINES|TVS_HASBUTTONS|TVS_LINESATROOT,<BR>&nbsp;//&nbsp;Trect, this, 100))<BR>&nbsp;//{<BR>&nbsp;//&nbsp;TRACE0("Failed to create instant bar child\n");<BR>&nbsp;//&nbsp;return -1;&nbsp;&nbsp;// fail to create<BR>&nbsp;//}</P>
<P>&nbsp;//m_wndIBTree.ModifyStyleEx(0, WS_EX_CLIENTEDGE);</P>
<P><BR>&nbsp;//// populate the treectrl<BR>&nbsp;//HTREEITEM hti = m_wndIBTree.InsertItem(_T("Node 1"));<BR>&nbsp;//m_wndIBTree.InsertItem(_T("Node 2"));<BR>&nbsp;//m_wndIBTree.InsertItem(_T("SubNode 11"), hti);<BR>&nbsp;//m_wndIBTree.InsertItem(_T("SubNode 12"), hti);<BR>&nbsp;//m_wndIBTree.InsertItem(_T("SubNode 13"), hti);<BR>&nbsp;//m_wndIBTree.InsertItem(_T("SubNode 14"), hti);<BR>&nbsp;//m_wndIBTree.InsertItem(_T("SubNode 15"), hti);<BR>&nbsp;//m_wndIBTree.InsertItem(_T("SubNode 16"), hti);<BR>&nbsp;//m_wndIBTree.InsertItem(_T("SubNode 17"), hti);<BR>&nbsp;//m_wndIBTree.InsertItem(_T("SubNode 18"), hti);<BR>&nbsp;//m_wndIBTree.InsertItem(_T("SubNode 19"), hti);<BR>&nbsp;//m_wndIBTree.InsertItem(_T("SubNode 121"), hti);<BR>&nbsp;//m_wndIBTree.InsertItem(_T("SubNode 122"), hti);</P>
<P><BR>&nbsp;//m_wndIBTree.MoveWindow(0,0,100,600,TRUE);</P>
<P>&nbsp;<BR>&nbsp;<BR>&nbsp;<BR>&nbsp;<BR>if (m_Tab.Create(WS_CHILD|WS_VISIBLE,CRect(0,0,200,6000),this,IDC_TAB))<BR>{</P>
<P>&nbsp;m_Tab.ModifyStyleEx(0, WS_EX_CLIENTEDGE);</P>
<P>&nbsp;m_Tab.InsertItem(0,_T("隧道设计"));<BR>&nbsp;m_Tab.InsertItem(1,_T("隧道监测"));<BR>&nbsp;m_Tab.InsertItem(2,_T("隧道施工"));</P>
<P>&nbsp;//m_Tab.MoveWindow(0,0,200,600);</P>
<P>&nbsp;</P>
<P>&nbsp;if (!m_wndIBTree.Create(WS_CHILD|WS_VISIBLE|<BR>&nbsp;&nbsp;TVS_HASLINES|TVS_HASBUTTONS|TVS_LINESATROOT,<BR>&nbsp;&nbsp;CRect(0,30,200,6000), &amp;m_Tab, IDC_TREE))<BR>&nbsp;{<BR>&nbsp;&nbsp;TRACE0("Failed to create instant bar child\n");<BR>&nbsp;&nbsp;return -1;&nbsp;&nbsp;// fail to create<BR>&nbsp;}</P>
<P>&nbsp;m_wndIBTree.ModifyStyleEx(0, WS_EX_CLIENTEDGE);</P>
<P><BR>&nbsp;// populate the treectrl<BR>&nbsp;HTREEITEM hti = m_wndIBTree.InsertItem(_T("Node 1"));<BR>&nbsp;m_wndIBTree.InsertItem(_T("Node 2"));<BR>&nbsp;m_wndIBTree.InsertItem(_T("SubNode 11"), hti);<BR>&nbsp;m_wndIBTree.InsertItem(_T("SubNode 12"), hti);<BR>&nbsp;m_wndIBTree.InsertItem(_T("SubNode 13"), hti);<BR>&nbsp;m_wndIBTree.InsertItem(_T("SubNode 14"), hti);<BR>&nbsp;m_wndIBTree.InsertItem(_T("SubNode 15"), hti);<BR>&nbsp;m_wndIBTree.InsertItem(_T("SubNode 16"), hti);<BR>&nbsp;m_wndIBTree.InsertItem(_T("SubNode 17"), hti);<BR>&nbsp;m_wndIBTree.InsertItem(_T("SubNode 18"), hti);<BR>&nbsp;m_wndIBTree.InsertItem(_T("SubNode 19"), hti);<BR>&nbsp;m_wndIBTree.InsertItem(_T("SubNode 121"), hti);<BR>&nbsp;m_wndIBTree.InsertItem(_T("SubNode 122"), hti);</P>
<P><BR>&nbsp;m_wndIBTree.MoveWindow(0,30,200,600,TRUE);</P>
<P>&nbsp;<BR>}</P>
<P>&nbsp;// --- end instant bar creation and child setup ---</P>
<P>&nbsp;</P>
<P>&nbsp;//m_wndChild.ModifyStyleEx(0, WS_EX_CLIENTEDGE);</P>
<P>&nbsp;//// older versions of Windows* (NT 3.51 for instance)<BR>&nbsp;//// fail with DEFAULT_GUI_FONT<BR>&nbsp;//if (!m_font.CreateStockObject(DEFAULT_GUI_FONT))<BR>&nbsp;//&nbsp;if (!m_font.CreatePointFont(80, _T("MS Sans Serif")))<BR>&nbsp;//&nbsp;&nbsp;return -1;</P>
<P>&nbsp;//m_wndChild.SetFont(&amp;m_font);</P>
<P>&nbsp;return 0;<BR>}</P>
<P>&nbsp;void CMyDockBar::OnTcnSelchangeTab(NMHDR *pNMHDR, LRESULT *pResult)<BR>{<BR>&nbsp;// TODO: Add your control notification handler code here<BR>&nbsp;if (m_Tab.GetCurSel()==0)<BR>&nbsp;{<BR>&nbsp;&nbsp;m_wndIBTree.ShowWindow(SW_SHOW);<BR>&nbsp;&nbsp;<BR>&nbsp;}<BR>&nbsp;if (m_Tab.GetCurSel()==1)<BR>&nbsp;{<BR>&nbsp;&nbsp;m_wndIBTree.ShowWindow(SW_HIDE);<BR>&nbsp;</P>
<P>&nbsp;}<BR>&nbsp;if (m_Tab.GetCurSel()==2)<BR>&nbsp;{<BR>&nbsp;&nbsp;m_wndIBTree.ShowWindow(SW_HIDE);</P>
<P>&nbsp;}</P>
<P>}</P>
<P>&nbsp;void CMyDockBar::OnNMDblclkTree(NMHDR *pNMHDR, LRESULT *pResult)<BR>&nbsp;{<BR>&nbsp; // TODO: Add your control notification handler code here<BR>&nbsp; NMTVDISPINFO* pNMTreeView = (NMTVDISPINFO*)pNMHDR;</P>
<P>&nbsp; CString szText;<BR>&nbsp; HTREEITEM Item2;&nbsp;</P>
<P><BR>&nbsp; Item2 = m_wndIBTree.GetSelectedItem();<BR>&nbsp; szText = m_wndIBTree.GetItemText(Item2);<BR>&nbsp; if (szText==_T("SubNode 11"))<BR>&nbsp; {<BR>&nbsp;&nbsp; CChildDlgII dlg1;<BR>&nbsp;&nbsp; dlg1.DoModal();<BR>&nbsp; }</P>
<P>&nbsp; if (szText==_T("SubNode 12"))<BR>&nbsp; {<BR>&nbsp;&nbsp; CChildDlgII Dlg2;<BR>&nbsp;&nbsp; Dlg2.DoModal();<BR>&nbsp; }</P>
<P>&nbsp; *pResult = 0;<BR>&nbsp;}</P>
<P>&nbsp;void CMyDockBar::OnLButtonUp(UINT nFlags, CPoint point)<BR>&nbsp;{<BR>&nbsp; if (m_bTracking)<BR>&nbsp;&nbsp; StopTracking();</P>
<P>&nbsp; baseCMyBar::OnLButtonUp(nFlags, point);</P>
<P>&nbsp; MoveWindow(0,0,200,600);<BR>&nbsp;}</P>
<P>&nbsp;void CMyDockBar::OnSize(UINT nType, int cx, int cy)<BR>&nbsp;{<BR>&nbsp; baseCMyBar::OnSize(nType, cx, cy);</P>
<P>&nbsp; SetWindowPos(acedGetAcadFrame(),0,0,200,600,TRUE);<BR>&nbsp;}</P>
<P>&nbsp;</P>
<P><BR>//////////////////////////////////////////////////////////////////////////</P>
<P>BOOL InitApp()<BR>{<BR>&nbsp;CMyDockBar *m_wndInstantBar = NULL;<BR>&nbsp;//CTreeCtrl&nbsp;m_wndIBTree;<BR>&nbsp;//HTREEITEM&nbsp; TreeItem;</P>
<P>&nbsp;CAcModuleResourceOverride res;</P>
<P>&nbsp;// --- instant bar ---<BR>&nbsp;</P>
<P>&nbsp;if ( !m_wndInstantBar)<BR>&nbsp;{<BR>&nbsp;&nbsp;m_wndInstantBar = new CMyDockBar;</P>
<P>&nbsp;&nbsp;</P>
<P>&nbsp;&nbsp;<BR>&nbsp;if (!m_wndInstantBar-&gt;Create(_T("Instant Bar"), acedGetAcadFrame(), <BR>&nbsp;&nbsp;IDD_DOCKBAR,WS_CHILD|WS_VISIBLE|CBRS_ALIGN_LEFT|CBRS_SIZE_DYNAMIC))<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;TRACE0("Failed to create instant bar\n");<BR>&nbsp;&nbsp;&nbsp;return -1;&nbsp;&nbsp;// fail to create<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;m_wndInstantBar-&gt;SetSCBStyle(m_wndInstantBar-&gt;GetSCBStyle() |<BR>&nbsp;&nbsp;&nbsp;SCBS_SIZECHILD);</P>
<P>&nbsp;&nbsp;acedGetAcadFrame()-&gt;EnableAutomation();</P>
<P>&nbsp;</P>
<P>&nbsp;&nbsp;<BR>&nbsp;&nbsp;//if (!m_wndIBTree.Create(WS_CHILD|WS_VISIBLE|<BR>&nbsp;&nbsp;//&nbsp;TVS_HASLINES|TVS_HASBUTTONS|TVS_LINESATROOT,<BR>&nbsp;&nbsp;//&nbsp;CRect(0, 0, 0, 0), m_wndInstantBar, 100))<BR>&nbsp;&nbsp;//{<BR>&nbsp;&nbsp;//&nbsp;TRACE0("Failed to create instant bar child\n");<BR>&nbsp;&nbsp;//&nbsp;return -1;&nbsp;&nbsp;// fail to create<BR>&nbsp;&nbsp;//}<BR>&nbsp;&nbsp;//m_wndIBTree.ModifyStyleEx(0, WS_EX_CLIENTEDGE);</P>
<P>&nbsp;&nbsp;//<BR>&nbsp;&nbsp;//// populate the treectrl<BR>&nbsp;&nbsp;//HTREEITEM hti = m_wndIBTree.InsertItem(_T("Node 1"));<BR>&nbsp;&nbsp;//m_wndIBTree.InsertItem(_T("Node 2"));<BR>&nbsp;&nbsp;//m_wndIBTree.InsertItem(_T("SubNode 11"), hti);<BR>&nbsp;&nbsp;//m_wndIBTree.InsertItem(_T("SubNode 12"), hti);<BR>&nbsp;&nbsp;// --- end instant bar creation and child setup ---</P>
<P>&nbsp;&nbsp;m_wndInstantBar-&gt;SetBarStyle(m_wndInstantBar-&gt;GetBarStyle() |<BR>&nbsp;&nbsp;&nbsp;CBRS_TOOLTIPS | CBRS_FLYBY );</P>
<P>&nbsp;&nbsp;m_wndInstantBar-&gt;EnableAutomation();<BR>&nbsp;&nbsp;</P>
<P>&nbsp;&nbsp;//m_wndInstantBar.EnableDocking(CBRS_ALIGN_LEFT|CBRS_ALIGN_RIGHT);<BR>&nbsp;&nbsp;m_wndInstantBar-&gt;EnableDocking(CBRS_ALIGN_LEFT|CBRS_ALIGN_RIGHT|CBRS_ALIGN_TOP);</P>
<P><BR>&nbsp;&nbsp;//<BR>&nbsp;&nbsp;//#ifdef _SCB_REPLACE_MINIFRAME<BR>&nbsp;&nbsp;//&nbsp;&nbsp;m_pFloatingFrameClass = RUNTIME_CLASS(CSCBMiniDockFrameWnd);<BR>&nbsp;&nbsp;//<BR>&nbsp;&nbsp;//&nbsp;&nbsp;<BR>&nbsp;&nbsp;//#endif //_SCB_REPLACE_MINIFRAME&nbsp; AFX_IDW_DOCKBAR_LEFT</P>
<P>&nbsp; <BR>&nbsp;&nbsp;//acedGetAcadFrame()-&gt;DockControlBar(m_wndInstantBar,AFX_IDW_DOCKBAR_TOP,NULL);</P>
<P>&nbsp;&nbsp;acedGetAcadFrame()-&gt;FloatControlBar (m_wndInstantBar, CPoint(100, 100), CBRS_ALIGN_LEFT|CBRS_ALIGN_TOP|CBRS_ALIGN_RIGHT);<BR>&nbsp;<BR>&nbsp;&nbsp;acedGetAcadFrame ()-&gt;ShowControlBar (m_wndInstantBar, !m_wndInstantBar-&gt;IsVisible(), TRUE);<BR>&nbsp;&nbsp;//acedGetAcadFrame()-&gt;FloatControlBar (m_wndInstantBar, CPoint(100, 100), CBRS_ALIGN_LEFT|CBRS_ALIGN_TOP|CBRS_ALIGN_RIGHT);</P>
<P>&nbsp;</P>
<P>&nbsp;&nbsp;//RestoreControlBar(AFX_IDW_DOCKBAR_LEFT , lpRect);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;acedGetAcadFrame()-&gt;RecalcLayout(TRUE);<BR>&nbsp;<BR>&nbsp;}</P>
<P>&nbsp;if(!m_wndInstantBar-&gt;IsVisible())<BR>&nbsp;{<BR>&nbsp;&nbsp;acedGetAcadFrame ()-&gt;ShowControlBar (m_wndInstantBar, !m_wndInstantBar-&gt;IsVisible(), TRUE);<BR>&nbsp;&nbsp;<BR>&nbsp;}<BR>&nbsp;&nbsp;&nbsp;//DockControlBar(&amp;m_wndInstantBar, AFX_IDW_DOCKBAR_LEFT);<BR>&nbsp;&nbsp;&nbsp;//ShowControlBar(&amp;m_wndInstantBar, !m_wndInstantBar.IsVisible(), FALSE);</P>
<P><BR>&nbsp;&nbsp;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
查看完整版本: ObjectARX工作日志