Your demo at
www.instantvb.com might be useful sometimes.
In this case the solution proposed:
'TODO: INSTANT VB TODO TASK: There is no VB.NET equivalent to
'unchecked':
'ORIGINAL LINE: newEvent =
documentEvents.AddAdvise(unchecked((short)VisEvent Codes.visEvtAdd) +
(short)VisEventCodes.visEvtShape), (IVisEventProc)Me, sink,
targetArgs);
Private newEvent =
documentEvents.AddAdvise((CShort(VisEventCodes.vis EvtAdd)) +
CShort(VisEventCodes.visEvtShape)), CType(Me, IVisEventProc), sink,
targetArgs)
'TODO: INSTANT VB TODO TASK: There is no VB.NET equivalent to
'unchecked':
'ORIGINAL LINE: case (short)VisEventCodes.visEvtShape +
unchecked((short)VisEventCodes.visEvtAdd):
Case CShort(VisEventCodes.visEvtShape) +
(CShort(VisEventCodes.visEvtAdd))
raise the error:
"Constant expression (VisEventCodes.visEvtAdd) not representable in
type 'Short'"
And AddAdwise:
evtObj = object.AddAdvise (eventCode, eventSink, IIDSink, targetArgs)
needs an eventCode (Short integer).
I am looking for a refinement of this idea.
--
Sorin