Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Resource conflict on ON_UPDATE_COMMAND_UI

3 views
Skip to first unread message

yccheok

unread,
Oct 6, 2010, 4:54:31 AM10/6/10
to
I have an EXE class which contains a button resource with ID
EXE_BUTTON_RESOURCE

ON_UPDATE_COMMAND_UI(EXE_BUTTON_RESOURCE, OnUpdateExeButtonResource)

void EXE::OnUpdateExeButtonResource(CCmdUI* pCmdUI)
{
pCmdUI->Enable(exe_flag);
}


This EXE application will load another DLL class.

DLL class is having a menu item resource with ID DLL_MENU_RESOURCE.

Unfortunately, EXE_BUTTON_RESOURCE and DLL_MENU_RESOURCE is having the
same resource ID. To avoid them have conflict ID is pretty difficult,
as they are two separate projects.

Whenever exe_flag, which is the member for EXE turn to false, this
will affect menu in DLL too. Clicking on DLL_MENU_RESOURCE menu will
have no effect at all.

How can I avoid this trap? Having manual inspection on their
resource.h files is not an option for me, as they are 2 separate
projects, managed by 2 separate teams.

ScottMcP [MVP]

unread,
Oct 6, 2010, 8:59:00 AM10/6/10
to
On Oct 6, 4:54 am, yccheok <yancheng.ch...@gmail.com> wrote:
> How can I avoid this trap? Having manual inspection on their
> resource.h files is not an option for me, as they are 2 separate
> projects, managed by 2 separate teams.

This is a known limitation of Visual Studio. It is necessary to
manage the teams' usage of ID numbers so they do not overlap.

0 new messages