Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
VB VB (1648)
VB.net VB.net (736)
C# C# (15)
ASP.net ASP.net (779)
ASP ASP (41)
VC++ VC++ (25)
PHP PHP (0)
JAVA JAVA (4)
JScript JScript (5)
  Database
» SQL Server (708)
» ORACLE (5)
» MySQL (0)
» DB2 (0)
Automation
» C/C++/ASM (11)
» Microcontroller (1)
» Circuit Design (0)
OS/Networking
» Networking (5)
» Unix/Linux (1)
» WinNT/2k/2003 (8)
Graphics
» Flash (0)
» Maya (0)
» 3D max (0)
» Photoshop (0)
Links
» ASP.net (2)
» PC Interfacing (1)
» Networking (4)
» SQL Server (4)
» VB (23)
» VB.net (4)
» VC (3)
» HTML/CSS/JavaScript (10)
Tools
» Regular Expr Tester
» Free Tools

(Page 8 of 133) 3985 Result(s) found 

 

Always declare objects with full library name
Total Hit (2828) If your application uses objects from external components, either third-party or your own libraries, a good rule of thumb is to include the complete servername.classname string in the Dim statement, as in: «Code LangId=1» Dim word As Word.Application «/Code» This syntax ensures that if you th ....Read More
Rating
Always run a component using Full-Compile
Total Hit (2723) When testing a component in the IDE, always perform a full compilation. This ensures that VB checks the syntax of all the code in the component, which in turn guarantees that no syntax error will break the program while it is serving another application. You can activate the full compilation opti ....Read More
Rating
Check a GUID
Total Hit (2884) The following routine quickly check that a string contains a valid GUID. Of course, it doesn't check that the GUID refers to a valid entity, but at least it lets you quickly reject invalid values: «Code LangId=1» Function CheckGUID(Value As String) As Boolean Const PatternGUID = "{####### ....Read More
Rating
Compound member attributes
Total Hit (2674) The Procedure Attributes dialog includes a Procedure ID combo box, that lets you associate a particular ID to a given member of the class. You usually use this combo to make a property or a method the default item of a class or an ActiveX control, but there are other uses as well. For instance, you ....Read More
Rating
Correct usage for binary compatibility settings
Total Hit (2952) When working on an updated version of a COM component, you should always enforce Binary Compatibility in the Component tab of the Project Properties dialog box. When enforcing binary compatibility there are a number of common mistakes that you should stay clear of: Always use the last EXE or DLL ....Read More
Rating
Create a GUID
Total Hit (3858) When you build your ActiveX controls and components, Visual Basic automatically creates all the GUIDs as necessary. The same also happens in other cases, without you even realizing it: for instance when you make a MDB database replicable, the Jet Engine adds new fields and uses GUIDs to mark their c ....Read More
Rating
Create stand-alone type libraries
Total Hit (3112) Many VB programmers assume that Visual Basic 5.0 is not capable of creating stand-alone Type Libraries, because the documentation states that when an ActiveX component or control is created, the companion Type Library is embedded in the main executable file. This is correct, but if you own the E ....Read More
Rating
Creating help string for Enum constants
Total Hit (3004) I've been trying to find a way to assign helpstrings for Enums in Visual Basic. The Class builder utility does that only for methods, events, and properties, but not for Enums. The IDL source code that corresponds to an Enum in a type library looks something like follws, and you can run the MIDL ....Read More
Rating
Don't include Extender properties in ActiveX Wizard
Total Hit (3070) The left-most listbox in the first page in the ActiveX Control Interface Wizard includes all the properties exposed by the constituent controls currently on the UserControl's surface. Unfortunately, this list includes Extender properties, methods, and events, which should be never added to the publi ....Read More
Rating
Don't pass Private objects to client applications
Total Hit (2814) Under some circumstances, an ActiveX DLL can pass private objects to its client application, for example a reference to a control that belongs to a form in the DLL. While this approach can be useful, and can work under some circumstances, you should absolutely avoid avoid to do so, because it might ....Read More
Rating
Enum constants that include spaces
Total Hit (2780) If you're writing an ActiveX control, you can create properties that return an enumerated value, as in: «Code LangId=1» Public Enum SizeConstants SizSmall = 1 SizMedium SizLarge End Enum Public Size As SizeConstants «/Code» When another developer is using your control, an enu ....Read More
Rating
Get the Command$ value from inside an ActiveX DLL
Total Hit (3084) At times you may need to access the command line passed to the application from within an ActiveX DLL. Unfortunately, when inside a DLL the Command$ function returns a null string, so you have to resort to some API trickery: «Code LangId=1» Private Declare Function GetCommandLine Lib "kernel32" ....Read More
Rating
Hide the Automation Manager
Total Hit (3320) If you haven't switched to DCOM yet, and still use Remote OLE Automation, you must launch the Automation Manager program on the server machine, in order to let the server respond to requests coming from client workstations. The Automation Manager displays a visible window at launch time, which t ....Read More
Rating
Never mix SingleUse and MultiUse classes
Total Hit (2749) ActiveX components written in VB can contain both SingleUse and MultiUse classes at the same time. It usually isn't a good idea to use both types of classes in the same project, however. When a client creates an instance of a SingleUse class, COM always runs a new instance of the EXE file that ex ....Read More
Rating
Pass the hidden Global object to an ActiveX DLL
Total Hit (3104) An ActiveX DLL doesn't have direct access to the environment of the calling EXE. For example, the App and Printer objects in the DLL don't correspond to the objects with the same name in the main application, therefore if you want to print something from the DLL using the same settings as the main a ....Read More
Rating
Programmatically register an ActiveX control or DLL
Total Hit (4841) All ActiveX DLL or OCX export two functions: DllRegisterServer and DllUnregisterServer. They are used to register and unregister the ActiveX in the Windows registry, and are usually invoked from regsvr32.exe at registration time. However, you can register and unregister these files programmatical ....Read More
Rating
Rebase compiled DLLs
Total Hit (3239) Many VB developers know that they should specify a DLL Base Address value - in the Compile tab of the Project Properties dialog box - that is different from the base address of any other DLL or OCX used in the project. When you are working with a compiled DLL or OCX for which you don't have the ....Read More
Rating
Retrieve the textual or HTML text contained in a WebBrowser control
Total Hit (3856) Here's a quick way to retrieve the textual (that is, without any HTML tag) contents of a WebBrowser control: «Code LangId=1» Dim Text As String Text = WebBrowser1.Document.Body.InnerText «/Code» Getting the HTML text is a tad less intuitive, though: «Code LangId=1» Dim Text As String Text ....Read More
Rating
Storing objects in the Tag property
Total Hit (4396) The Tag property exposed by many Windows Common Controls (including TreeView's Node objects and ListView's ListItem objects) is more versatile than the ListBox and ComboBox controls' ItemData property, because it is of Variant type and can therefore accept values of most data types. However, it ....Read More
Rating
Updating records in DataList and ADO Data Controls
Total Hit (3913) If you use a DataList control linked to an ADO Data Control and if you want to add a record, you have to create a command button with this code: «Code LangId=1» Private Sub cmdAdd_Click() On Error GoTo AddErr datPrimaryRS.Recordset.AddNew txtNew.SetFocus Exit Sub AddErr: MsgBox ....Read More
Rating
A template for building collection class modules
Total Hit (3511) The following is a template for building collection class modules in a very quick and effective way. Copy-and-paste this code into Notepad, that save it to a file named "COLLECTION CLASS.CLS" in the \TEMPLATE\CLASSES subdirectory under the main VB6 directory: «Code LangId=1» VERSION 1.0 CLASS B ....Read More
Rating
Better type checking in Variant properties that can accept objects
Total Hit (2808) As explained in the Mistake Bank you need all three flavors of Property procedures to correctly implement a Variant property that can take either an object or a non-object value. Surprisingly enough, in this case you don't need that the argument of the Property Set procedure be declared As Variant. ....Read More
Rating
Default Properties tend to hide programming mistakes
Total Hit (2762) Visual Basic lets you create a default property or method by simply selecting the "(Default)" item in the combo box that appear if you click the Advanced button in the Procedure Attributes dialog box. (You can display this dialog from the Tools menu, or by right-clicking on a property name in the ri ....Read More
Rating
Don't test auto-instancing variables using Is Nothing
Total Hit (2868) You can't reliably test an auto-instancing object variable using the Is Nothing test, because as soon as you reference the variable Visual Basic silently creates an object of the given class, and the test always returns False: «Code LangId=1» Dim x As New MyClass If x Is Nothing Then ' this ....Read More
Rating
Friend Procedures are faster than Public ones
Total Hit (2954) It might surprise you to learn that Friend procedures are sensibly faster than Public ones. You can prove this yourself by creating an ActiveX EXE project with one Private class and one Public class (Instancing = MultiUse), and then add the following code in both class modules: «Code LangId=1» P ....Read More
Rating
Implement Write-Once Read-Many Properties
Total Hit (3950) Creating a read-only property or a write-only property isn't difficult, as you probably know: just omit the Property Let (or Set, if dealing with objects) or the Property Get procedure, respectively. There are cases, however, when you want to implement a write-only-read-many property, that is, a ....Read More
Rating
Passing Public class variables by reference
Total Hit (2911) Under VB4 Public variables in form and class modules were implemented in the same manner as variables in BAS modules, that is, as direct references to memory locations. This allowed VB programmers to create procedures that modified values passed by reference, as in: «Code LangId=1» '--- the CIn ....Read More
Rating
Use Objptr function to quickly locate an object in a Collection
Total Hit (3116) One of the simplest and most effective uses of the ObjPtr function is to provide a key for quickly locating an object in a Collection. Let's suppose you have a collection of objects that don't have a property that can be used as a key to retrieve them in a collection. You can work around this by usi ....Read More
Rating
Use ObjPtr to test whether two object variables point to the same object
Total Hit (2720) The standard way to test whether two object variables point to the same object is through the Is operator, as in: «Code LangId=1» If obj1 Is obj2 Then ... «/Code» However, when both object are of the same type, or point to the same secondary interface, you can slightly optimize your code by t ....Read More
Rating
Using CallByName with nested objects
Total Hit (3114) Sometimes Microsoft documentation can be, well lacking is a kind word, and one is reluctant to call tech support when they smoke your credit card first, and ask questions later. My problem was that the CallByName procedure was refusing to call nested lasses. To see what I mean, consider that if y ....Read More
Rating


(Page 8 of 133) 3985 Result(s) found  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 ...

Recommanded Links

 

Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.