PRB: Visual Basic 4.0 Can't Interpret SCODE ParameterLast reviewed: March 8, 1996Article ID: Q137898 |
The information in this article applies to:
SYMPTOMSVisal Basic 4.0 cannot interpret an SCODE parameter. The following error message is generated:
Function marked as restricted or uses an OLE type not supported in Visual Basic. WORKAROUNDChange the SCODE parameter to a LONG parameter. If you created a custom event that passes an SCODE parameter, modify the .Odl file to reflect LONG instead of SCODE.
ExampleIn the generic .odl file, the Class Wizard created the following custom event and gave Scode an SCODE parameter (that is, Scode SCODE). You need to change the parameter a LONG Scode for it to work in Visual Basic 4.0 as follows: [id(DISPID_ERROREVENT)] void Error(short Number, BSTR* Description, LONG Scode, BSTR Source, BSTR HelpFile, long HelpContext, boolean* CancelDisplay); // Generic .ocx Code void CGenericCtrl::OnLButtonDown(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default FireError(CTL_E_OVERFLOW, "TestError") ; COleControl::OnLButtonDown(nFlags, point); } // Visual Basic 4.0 code Changing Scode parameter to Long instead of SCODE Private Sub Generic1_Error(Number As Integer, Description As String, _ Scode As Long, Source As String, HelpFile As String, _ HelpContext As Long, CancelDisplay As Boolean) MsgBox (Description) End Sub STATUSThis behavior is by design.
|
Additional reference words: 4.00 vb4win vb4all
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |