Drawing Control, NegotiateMenus, and C++

M

Michelle

I'm using the Visio Drawing Control on a form/dialog in my
application. The NegotiateMenus functionality works great using VB6,
and not at all using managed code (VB.NET and C#). What about C++?
Is there similar functionality that will work with non-managed C++
code and MFC dialogs using either VS6 or VS.NET? Are there any
examples out there?

Thanks,
Michelle
 
M

Mai-lan

Hi, Michelle: The container that you use the control in must support OLE menu merging for menu merging with the Visio ActiveX control to work. VB and C++ both support OLE menu merging. C# and VB.NET (the forms editors for Visual Studio.NET, to be more precise) do not. As a result, to do menu merging with the managed code languages, you can use the IOleCommandTarget interface to run Visio commands. There is more information and code samples at:

http://www.msdn.microsoft.com/offic.../odc_vsprogrammingwithvisioactivexcontrol.asp

Thanks,
Mai-lan
 
W

weiwei

I try to use a visio drawing control in my vc++ 7.0 project. with the
following code.


void CvisioView::OnInitialUpdate()
{
CView::OnInitialUpdate();

// TODO: remove this code when final selection model code is written
m_pSelection = NULL; // initialize selection

CRect rect;
this->GetClientRect(&rect);
this->m_drawCtrl.Create("this is a test", WS_CHILD | WS_VISIBLE |
CBRS_SIZE_DYNAMIC, rect, this, NULL);
m_drawCtrl.put_Src("C:\\Documents and
Settings\\wwsong.YELLOWSTONE\\Desktop\\drawing22.vsd");

m_drawCtrl.put_NegotiateMenus(1);

}

all work well except that the menu does not merge.
the project is created as a ActiveX control container (MDI Frame),
when inserted with a visio drawing object from the "EDIT//INSERT NEW
OBJECT..." menu, the visio menu and toolbar shows up.

I am wondering what is wrong with my code. I also try to call
put_NegotiateMenus(1) after the drawing control window fully displays.
it still has no effect....

Thanks






Mai-lan said:
Hi, Michelle: The container that you use the control in must support
OLE menu merging for menu merging with the Visio ActiveX control to
work. VB and C++ both support OLE menu merging. C# and VB.NET (the
forms editors for Visual Studio.NET, to be more precise) do not. As a
result, to do menu merging with the managed code languages, you can
use the IOleCommandTarget interface to run Visio commands. There is
more information and code samples at:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top