Hello,
I have written my own package with its own .ctc. In this ctc, I populate my
menus with default commands and new commands. This works well except in one
case. The problem I am facing is how to deal with commands that are defined
by a StandardCommand field but have not been defined in any of the VS default
.ctc.
Let's take for example the StandardCommands.BringForward.
In the CMDPLACEMENT_SECTION of my ctc, I 've added the following line:
guidVSStd97:cmdidBringForward, MyVSPackageCmdSet:IVN_ORDER_GROUP, 0x0000;
where IVN_ORDER_GROUP is a group containing other commands, this group being
added to a menu.
Then, in my C# code, I set an event handler on this command.
The result is that the BringForward command does not appear in my menu
(while the other commands added to this menu do).
Then, I searched in the VSSDK included ctc's, and it seems this command is
not defined in any of the provided .ctc. Therefore I guess it explains why I
don't have it in my menu.
But then, what is the proper methodology to follow ? Should I define my own
BringForward command with its own guid:id and not try to reuse the
StandardCommand.BringForward CommandID (that is adding in the BUTTONS_BEGIN
section a new command definition something like:
MyVSPackageCmdSet:cmdidBringForward, Group_Undefined:0, 0x0000,
MSO_ICON(BringForward), BUTTON, DEFAULTINVISIBLE | DYNAMICVISIBILITY,"Bring
Forward"; )
or should I define by myself the StandardCommand.BringForward command by
adding the following line:
guidVSStd97:cmdidBringForward, Group_Undefined:0, 0x0000,
MSO_ICON(BringForward), BUTTON, DEFAULTINVISIBLE | DYNAMICVISIBILITY,"Bring
Forward";
?
Or is there another solution ?
Any help would be greatly appreciated,
thanks,
Patrick
Patrick Ruzand - 11 May 2006 07:57 GMT
> Hello,
>
[quoted text clipped - 3 lines]
> by a StandardCommand field but have not been defined in any of the VS default
> .ctc.
[...]
I forgot: I am using VS 2005.
Patrick
"Ed Dore [MSFT]" - 15 May 2006 18:21 GMT
Hi Patrick,
It doesn't appear that this particuar command is actually implemented
anywhere, at least not in the VS 2003 or VS 2005 codebase. I'm guessing
it's a leftover from a previous version, though I wasn't able to verify the
specific origins of this particular id.
The winform designer does implement a cmdidBringToFront and a
cmdidSendToBack command, but it doesn't look like cmdidBringFoward is used
in any .CTC resources located in our VS source trees.
Your best bet would be to utilize the cmdidBringToFront and cmdidSendToBack
commands if they make sense for your particular scenario. Barring that, you
should define your own commands using your own commandset guid and id's.
Generally speaking, you should never re-use the guidVSStd97 guid when
defining new commands. Rather, you should use your own commandset guid.
Let me know if this doesn't make sense.
Sincerely,
Ed Dore [MSFT]
This post is 'AS IS' with no warranties, and confers no rights.
Patrick Ruzand - 16 May 2006 07:17 GMT
Hi Ed,
> Hi Patrick,
[...]
> Your best bet would be to utilize the cmdidBringToFront and
> cmdidSendToBack
> commands if they make sense for your particular scenario.
they make sense as I am already using them, but I need also the
BringForward/SendBackward
to navigate through the z-order of my objects.
>Barring that, you should define your own commands using your own
>commandset guid and id's.
> Generally speaking, you should never re-use the guidVSStd97 guid when
> defining new commands. [...]
Ok, that confirms what I did.
Thanks for your help,
Patrick
"Gary Chang[MSFT]" - 12 May 2006 02:47 GMT
Hi Patrick,
Thank you posting!
This is a quick note to let you know that I am performing research on this
issue and will get back to you as soon as possible. I appreciate your
patience.
Thanks for your understanding.
Best regards,
Gary Chang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.