OLE Server Object Manipulation
Don’t return references to Form and Control objects from your OLE server.Rather, provide wrappers for the properties and methods of forms and controlsif they must be manipulated by your OLE
Don’t return references to Form and Control objects from your OLE server.Rather, provide wrappers for the properties and methods of forms and controlsif they must be manipulated by your OLE
Use this code to cause a TextBox control to automatically scroll down as you concatenate new text: ””Select the end of the text MyTextBox.SelStart = Len(MyTextBox.Text)””Put the new text thereMyTextBox.SelText
Instead of declaring an object As Object, use the specific object type, such as CTask. This improves performance by minimizing the OLE lookup requirements.
Use an ampersand (&) instead of a plus sign (+) when concatenatingstrings. Depending on the data type of the operands, using the plus signmay result in an addition.
Don’t use any objects in the Visual Basic object library as parametersor return values for exposed properties or methods in public classes. Theseobjects are not intended to be used from
Use With…End With to minimize the number of repeated OLE lookups.This has the added advantage of not requiring the temporary substitutionobject.
Place one label on your form, tailor its properties (such as left-alignand autosize), and copy and paste it to create the rest of your labels.
Start the in-process OLE server using a Sub Main procedure. Includeall server initialization code in the Sub Main procedure. Don’t show formsfrom the Sub Main procedure and don’t use the
VB developers that program with C language might be confused by a feature in the language. Consider thiscode: Dim x As IntegerDim y As IntegerDim z As Integer x =