M
mike_thomas29
I have developed a VB6 COM add-in for MSP which includes code in the
projectbeforesave event, and testing on MSP 2000 has shown some strange
problems. On debugging I have found that the problem seems to be the
SaveAsUI boolean passed to this event (ByVal, so read-only).
In debug mode, VB6 SP5 tells me that SaveAsUI = True when I click Save
As.. on the MSP menu to trigger the event. It shows as True when I
hover over it, and also if I query it in the Immediate window in VB6 -
all looks OK, however when I step through to this line of code;
If SaveAsUI = True then
- the code goes down the False path!
In fact testing shows that 'If SaveAsUI = False' will also fail.
I think I have found a workaround, which is to change my code to;
If CLng(SaveAsUI) <> 0
which will correctly return 1 if True and 0 if false.
Nothing on this problem in MSDN, I haven't yet checked it on MSP2003.
Any ideas why this behaviour occurs?
Mike.
projectbeforesave event, and testing on MSP 2000 has shown some strange
problems. On debugging I have found that the problem seems to be the
SaveAsUI boolean passed to this event (ByVal, so read-only).
In debug mode, VB6 SP5 tells me that SaveAsUI = True when I click Save
As.. on the MSP menu to trigger the event. It shows as True when I
hover over it, and also if I query it in the Immediate window in VB6 -
all looks OK, however when I step through to this line of code;
If SaveAsUI = True then
- the code goes down the False path!
In fact testing shows that 'If SaveAsUI = False' will also fail.
I think I have found a workaround, which is to change my code to;
If CLng(SaveAsUI) <> 0
which will correctly return 1 if True and 0 if false.
Nothing on this problem in MSDN, I haven't yet checked it on MSP2003.
Any ideas why this behaviour occurs?
Mike.