The information in this article applies to:
SYMPTOMSUsing the IIF statement may cause a general protection (GP) fault in a range of addresses from 0023:6BB0 to 0023:7DE0 within VBRUN300.DLL or from 004A:68D0 or 004a:7B00 within VB.EXE. This is a subtle bug that may not be encountered and will not occur on a line using the IIF statement. Other GP faults in segment 23 of VBRUN300.DLL are more indicative of calling a DLL incorrectly, such as forgetting to put "byval" on a DLL's string parameter. CAUSEThe IIF statement does not release string handles for temporary strings used in its arguments. Under certain conditions, this can result in a GP fault occurring at a seemingly random location later in your program. The code below demonstrates the condition where IIF will not release its string handles.
The second and third arguments of this statement result in temporary
strings being created. This does not, however, cause the GPF. One of two
other events must occur for that to happen:
-or- WORKAROUNDAvoid the use of functions that return Strings within the IIF statement. For example, to avoid the bug, modify the code listed in the CAUSE section of this article to this:
Here's another alternative:
STATUSThis bug was corrected in Microsoft Visual Basic version 4.0 for Windows. Additional query words: 3.00 GPF buglist3.00 fixlist4.00
Keywords : |
Last Reviewed: September 17, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |