From news.csusb.edu!csus.edu!wupost!udel!MathWorks.Com!news.kei.com!news.byu.edu!news.provo.novell.com!park.uvsc.edu!knosack Mon Mar 21 14:46:56 1994 Newsgroups: comp.lang.basic.visual,comp.answers,news.answers Path: news.csusb.edu!csus.edu!wupost!udel!MathWorks.Com!news.kei.com!news.byu.edu!news.provo.novell.com!park.uvsc.edu!knosack From: knosack@park.uvsc.edu (Kris Nosack) Subject: comp.lang.basic.visual General Frequently Asked Questions X-Content-Currency: This FAQ changes regularly. When a saved or printed copy is over 6 months old, please obtain a new one. Expires: Thu, 7 Apr 1994 06:30:11 GMT Reply-To: ac150@freenet.buffalo.edu (Peter G. Millard) Organization: Visual Basic FAQ Maintainers Date: Mon, 21 Mar 1994 06:30:19 GMT Approved: news-answers-request@MIT.Edu X-Posting-Frequency: Posted on the 5th and 20th of each month. Message-ID: Followup-To: comp.lang.basic.visual Summary: General information and frequently asked questions concerning Microsoft's Visual Basic products. Keywords: FAQ VISUAL BASIC GENERAL INFORMATION Sender: knosack@park.uvsc.edu (Kris Nosack) Supersedes: Lines: 411 Xref: news.csusb.edu comp.lang.basic.visual:1174 comp.answers:276 news.answers:591 Status: O Posted-By: auto-faq 3.1.1.2 Archive-name: visual-basic-faq/general-info GENERAL INFORMATION about Microsoft's Visual Basic the COMP.LANG.BASIC.VISUAL newsgroup ========================== PREFACE: This document is a compilation of frequently asked questions and their answers about Visual Basic in general which have been gathered from the comp.lang.basic.visual newsgroup. Although some efforts have been made to find obvious errors, there is no guarantee that the information in this document is error-free. The FAQ maintainer, or anyone else associated with this document, assume NO liability for the content or use of this document. If you find any errors, please report them to the address given below. Most FAQs (including this one) are available at the anonymous ftp archive site "rtfm.mit.edu". All four parts of the VB FAQ may be found in the directory "pub/usenet/comp.lang.basic.visual". You can also have the VB FAQs e-mailed to you by sending a message to "mail-server@rtfm.mit.edu" with ONLY the text "send usenet/comp.lang.basic.visual/*" in the body of the message. As the FAQ maintainers, we don't have time to explore all of the aspects of Visual Basic. we rely on your submissions to improve the quality and inclusiveness of this document. If you have found a VB hint, tip, trick, work-around, etc., please write it up and send it to us! Direct any comments/suggestions/flames to one of these addresses: Peter Millard ac150@freenet.buffalo.edu -General and VBDOS FAQ Kris Nosack nosackk@bones.et.byu.edu -General and VB/Win FAQ ========================================== I. The COMP.LANG.BASIC.VISUAL Charter: COMP.LANG.BASIC.VISUAL is an unmoderated forum to share information about Microsoft's Visual Basic for Windows and MS-DOS, as well as the new "Application Basic" embedded in MS applications such as Word for Windows, Excel, and Access. Microsoft provides no Internet support channel for Visual Basic, so this group will let Visual Basic users get together to help each other, without requiring them to filter through unrelated, broader Windows programming issues. II. What is Visual Basic and Where can I get it? Visual Basic (often abbreviated 'VB') is a programming language initially developed by Microsoft to provide programmers with a quick and easy method of developing Windows applications. Visual Basic provides the programmer with an integrated environment where s/he can use tools to create a point and shoot interface and use event driven programming techniques. A developer can quickly and easily create a user interface, then write the code to respond to specific events which occur as a result of user input. The integrated development environment (IDE) has sophisticated editing and debugging tools which allow you to attach code quick to the interface created for each event which is applicable for any type of object on the interface. Currently, there are two different "flavors" of Visual Basic. The original language was developed for Windows (often abbreviated 'VB/Win') and will only create apps for it. Visual Basic for DOS (often abbreviated 'VBDOS') came along later as the demand for point-and-shoot applications grew. The two flavors are similar in programming techniques (they both use event-driven subroutines), however they remain vastly different products. III. What's the difference between VB/Win & VBDOS? VB/Win gives you the capability of creating applications which run in Windows, while VBDOS gives you the ability to develop apps which do not need Windows to run and run in text mode using the extended character set to give the user the feeling of a graphical environment, while still remaining in a text mode. VB/Win applications are compiled into a pseudo-code (p-code) file with an "EXE" extension. When run, the p-code file accesses a run-time Dynamic Linked Library (DLL) (VBRUNx00.DLL) which interprets the p-code into Windows(tm) Aplication Programming Interface (API) instructions. VB/Win cannot create a stand- alone application (i.e. an executable which does not need the VBRUNx00.DLL.). Currently, applications developed using a particular version of VB/Win requires the same version of the run-time DLL. Therefore, a VB application developed in VB/Win version 3.0 will only work if the run-time DLL VBRUN300.DLL is installed in either the WINDOWS or SYSTEM directories. VBDOS can create both types of applications. Those that require a run-time module, or those that are a stand-alone .exe file. IV. What are the features of the Professional vs. the Standard editions of the VB products? A. VB/Win Both editions (version 3.0) include all of the basic graphic primitives (controls) that make Windows(tm) such a nice Graphical User Interface (GUI) to work with, such as: text boxes, message boxes, drop-down menus, combo boxes, Multiple Document Interface, File controls, etc. Version 3.0 added database capabilities by tying into the Microsoft Access database engine (a DLL that handles all the actual database file manipulation). The Professional Edition includes: more reference materials (manuals, Knowledge Base, Windows API information, etc.), more extensive database capabilities (ability to create databases), additional controls for serial port communications, masked text boxes, 3D "sculpted" controls, etc., Pen API support, and more! Serious programmers and developers would be best served by the professional edition. Most VB/Win users on the comp.lang.basic.visual newsgroup feel that the added features of the Professional Edition make it well worth the extra cost. The Standard Edition is sufficient for small and fairly simple programs and "hobby" programmers. Since Microsoft offers an upgrade path from the Standard to the Professional Edition, those who aren't sure they need the Professional Edition can start with the Standard Edition and move up when they're ready. B. VBDOS Both version of VBDOS load and run all existing QBasic and QuickBasic programs. With little or no effort, your QBasic and QuickBasic programs can use the compiler in Visual Basic for MSDOS to take advantage of optimized code generation and greater string capacity. The professional edition has the capability of loading and running Basic PDS programs designed for MS-DOS. Both editions of VBDOS allow you to incrementally add forms, dialog boxes, and controls to existing applications without rewriting them. The Professional editions of VBDOS includes 286 and 386/486 specific code generation in its native code compiler. Also included is a high-speed alternate floating- point math library. The MOVE Overlay technology found in MS C/C++ 7.0 allows compiled programs to be up to 16MB! Also included is the MS Source Profiler which allows you to fine tune your applications, stub files which allow you to remove run-time functionality your program does not use. The Professional edition also includes a powerful ISAM (Indexed Sequential Access Method) Database engine for developing database applications which can use database files up to 128MB. Here are the additional features you will find in the professional edition of Visual Basic for MS-DOS: Feature Notes - ------------------------------------------------ ---- Help toolkit create on-line help Setup toolkit create distribution disks CodeView debugger version 4.02 Financial toolkit functions from Microsoft Excel Present. graphics kit make charts and graphs Matrix math toolkit matrix operations Create custom controls requires MS MASM Create custom rtms Put your modules into RTM. Microsoft mouse driver version 8.2a (NOTE: RTM = Runtime Module) V. What to do BEFORE you post. First, consult the manuals included with Visual Basic. The manuals *generally* do a good job explaining most of the basics of Visual Basic. Expect to be flamed if you post a question to the newsgroup that is plainly answered in the manual! Second, check the Knowledge Base (KB). The Knowledge Base is a file that documents many of the most common problems / bugs / questions that the VB technical support folks at Microsoft have encountered. The Knowledge Base comes standard with the Professional Edition, but Standard Edition users can get a copy of the Knowledge Base via ftp (see section VII), CompuServe, America On-line, or your local BBS. The file *should* be named something like "vbkb". Third, check the FAQ. Since you are reading this document, I don't think much needs to be said here. As a side note: PLEASE, encourage those who post frequently asked questions which are covered in this document to get and read the FAQ! If we don't, people will just keep posting those same questions over and over. Help us break this cycle of over-dependency on knowledgeable and kind-hearted newsgroup users. Forth, thoroughly test the problem you are encountering. You are more apt to get some useful help if you can speak intelligently about the problem you are having and what you have done to try and fix or get around the problem. Finally, post to the COMP.LANG.BASIC.VISUAL newsgroup. Helping each other with Visual Basic problems and questions is a lot about what this newsgroup is about. If you've done your homework, you will probably be met with helpful responses to your inquiry. Since both VB/Win and VBDOS users read this newsgroup, please prefix the subject line of your post with a note that indicates which type of VB you're using (i.e. "Subject: [VB/Win] Problem with DoEvents", "Subject: [VBDOS] Question on ISAM parameters"). VI. What are some good 3rd party books to learn vb? We (the editors) have compiled a list of various books which cover a wide range of VB/Win subjects. Many of the books are personal reccommendations from various people on the net. The remaining books came from a keyword search of 'VISUAL' at the internet site BOOKS.COM. This site can be used to purchase books via credit card or you can use their database of books to find information as I have done. A complete list can be found at the end of this document. VII. What are some other VB resources and where can I get them? The Knowledge Base (often abbreviated 'KB') is a file that documents many of the most common problems, bugs, questions, tips, fixes and work-arounds that the VB technical support folks at Microsoft have encountered. The KB comes standard with the Professional Edition, but Standard Edition users can get a copy of the Knowledge Base via ftp (see section VIII), CompuServe, America On-line, or perhaps even your local BBS. Many answers to common VB problems can be found in the KB. This file is a must-have! Visual Basic Tips and Tricks is a compilation of useful VB code examples, a listing of the latest VB file versions and dates, and other useful information that isn't in the Knowledge Base. VB Tips and Tricks is a Windows help file put together by Dave McCarter of DPM Computer Solutions. It can be found at many places (including ftp.cica.indiana.edu) as "VBTIPSxx.ZIP", where xx is the version number (larger numbers represent newer versions). It is updated on a monthly basis. VIII. Where can I get good Public domain, shareware, or freeware software for VB? A. FTP VB/windows ftp sites: --------------------- ftp.cica.indiana.edu:/pub/pc/win3/programr/vbasic Best/largest source for Visual Basic files, utilities, example programs, VBXs, etc. ftp.microsoft.com: Microsoft's anonymous ftp site. There is a lot on this site so look around. Here are some of the more useful directories: /Softlib/MSLFILES Get the Knowledge Base for VB here! VBKB.EXE (929K) is the regular KB in windows help format. VBKB_FT.EXE (2,563K)is the same as VBKB.EXE but with text searching added. Lot's of other good files in this directory. /MSDN Contains LOTS of Windows programming files and examples! Get the index file MSDN-IDX.ZIP for a description of the files in this directory. Suggestion: search the index file for the text "Visual Basic". /MSDN/VBTECH VB specific files. /DEVTOOLS/LANG/VB/PUBLIC Misc. VB files and updates. B. BBS The Centre Programmers Unit a public BBS in Bellefonte, PA, which caters to programmers and UNIX users. This board has a fairly large-sized BASIC file section, with some Visual BASIC files uploaded from users, and culled from various FTP sites. VB users are welcome. The phone number is 814-353-0566. The system is up 24 hours a day, 7 days a week, and has a USR Dual Standard (14.4HST/V.32bis) online. There is no charge for access, but a file upload/download ratio is enforced. C. Compuserve Compuserve does have a fairly active basic forum. To acces this forum, type GO MSBASIC. Microsoft employees have been known to frequent this forum. May be useful for those last ditch pleas for some useful tidbit of information. Some Useful files in the MSBASIC forum: - VBBK05.ZIP: List of books/mags dealing with VB. - MLIST4.ZIP: Multi-column listbox. No 64K limit. D. America On-Line America On-Line has a good selection of VB files and an active message area for discussing Visual Basic. IX. Specific Question and Answer sections A. VB/Win - refer to the post titled: "comp.lang.basic.visual VB/Win Frequently Asked Questions". B. VBDOS - refer to the post titled: "comp.lang.basic.visual VB/DOS Frequently Asked Questions". X. Appendix for FAQ POST #1 ======================== BOOK LIST for VB/Win ======================== ---From: ian@monty.demon.co.uk (Ian Piper) Here, in descending order of usefulness (in my own personal opinion) are the VB books I use the most: 1. Visual Basic Programmers guide to the Windows API, by Daniel Appleman. ISBN1-56276-073-4. If you only want to get one book on VB, this is the one. It covers the ground from simple to advanced programming very well. 2. The Waite Group's VB How-To, several authors, ISBN 1-878739-09-3. This is the ISBN number for version 1 - I think it's been updated by now. Lots of examples to demonstrate each point. This is a close second. 3. Visual Basic Utilities, by Paul Bonner, ISBN 1-56276-106-4. This has some excellent learning stuff in it and also some advanced stuff, including how to write your own DLLs (!) using GFA-BASIC. 4. Fun programming with VB, several authors, ISBN 1-56529-106-9. This uses a half-dozen or so projects to illustrate how various programmers designed and built apps using VB. 5. Windows 3.1 programming for mere mortals, by Woody Leonhard, ISBN 0-201-60832-4. This covers VB and WordBasic. Some very neat examples. ---From: tivadar@interaccess.com (John Quarto-vonTivadar) I found the following VERY useful, to the point that I don't even use the manuals anymore: 6. The Visual Guide to Visual Basic for Windows, by Richard Mansfield, published by Ventura Press. This is a encyclopedia of the language itself. It supposes that you DO know how to program so basically (if you pardon the pun) it's a guide to VB's slang. I use this for referencing the grammar when i get a bug. ---From: idavidson@csu.edu.au (Ian Davidson) 7. Visual Basic How-To, Robert Arnson, Daniel Rosen, Mitch Waite & Jonathon Zuck: The Waite Group, 1992. ISBN 1-878739-09-3. Includes disk. Many practical examples & some sample custom controls.Introduces & expands on the use of API's. An excellent book suitable for Beginners thru Advanced - one of my most-often-used references. 8. Learn Programming and Visual Basic with John Socha, John Socha: Sybex, 1992. ISBN 0-7821-1057-6. Includes disk. A useful introduction for absolute beginner programmers thru intermediate. ---From EDITOR: The following books were those I found using a keyword search of 'VISUAL' at the internet site BOOKS.COM. This site can be used to purchase books via credit card or you can use their database of books to find information as I have done. Author : Nelson, Ross Title : The Microsoft VB for Windows Primer ISBN : 1556154771 Dewey # : 005.10 Publisher: Microsoft Pr Date Pub : 11/92 Author : Orvis, William Title : Do It Yourself Visual Basic for Windows ISBN : 0672302594 Dewey # : 005.10 Publisher: Sams Date Pub : 11/92 Author : Cornell, Gary Title : Visual Basic for Windows Inside and Out ISBN : 0078819318 Dewey # : 005.10 Publisher: Osborne McGraw Hill Date Pub : 01/93 Author : Craig, John Clark Title : Microsoft VB Workshop/Book and Disk ISBN : 1556153864 Dewey # : 5.26 Publisher: Microsoft Pr Date Pub : 09/91 Author : Murray, William H./Pappas, Chris H. Title : Using VB : Writing Windows Apps ISBN : 0201581450 Dewey # : 5.43 Publisher: Addison Wesley Pub. Co. Date Pub : 01/92 ======================== BOOK LIST for VBDOS ======================== Author : Hergert, Douglas A. Title : Visual Basic Programming With DOS Applications / Book and Disk ISBN : 0553370995 Dewey # : 005.00 Publisher: Bantam Doubleday Dell Pub Date Pub : 07/92 From news.csusb.edu!csus.edu!wupost!udel!MathWorks.Com!news.kei.com!news.byu.edu!news.provo.novell.com!park.uvsc.edu!knosack Mon Mar 21 14:46:56 1994 Newsgroups: comp.lang.basic.visual,comp.answers,news.answers Path: news.csusb.edu!csus.edu!wupost!udel!MathWorks.Com!news.kei.com!news.byu.edu!news.provo.novell.com!park.uvsc.edu!knosack From: knosack@park.uvsc.edu (Kris Nosack) Subject: comp.lang.basic.visual VB/Win Frequently Asked Questions X-Content-Currency: This FAQ changes regularly. When a saved or printed copy is over 6 months old, please obtain a new one. Expires: Thu, 7 Apr 1994 06:30:23 GMT Reply-To: nosackk@bones.et.byu.edu (Kris Nosack) Organization: Visual Basic FAQ Maintainers Date: Mon, 21 Mar 1994 06:30:26 GMT Approved: news-answers-request@MIT.Edu X-Posting-Frequency: Posted on the 5th and 20th of each month. Message-ID: Followup-To: comp.lang.basic.visual Summary: Frequently asked questions concerning Visual Basic for Windows. Keywords: FAQ VISUAL BASIC WINDOWS Sender: knosack@park.uvsc.edu (Kris Nosack) Supersedes: Lines: 632 Xref: news.csusb.edu comp.lang.basic.visual:1175 comp.answers:277 news.answers:592 Status: O Posted-By: auto-faq 3.1.1.2 Archive-name: visual-basic-faq/windows VISUAL BASIC FOR WINDOWS (VB/Win) Commonly asked Questions & Answers Section IX - B ------------------------------------ PREFACE: This document is a compilation of frequently asked questions and their answers about Visual Basic for Windows which have been gathered from the comp.lang.basic.visual newsgroup. Although some efforts have been made to find obvious errors, there is no guarantee that the information in this document is error-free. The FAQ maintainer, or anyone else associated with this document, assume NO liability for the content or use of this document. If you find any errors, please report them to the address given below. Most FAQs (including this one) are available at the anonymous ftp archive site "rtfm.mit.edu". All four parts of the VB FAQ may be found in the directory "pub/usenet/comp.lang.basic.visual". You can also have the VB FAQs e-mailed to you by sending a message to "mail-server@rtfm.mit.edu" with ONLY the text "send usenet/comp.lang.basic.visual/*" in the body of the message. As the FAQ maintainer, I don't have time to explore all of the aspects of Visual Basic. I rely on your submissions to improve the quality and inclusiveness of this document. If you have found a VB hint, tip, trick, work-around, etc., please write it up and send it to me! Kris Nosack nosackk@bones.et.byu.edu - VB/Win FAQ maintainer Special thanks to Jan Steinar Haugland for NUMEROUS contributions to this document and to Adam Harris for reviewing it. Thanks! -------------------------------------------------------------------------- 1 Does VB/Win make standalone .exe files? VB/Win can not make standalone .exe files. All VB/Win programs distributed must be with the VBRUNx00.DLL file. This DLL must accompany all VB/Win programs. 2 What is the current version of the VB compiler? VB/Win is currently at version 3.0 3 How do I make a text box not beep when I hit the enter key? Put "something else" in your _KeyPress event, depending on what you really want. This code example makes *nothing* happen, for an extended period of time: Sub Text1_KeyPress (KeyAscii As Integer) If KeyAscii = 13 Then '13 is Key_Return KeyAscii = 0 '0 (zero) is nothing End If End Sub This might not be a very nice thing to do, since your users usually have some intention when they press Enter. Usually they will want to jump to the next control, like the Tab key does. You will then change the line KeyAscii=0 to KeyAscii=9 (Key_Tab) in the example above. By the way, you'll also find this in the Microsoft VB Knowledge Base. They add that you should set the MultiLine property to False. Of course. 4 How do I break lines of long text into multiple lines of text in the msgbox? Use the append a chr$(13) to the end of the string to break lines into multiple lines. For example: msg$ = "This is line 1" + chr$(13) msg$ = msg$ + "This is line 2" MSGBOX msg$ 5 What's the difference between MODAL and MODELESS forms? 5.1 Modal forms are forms which require user input before any other actions can be taken place. In other words, a modal form has exclusive focus until it is dismissed. When showing a modal form, the program pauses at the SHOW command until the modal form is either hidden or unloaded. The internal MSGBOX and INPUTBOX$ forms are examples of modal forms. To show a form modally, use the syntax: MyForm.SHOW 1 5.2 Modeless forms are those which are shown but do not require immediate user input. Most child forms (in a MDI application) are typically modeless. To show a form modeless, use the syntax: MyForm.SHOW 6 When/Why should I use Option Explicit? Option Explicit forces you to declare all variables before using them. Opinions vary greatly on this subject. The main reason to use the OPTION EXPLICIT statement at the top of all modules is to minimize the amount of bugs introduced into your code by misspelling a variable name. Most variants of BASIC (including VB) have the capability to create variables 'on the fly' (without any declarations). This capability can be a double edged sword. At the minimum, it is suggested to use the DEFINT A-Z statement in leu of OPTION EXPLICIT. This statement will cause any variables which are created on the fly to be created as integers as opposed to single precision. (Integers take up less memory). The OPTION EXPLICIT statement causes VB to 'disable' it's ability to create variables on the fly. Thus, all variables must be declared using a DIM or REDIM statement. All variables not declared will cause an error when the OPTION EXPLICIT statement is used. This will eliminate any bugs when a variable is misspelled. 7 Is the Variant type slower than using other variable types? Generally, yes. The Variant variable type also increases memory overhead. To test the speed difference, try the following piece of code in somethink like a button_click event: Dim Va As Variant Dim In As Integer T1! = Timer For i% = 1 To 32766 Va = i% Next i% T2! = Timer Debug.Print "With variant: "; Format$((T2! - T1!), "0.0000") T1! = Timer For i% = 1 To 32766 In = i% Next i% T2! = Timer Debug.Print "With integer: "; Format$((T2! - T1!), "0.0000") This test shows (on our test system) that integers are ~60% faster! However, for strings there where no real difference, or in some instances, variants were faster than strings for routines with heavy conversion usage. For the best result in your application, test your routines directly. 8 How do I tell when an application executed using the SHELL command is finished? Use the GetModuleUsage command in VB. The following code shows a simple example: [Answer by Kenn Nesbitt: Microsoft Consulting Services] [(kennn@netcom.com)] 'Shell() doesn't really return a task handle, it returns an 'instance handle. Any documentation that says otherwise 'is wrong. But nevermind that; the answer to your question 'is to use the API call GetModuleUsage. It's like this: 'Put this in the general declarations of your form/module '*** The next 2 lines should be all on one line. Declare Function GetModuleUsage Lib "Kernel" (ByVal hModule As Integer) As Integer 'Here's where you shell out to the other program intHandle = Shell("PROGRAM.EXE") Do While GetModuleUsage(intHandle) > 0 DoEvents Loop 9 What are some tips for using Setup Wizard? 9.1 There were some bugs in the setup utilities supplied with VB. Be sure to get the newest version of SETUPKIT. It is available from the sources listed in Section VIII of the General FAQ (Part 1). Alternatively, if you have the older versions, you may have to manually remove the line referring to OLE2UI.DLL in the file SETUPWIZ.INI. (Does anyone know the file dates or versions of the old [buggy] and new [fixed] Setup Wizard ?) 9.2 Set all involved EXE, DLL and CVX files to Read-Only so that the setup program doesn't modify them. (Thanks to 21667cfm@msu.edu (Charles F. Mulks) for this tip.) 10 Calling DLLs in VB (including the Windows API): 10.1 What is the Windows API? The Windows API is a collection of Dynamic-link Libraries (DLLs) that do most of the common things in Windows. Calls to the Windows API gives you access to routines that do things like drawing menu bars, manipulating bitmaps, playing sound files, and pretty much every other function of Windows. 10.2 How do I call a DLL? Basically, you declare a DLL procedure which you can call in your VB program which in turn passes data to and/or retrieves data from the DLL. You should read the section of the VB manual that talks about calling DLLs ("Chapter 24 Calling Procedures in DLLs" in the VB 3.0 Programmer's Guide). This chapter covers the basics of using the Windows API DLLs and calling DLLs in general. Beyond that you may want to find a good book on this subject since it is too large to cover here (see the Book Listing in the Appendix of the General FAQ - Part 1). Don't be too intimidated! Using DLLs (especially many of the Windows API functions) is quite easy, once you learn how to call them. In fact, many of the newer DLLs include VB-compatible modules! 10.3 What about DLL calls that require callbacks? ---From: whill@netcom.com (Walter Hill) Dan Appleman's "Visual Basic Programmer's Guide to the Windows API" comes with a floppy disk which code samples and tools. It also includes a VBX which supports the callbacks which many API calls require. Dan is also founder and president of Desaware which sells more extensive tools, including SpyWorks, for VB developers. 10.4 Tips for calling DLLs (such as the Windows API) 10.4.1 Using the BYVAL keyword is critical. Using it when you're supposed to call by reference and (more common) not using it when you are to give a value to the external function are the single most common mistakes. Wrong calling convention can often result in a General Protection Fault (GPF) or, even worse, corruption of another applications data. 10.4.2 Check return and parameter types. For return types, a C function declared as "void" means you use a Sub not a Function. 10.4.3 Initialize strings! If you pass a string that is too short to the API it will happily write past the end of the string and possibly corrupt data. 10.4.4 Use Option Explicit. A typing error that results in a bug in the VB source will occasionally cause a GPF when you call external code. 10.4.5 It's a jungle out there. Check parameter values as there is no type checking outside VB. If you make a mistake, you'll often get a GPF. 10.4.6 Save before you run. You may even need to restart Windows after a GPF, since DLL's often aren't unloaded properly. 11 How do I access C style strings? Use the 'lstrlen' and 'lstrcpy' calls found in the Kernel DLL. 12 How can I change the printer Windows is using in code without using the print common dialog? ---Hajo Schmidt (hajo@bwl.bwl.th-darmstadt.de) did this: You can change the printer the VB 3.0 Printer object is pointing to programmatically (without using the common dialogs). Just use the WriteProfileString API call and rewrite the [WINDOWS], DEVICE entry in the WIN.INI ! VB will instantly use the new printer, when the next Printer.Print command is issued. If you get the old printer string before you rewrite it (GetProfileString API call), you can set it back after using a specific printer. This technique is especially useful, when you want to use a FAX printer driver: Select the FAX driver, send your fax by printing to it and switch back to the normal default printer. 13 I'm adding lots of features to a LISTBOX, but it's sloooooow. What can I do to speed it up? VB repaints the form every time you add an item. Switch off repainting before adding items. ---Nic (Nic@skin.demon.co.uk) gave this advice: The basic problem with listboxes is that VB forces a repaint every time you call AddItem. You can get around this by switching off painting and then using LB_ADDSTRING messages to add items. If you want a code sample mail me and I'll get one from one our apps. 14 How do you make a TEXTBOX read only?. Or, how do I prevent the user from changing the text in a TEXTBOX? There's a lot of ideas on this one. You can grab the _KeyPress and _KeyDown events and set them to zero. However, the best idea is to use the Windows API SendMessage function to tell the control to become read-only: ---From: pjones@csi.compuserve.com (Pete Jones) 'After making the following declarations... Global Const WM_USER = &H400 Global Const EM_SETREADONLY = (WM_USER + 31) ' *** next 3 lines should be on 1 line Declare Function SendMessage Lib "User" (ByVal hWnd As Integer ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Long 'Then Try: SendMessage(Text1.hWnd, EM_SETREADONLY, 1, 0) 15 Are there any examples of commercial applications built using Visual Basic? Profit by Microsoft was written mostly in Visual Basic. In fact, Profit was one of three programs recently selected as PC Magazine's Editor's Choice among Windows small business accounting packages. 16 How much gain in performance will I gain if I write my number crunching routines in C instead of in basic? Probably the best solution to the number crunching problem is to write the number crunching routines as a custom control or a DLL, and plug it into a VB app. VB interface handling is not significantly slower than, say C++, and most of the wait is associated with Windows. Some real world experience speaks volumes about this one: ---From: steinbeck@uni-bonn.de (Christoph Steinbeck) I wrote some time consuming code in VB to solve a combinatorical (does this word exist in English?) problem. The code consists of one main recursive function, which calls itself very often. It took a night to compute a certain problem. I was rather disappointed and then decided to write the central routine in C++. It was a 1:1 transcription. The routine was compiled with the MS C++-Compiler. It took only 22 Minutes for the same problem. Amazing, isn't it? The routine doesn't do any floating point arithmetic, only integer, and handles some arrays. The PC was a 33MHz 486. And the second amazing thing is, that a IBM RS6000 (560)-Risc-machine needed 17 Min for the same code. I was the only one on the machine. I though, it should be much faster. The MS C++ seems to make very fast, optimized code. The optimization was configured to make fast code. 17 What is passing by reference? Arguments are either passed by reference or by value. When they are passed by value, they cannot be changed by the procedure/function they are passed to. They *can* be altered when passed by reference, since passing by reference is just passing the address. Also note the following nasty trap: Arguments are passed by reference unless enclosed by parentheses or declared using the ByVal keyword. [VBWin Language Ref., p. 55] 18 Is a property a variable? No! It's actually a function call. 19 How do I speed up control property access? Instead of using a property in a loop, you will be better off using a normal variable in the loop and then assign the variable once to the property afterwards. Also, when reading a property, you should read it once into a variable instead of using it in a loop. Sometimes it is not possible to simply put contents of a property into a variable. For example, if you are using a list box or you need to conserve memory. In these cases you can send the WM_SetRedraw message to the control to prevent redrawing. You can typically increase the speed 6-10 times - or even more. Add the following declares: Declare Function SendMessage Lib "User" (ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Long Const WM_SetRedraw = &HB And add to your code: Result% = SendMessage(Text1.hWnd, WM_SetRedraw, 0, 0) 'redraw off 'Do your stuff here! Result% = SendMessage(Text1.hWnd, WM_SetRedraw, 1, 0) 'redraw on This same method applies to list boxes and other controls. 20 How can I create a VBX? VBXs are usually written is C (Borland, VC++). You should refer to the _Control Development Guide_ (in VB Professional Features Vol. I) and any relevant documentation for your compiler. Followup questions should be directed to comp.lang.c.*. 21 Can a VB application be an OLE server? No. You'll have to use an external DLL/VBX. If you see any examples, please tell the newsgroup. 22 How do I use DDE? The VB KnowledgeBase gives information on DDE generally, and also explains how to "talk to" the Program Manager with DDE. The documentation, also the Visual Basic Help, includes a fine example. Search for "LinkExecute". 23 Are there restrictions on what I can distribute with my VB program? The documentation tells what parts of the Visual Basic kit you can freely distribute: the VBX files, some DLL's and what the SetupKit includes on distribution diskettes. Reading software license agreements may be more boring than asking the newsgroup, but is nevertheless a good idea. 8) There have been some rumors on the newsgroup that you can't redistribute programs written with VB freely. This is nonsense. All applications created with VB can be redistributed freely without royalties (as long as you don't distribute proprietary external files). The rumors probably originated when Microsoft announced that they will not sell kits allowing third-party software to include the Visual Basic for Applications (VBA) system. 24 Is there any way to pass a variable to a form apart from using global variables? While we wait for Microsoft to correct this annoying shortcoming, here's a nice "quick & dirty" method: ---From Dave Mitton (mitton@dave.enet.dec.com): The standard workaround is to put an invisible text box (or caption or any other control that suits your use.) on the target form and access it by Form.textbox = "value". Then you can use the Change event of that control to do anything you want in that form. Also, check out the .Tag property which is a "what-you-want" property where you can hook any string you want onto a control. This property can also be accessed from other modules. 25 How do you use dates to prevent problems in other countries? If you use MM/DD/YY format dates in a program, you will get either a runtime-error (ie. month>12) or the wrong date (ie. March 12 instead of December 3) when your program is used in Europe. And vice versa, of course. Even Microsoft's own example programs (like the MAPI sample) make this stupid mistake. Use the Format command to make sure you get the date you want. For example: strTodaysDate = Format[$](Now, "Short Date") As a side note, Microsoft has taken much heat on the newsgroup for VB's bad support for Internationalization! 26 How do I implement Undo? For most controls, you will have to keep track of changes yourself. However, if you use the standard Text box or Combo box Windows provides a "free" undo function for you! Do the following declares: Declare Function SendMessage Lib "User" (ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Long Global Const WM_USER = &h400 Global Const EM_UNDO = WM_USER + 23 And in your Undo Sub do the following: UndoResult = SendMessage(myControl.hWnd, EM_UNDO, 0, 0) UndoResult = -1 indicates an error. 27 How do I create a window with a small title bar as in a floating toolbar? Download the MSGBLAST VBX from ftp.microsoft.com (filename "8-3.ZIP") or TBOX100.ZIP from ftp.cica.indiana.edu. These files provide an example of a form with a small title. When you see it, you'll understand why we haven't include a full explanation here! 28 How do I get my application on top? Set "MyForm.ZOrder = 0". Warning: It is consider bad behavior for applications to elbow to the top without allowing the user to turn this option off. An appropriate use would be for a "splash screen" that comes up to pacify the user while the program is loading. 29 How do I do drag & drop between applications? Get the file FMDROP10.ZIP from ftp.cica.indiana.edu in the vbasic directory. It is a good VB example of drag & drop. You may also want to get the MSGBLAST VBX (3-64.ZIP at ftp.microsoft.com in the MSDN directory) since you will need to have access to Windows messages in order to do drag & drop - unless you get a VBX to do it for you. Also, the D&DSERVE example from Windows Tech Journal Aug 92 includes a DLL for this purpose. This is available from some ftp sites. Drag & Drop Client: the form you drop objects to/on Drag & Drop Server: the form you drag object(s) from 30 How do I use GetPrivateProfileString to read from INI files? You declare these API function as usual: Declare Function GetPrivateProfileString Lib "Kernel" (ByVal lpApplicationName As String, lpKeyName As Any, ByVal lpDefault A String, ByVal lpReturnedString As String, ByVal nSize As Integer, ByVal lpFileName As String) As Integer Then in your code you do like below: strIniFile = "WIN.INI" strSection = "MyProgram" strKey = "Language" strDefault = "English" iLength = 70 strReturn = String$(iLength, " ") 'Pad the string first! iResult = GetPrivateProfileString(strSection, strKey, strDefault, strReturn, iLength, strIniFile) 31 How do I mimic a toggle button? The only "fix" we know for this problem is to use a picture control to mimic the action of a button or button3d control. You need two bitmaps, one for buttonup and one for buttondown. This is a kluge, we know. 32 How do I get a called DOS task to run minimized (to hide it)? If you run a DOS program minimized, it will wait forever since DOS tasks by default are NOT set to run in the background. You will have to make a PIF file beforehand for the program you need to run. This program can be shelled to and run minimized if you check the box for "background" in your pif editor. 33 How do I play MID, WAV or other multimedia files? Use the MSMCI.VBX, provided with VB/Win Pro 3.0. You can also declare and call the MM-functions manually: Declare Function mciExecute Lib "MMSystem" (ByVal FileName as String) As Integer Sub Form1_Click () iResult = mciExecute("Play c:\windows\mkmyday.wav") End Sub 34 I have [several] megabytes of memory. Why do I get an out of memory error? Unfortunately, Microsoft is more famous for memory barriers than anything else. This is a late descendant of the infamous 640K barrier in DOS that has been plaguing us for years. Although Windows allows the user to access several megabytes of memory, it uses two limited (64K) memory areas called User Heap and GDI Heap. Go to the Help|About box in Program Manager to see the percentage of free resources in the *most* exhausted heap. If these areas are exhausted, you are out of luck. VB programs are unfortunately rather greedy on these structures. Windows 4 is supposed to free us from this limitation... 35 Is the Access Engine in Visual Basic Pro good enough? That, of course, depends. Generally the answer is "yes", but you may need some third-party add-on products. These are the major weaknesses of VBPro's database: - Limited data controls: No add, delete or search button; no bound list box or masked edit control and - the worst - no bound grid! - No run-time query builder ("how good is your user in SQL?") or report builder. - No direct advanced control of the Access 1.1 Database Engine. The good news is that lots of companies are willing to sell you products which address one or more of the above weaknesses. Also, if you build a database application with advanced database relations, it can be a good idea to build the database with Access and the front-end with VB. 36 How do you avoid the "Invalid use of null" error when reading null values from a database? If you try to retrieve a null value (empty field), you will get the error: "Invalid use of Null". Here is one way to get around this problem: ---Ralf Metzing (rmm@dragon.stgt.sub.org) gave this answer: I've worked around this problem with the following code: TextBox.Text = MyTest.Fields("TestFld") & "" This code converts the Null-Value into an empty string. 37 How do I dial a phone number using the MSCOMM VBX in VB Pro? The MSCOMM VBX is great for creating communication programs, but it's overkill for dialing a phone number. Try the following code: PhoneNumber$ = "(123) 456-7890" Open "COM2" For Output As #1 'or COM1 Print #1, "ATDT" & PhoneNumber$ & Chr$(13) Close #1 38 How do you change the system menu (on the Control-Menu Box)? You can turn off the minimize and maximize menu options by changing properties, but what if you're doing something critical in your VB program that should not be interrupted and you need to remove the "close" option? Make the following declares: Declare Function GetSystemMenu Lib "User" (ByVal hWnd As Integer, ByVal bRevert As Integer) As Integer Declare Function RemoveMenu Lib "User" (ByVal hMenu As Integer, ByVal nPosition As Integer, ByVal wFlags As Integer) As Integer Global Const MF_BYPOSITION=&H400 Use the following in your code to remove the "close" option: SystemMenu% = GetSystemMenu (hWnd, 0) Res% = RemoveMenu(SystemMenu%,6, MF_BYPOSITION) Res% = RemoveMenu(SystemMenu%,6, MF_BYPOSITION) 'also remove the separator line Check out the GetMenuID and InsertMenu API functions to do more complicated tasks. 39 How do I get the Tab key to be treated like a normal character? You must set TabStop = False for ALL controls on the active form. Then you will be able to insert "tab" characters in controls like the text box. If you feel you need the Tab key to behave "normal" outside one specific control, it is trivial to emulate its functionality in code: Sub Command1_KeyDown (KeyCode As Integer, Shift As Integer) If KeyCode = 9 Then If Shift = 0 Then Command2.SetFocus 'Tab=Next control ElseIf Shift = 1 Then Command3.SetFocus 'Shift-Tab=Previous control End If End If End Sub MISCELLANEOUS TIPS 1 When you are ready to compile your VB project into your 'finished' EXE, be sure to save the project files, exit VB, run VB, load your project and go straight to compiling. Otherwise, your EXE will be larger in file size than necessary due to 'garbage' getting included in the EXE. For some reason, VB does not fully clean up all of the previously used variables or objects that you may have been playing with while developing your program so these get included in your EXE even though they aren't used. 2 Multiple END statements can be dangerous. Suggestion: put the end statement used to exit your program *only* in the Form_Unload event of the main form. Whenever you want to end the program, just tell the main form to unload. From news.csusb.edu!csus.edu!wupost!udel!MathWorks.Com!news.kei.com!news.byu.edu!news.provo.novell.com!park.uvsc.edu!knosack Mon Mar 21 14:46:56 1994 Newsgroups: comp.lang.basic.visual,comp.answers,news.answers Path: news.csusb.edu!csus.edu!wupost!udel!MathWorks.Com!news.kei.com!news.byu.edu!news.provo.novell.com!park.uvsc.edu!knosack From: knosack@park.uvsc.edu (Kris Nosack) Subject: comp.lang.basic.visual VB/DOS Frequently Asked Questions X-Content-Currency: This FAQ changes regularly. When a saved or printed copy is over 6 months old, please obtain a new one. Expires: Thu, 7 Apr 1994 06:30:31 GMT Reply-To: ac150@freenet.buffalo.edu (Peter G. Millard) Organization: Visual Basic FAQ Maintainers Date: Mon, 21 Mar 1994 06:30:33 GMT Approved: news-answers-request@MIT.Edu X-Posting-Frequency: Posted on the 5th and 20th of each month. Message-ID: Followup-To: comp.lang.basic.visual Summary: Frequently asked questions concerning Visual Basic for DOS. Keywords: FAQ VISUAL BASIC DOS Sender: knosack@park.uvsc.edu (Kris Nosack) Supersedes: Lines: 221 Xref: news.csusb.edu comp.lang.basic.visual:1176 comp.answers:278 news.answers:593 Status: O Posted-By: auto-faq 3.1.1.2 Archive-name: visual-basic-faq/dos VISUAL BASIC FOR DOS (VBDOS) Commonly asked Questions & Answers Section IX - C ----------------------------------- PREFACE: This document is a compilation of frequently asked questions and their answers about Visual Basic for DOS which have been gathered from the comp.lang.basic.visual newsgroup. Although some efforts have been made to find obvious errors, there is no guarantee that the information in this document is error-free. The FAQ maintainer, or anyone else associated with this document, assume NO liability for the content or use of this document. If you find any errors, please report them to the address given below. Most FAQs (including this one) are available at the anonymous ftp archive site "rtfm.mit.edu". All four parts of the VB FAQ may be found in the directory "pub/usenet/comp.lang.basic.visual". You can also have the VB FAQs e-mailed to you by sending a message to "mail-server@rtfm.mit.edu" with ONLY the text "send usenet/comp.lang.basic.visual/*" in the body of the message. This will send all four parts of the VB FAQ to you in four e-mail messages. As the FAQ maintainer, I don't have time to explore all of the aspects of Visual Basic. I rely on your submissions to improve the quality and inclusiveness of this document. If you have found a VB hint, tip, trick, work-around, etc., please write it up and send it to me! Peter Millard ac150@freenet.buffalo.edu - VBDOS FAQ maintainer -------------------------------------------------------------------------------------------- 1. How do I use (create) global variables in VBDOS? 1.1. VBDOS provides the user with two types of global variables. These are both used in declarations of variables. To share variables between all subs and functions in a specific module, use the SHARED keyword. This makes that specific variable global _in that module_. For example: DIM SHARED CancelFlag AS INTEGER would make the variable CancelFlag a global variable in that module. To share global variables between separate modules, use the COMMON keyword. For example: COMMON SHARED CancelFlag AS INTEGER would make the variable global between all modules that this common statement appears in, and since we are using the SHARED keyword also, this will also be shared in all the subs and functions in the modules which this declare statement appears. All COMMON statements must be matched between modules which the variables should be global in. For example, if you have one set of 10 COMMON statements in one module, and a different set of 10 COMMON statements in another module in the same project, you will get a 'Type Mismatch Error'. Make all COMMON blocks identical in all the modules in a specific project. 2. Does VBDOS make standalone .exe files? 2.1. VBDOS can compile programs in two different ways (user option). It can compile programs to use a RUNTIME file (like a DLL) or can be compiled as a standalone .exe file. 3. What is the current version of the VBDOS compiler? 3.1. VBDOS is currently at version 1.0 4. How do I not make a text box beep when I hit the enter key? 4.1. Put "something else" in your _KeyPress event, depending on what you really want. This code example makes *nothing* happen, for an extended period of time: Sub Text1_KeyPress (KeyAscii As Integer) If KeyAscii = 13 Then '13 is Key_Return KeyAscii = 0 '0 (zero) is nothing End If End Sub This might not be a very nice thing to do, since your users usually have some intention when they press Enter. Usually they will want to jump to the next control, like the Tab key does. You will then change the line KeyAscii=0 to KeyAscii=9 (Key_Tab) in the example above. BTW, you'll also find this in the Microsoft VB KnowledgeBase. They add that you should set the MultiLine property to False. Of course. 5. How does Visual Basic handle shelled tasks? How do I find out when they are finished. 5.1. In VBDOS, all shelled tasks are completed before control returns to the program. No tasks are done while the DOS command is being executed. 6. How do I break lines of long text into multiple lines of text in the msgbox? 6.1. Use the append a chr$(13) to the end of the string to break lines into multiple lines. EG: msg$ = "This is line 1" + chr$(13) msg$ = msg$ + "This is line 2" MSGBOX msg$ 7. What's the difference between MODAL and MODELESS forms? 7.1. Modal forms are forms which require user input before any other actions can be taken place. In other words, a modal form has exclusive focus until it is dismissed. When showing a modal form, the program pauses at the SHOW command until the modal form is either hidden or unloaded. The internal MSGBOX and INPUTBOX$ forms are examples of modal forms. To show a form modally, use the syntax: MyForm.SHOW 1 7.2. Modeless forms are those which are shown but do not require immediate user input. Most child forms (in a MDI application) are typically modeless. To show a form modeless, use the syntax: MyForm.SHOW 8. When/Why should I use Option Explicit? 8.1. Opinions vary greatly on this subject. The main reason to use the OPTION EXPLICIT statement at the top of all modules is to minimize the amount of bugs introduced into your code by misspelling a variable name. Most variants of BASIC (including VB) have the capability to create variables 'on the fly' (without any declarations). This capability can be a double edged sword. At the minimum, it is suggested to use the DEFINT A-Z statement in leu of OPTION EXPLICIT. This statement will cause any variables which are created on the fly to be created as integers as opposed to single precisions. (Integers take up less memory). The OPTION EXPLICIT statement causes VB to 'disable' it's ability to create variables on the fly. Thus, all variables must be declared using a DIM or REDIM statement. All variables not declared will cause an error when the OPTION EXPLICIT statement is used. This will eliminate any bugs when a variable is misspelled. 9. Why doesn't PRINT or CLS from a frm module work? 9.1. To print information to the screen bypassing the desktop, the commands must be issued from a .BAS module. All PRINT/CLS output from a form module is directed to the nul: device. 10. How do I invoke FKey traps which won't be triggered by other keys which share the same KeyCode? 10.1. To trap the only FKeys in events you need to use a combination of the KeyDown, KeyPress, and KeyUp events. The basic concept for this is that _all_ keys trap the UP & DOWN events, while only 'printable' characters trigger the KeyPress event. Thus, when a character key is pressed, it will trigger the KeyDown, the KeyPress, then the KeyUp events (in that order). While a FKey (or arrow, or tab, etc...) will trigger the KeyDown, then the KeyUp events (in that order). The following code uses a textbox tag property to decide whether a printable character is pressed or not. SUB Text1_KeyDown() Text1.tag = "key" END SUB SUB Text1_KeyPress() Text1.tag = "" END SUB SUB Text1_KeyUp() IF Text1.tag = "key" then '--PUT F-KEY HANDLER HERE---- ELSE '--PUT OTHER KEY HANDLERS HERE---- END IF END SUB 11. How do I boost memory available to VBDOS.EXE (the IDE)? 11.1. Try to have as much EMM available as possible. VBDOS.EXE allocates subroutines & functions which are < 16K into EMM. 11.2. To make more conventional mem availble, use the /S:n switch. This will make VBDOS.EXE use a specific amount of conventional memory. A good compromise between speed & memory is /S:340. The lower the n value, the slower the environment runs. 11.3. Running out of DGROUP usually causes most 'out of memory' errors. Possible causes are: 11.3.1.Too many subs & functions exist. Each one takes up 46 bytes of DGROUP. 11.3.2. Large static arrays. All static arrays are stored in DGROUP. If a DIM statement is for a COMMON SHARED statement, the array becomes static. Make the COMMON SHARED statement appear before the DIM statement to make the array Dynamic & therefore will not be stored in DGROUP. 11.3.3. Variable Overhead. Each var has a 4 byte overhead for _each_ module. For multiple modules projects which use lots of Global (COMMON) statements, this overhead is repeated for _each_ module. 11.4. Possible causes for running out conventional memory: 11.4.1. Not enough EMM. 11.4.2. Subs or functions which exceed 16K. 11.4.3. Large arrays. Non-variable length string arrays can be stored in EMM using the /ea switch. 12. My program runs in the IDE, but won't run when compiled?? 12.1. Arrays are dynamic by default in the IDE, but when they are compiled, they are static by default. Therefore, they are stored in DGROUP instead of the far heap. Use '$DYNAMIC to make all arrays dynamic or use REDIM instead of DIM. 12.2. Program generates a "program memory overflow" during compile. You need to break a single module into multiple ones. From news.csusb.edu!csus.edu!wupost!howland.reston.ans.net!gatech!news.byu.edu!news.provo.novell.com!park.uvsc.edu!knosack Mon Mar 21 14:46:57 1994 Newsgroups: comp.lang.basic.visual,comp.answers,news.answers Path: news.csusb.edu!csus.edu!wupost!howland.reston.ans.net!gatech!news.byu.edu!news.provo.novell.com!park.uvsc.edu!knosack From: knosack@park.uvsc.edu (Kris Nosack) Subject: comp.lang.basic.visual VB/Win Shareware VBX List X-Content-Currency: This FAQ changes regularly. When a saved or printed copy is over 6 months old, please obtain a new one. Expires: Thu, 7 Apr 1994 06:30:37 GMT Reply-To: harris@cs.uchicago.edu (Adam Harris) Organization: Visual Basic FAQ Maintainers Date: Mon, 21 Mar 1994 06:30:40 GMT Approved: news-answers-request@MIT.Edu X-Posting-Frequency: Posted on the 5th and 20th of each month. Message-ID: Followup-To: comp.lang.basic.visual Summary: Listing of Shareware VBX's for Visual Basic for Windows. Keywords: FAQ VISUAL BASIC VBX SHAREWARE Sender: knosack@park.uvsc.edu (Kris Nosack) Supersedes: Lines: 489 Xref: news.csusb.edu comp.lang.basic.visual:1177 comp.answers:279 news.answers:594 Status: O Posted-By: auto-faq 3.1.1.2 Archive-name: visual-basic-faq/vbx-list NOTICE: A greatly updated version of the Shareware Custom Controls list will be available soon! It will be posted to comp.lang.basic.visual as soon as it is done. In the mean time this older list will have to do. Shareware Custom Controls 20-Feb-94 Inaccuricies and editorializing are the sole responsibility of Adam Harris (harris@cs.uchicago.edu), who would appreciate any corrections or dissenting opinions. Archive names are from major ftp sites. Names at your favorite site may vary. All prices are in US$ and do not include S&H charges (usually $2-$3). =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Alarm Control: alarm1.vbx Archive: alarm11.zip Author: Mabry Software Price: $10.00 Ver: 1.1 Keywds: schedule Triggers events, like the timer, but using specific times rather than intervals. Wildcard matching elegantly allows you to trigger events at regular intervals (i.e., every 10 minutes). =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= BarCode Control: barcod1.vbx Archive: barcod11.zip Author: Mabry Software Price: $15.00 Ver: 1.1 Keywds: data Generates bar codes, in 4 different styles. Can be bound to a data field. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= BmpLst Control: bmplst1.vbx Archive: bmplst16.zip Author: Mabry Software Price: $20.00 Ver: 1.6 Keywds: list, graphic List box with pictures, vertically aligned over a caption. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Calendar Control: calendar.vbx Archive: vbcal.zip Author: Rijnhaave Office Automation Price: $0.00 Ver: Keywds: calendar Wierd and buggy date entry box with pop-up calendar. No customization, no documentation. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= CTLWhWnd Control: ctlwhwnd.dll Archive: vbhwnd.zip Author: Jonathan Zuck Price: $0.00 Ver: Keywds: api One function, ControlhWnd, which returns the hWnd for a given control. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= EndTask Control: entask.dll Archive: entask.zip Author: Jeff Simms Price: $0.00 Ver: Keywds: task Intercepts "End Task" from the Task Manager. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= File and Disk Space Info Control: dfinfo1.vbx Archive: dfinfo14.zip Author: Mabry Software Price: $15.00 Ver: 1.4 Keywds: disk, file Two controls provide technical statistics of a drive and extended file information, respectively. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= File Manager Drag and Drop Control: fmdrop1.vbx Archive: fmdrop10.zip Author: Mabry Software Price: $15.00 Ver: 1.0 Keywds: file, drag-drop Enables drag and drop of single or multiple files from the File Manager or what have you. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Four Controls Control: Archive: vb4ctrls.zip Author: Jeng Long Jiang Price: $0.00 Ver: Keywds: graphic, status Four graphic controls: vmeter.vbx and hmeter.vbx are "flooding" status gauge controls; spin.vbx (!) is a spin tool. The best of the lot seems to be 3dlabel.vbx, which is actually a button which holds states like a toolbar button. No documentation. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= FXTools Demo Control: fximage.vbx Archive: fxtool.zip Author: ImageFX Price: Ver: 1.0 Keywds: demo, graphic Demo of the FXTools suite of VB controls (fxlabel.vbx and fximage.vbx). An impressive collection of wipes, fades, block text, drop shadows, etc. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Grinning Jack Deck Control: vbcards.dll Archive: vbcards.zip Author: Richard R. Sands Price: $0.00 Ver: 1.01p Keywds: game Provides a bitmap collection of cards, including a joker, and basic card API. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= GT Icon Control: gticon.dll Archive: gticon.zip Author: George R. Torralba Price: $0.00 Ver: Keywds: icon, drag-drop Assigns and retrieves the DragIcon property of controls. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= GT List Box Control: gtlist.vbx Archive: tlstvbx2.zip Author: George R. Torralba Price: $15.00 Ver: 2.0 Keywds: list, graphic List box with some extra properties to let you set tab positions, control the existance of scroll bars, color items in the list, or associate bitmaps with items. [Free for non-commercial use.] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= GT Toolbar Kit Control: gttbar.vbx Archive: gttbar01.zip Author: George R. Torralba Price: $15.00 Ver: 1.0 Keywds: toolbar, graphic, status GT Toolbar provides a toolbar button, represented by a cell of a toolbar bitmap. Registered users can use the picture property to define their own toolbar graphics. (You can't force the button to stay in down state, unfortunately.) GT Panel is a stripped down 3d panel useful for as a container for toolbars or status boxes. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Ini File Manager Control: inicon2.vbx Archive: inicon26.zip Author: Mabry Software Price: $5.00 Ver: 2.6 Keywds: ini Provides an interface to reading and writing ini files, including win.ini, or application specific ini files. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= InpOut Control: inpout.dll Archive: inpout.zip Author: Jay Munro Price: $0.00 Ver: Keywds: io An INP and OUT replacement, written in assembler and used like the QuickBasic routines. Includes source. (For some reason Mr. Munro saw fit to include Software Assist's SCFILE package -- the dll is actually very small.) =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= JoyStk Control: joystk1.vbx? Archive: joystk10.zip Author: Mabry Software Price: $15.00 Ver: 1.0 Keywds: io Provides an interface to up to two joysticks. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= MailSlot Control: mslot1.vbx Archive: mslot10.zip Author: Mabry Software Price: $30.00 Ver: 1.0 Keywds: mail Mail slot interface. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Menu Event Control: menuev2.vbx Archive: menuev21.zip Author: Mabry Software Price: $10.00 Ver: 2.1 Keywds: menu, status Emits menu events while the highlight travels over entries in the menu bar, before the _click event is called. Good in combination with dynamic status boxes. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Message Blaster Control: msgblast.vbx Archive: tbox100.zip Author: Ed Staffin Price: $0.00 Ver: 1.1 Keywds: toolbar, graphic Provides a floating palette, complete with tiny title bar, which you can use in conjunction with an MDI form. Message notification is rather crude and hacky. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= MhFormScroll Control: mhfs200.vbx Archive: mhfs200.zip Author: MicroHelp Price: $0.00 Ver: 2.0 Keywds: scroll Add scroll bars to a form or a container. Crashed my computer, so I don't know if it works. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= MListBox Control: mlistbox.vbx Archive: mlist110.zip Author: Mike Warning Price: Ver: 1.1 Keywds: list Multiple selection list box with ability to find strings, associate numeric data with list items, and set tabs with some precision. Variable pricing scheme. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= MouseWatch Control: mwatch.dll Archive: mwatch.zip Author: User Friendly, Inc. Price: $0.00 Ver: Keywds: mouse, status Dynamically tracks mouse position, emitting _KeyDown events to the form. Good for dynamic hinting, a la Word Perfect. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= OpenDlg Control: opendlg.vbx Archive: opendl.zip Author: Zane Thomas Price: $0.00 Ver: Keywds: graphic Does the same thing as cmdialog.vbx. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= PBClone Windows Library Control: pcbwin.dll Archive: pcbwin.zip Author: Thomas Hanlin III Price: $19.95 Ver: 1.0 Keywds: math, utility A suite of utility routines: number of floppy or comm ports, checksums, bit operations, etc. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Percentage Bar Control: percnt2.vbx Archive: percnt23.zip Author: Mabry Software Price: $10.00 Ver: 2.3 Keywds: graphic, status Very nice 3D style percentage bar, effectively replacing threed's flooding SSPanel. Doesn't have wierd flood types like SSPanel (circular, right to left), but does include text color reversal over the flood, bevelled floods, and no flashing at all. A much more standard look. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Prompt Control: prompt.vbx Archive: prompt11.zip Author: Andrew S. Dean Price: $15.00 Ver: 1.1 Keywds: cli Textbox variant for command-line-style input. Includes argument parsing into words and a history capacity. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= QCards Control: qcard.dll Archive: qcard.zip Author: Stephen Murphy Price: $0.00 Ver: Keywds: game Deck of cards with card support functions. Can work with 2 decks at a time, no jokers. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= RoText Control: rotext1.vbx? Archive: vbrotfnt.vbx Author: Mabry Software Price: $15.00 Ver: Keywds: label, font, graphic Provides rotatable labels, TrueType only. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= SoundX Control: soundx1.vbx Archive: soundx12.zip Author: Mabry Software Price: $10.00 Ver: 1.2 Keywds: matching Metaphone and Soundex text matching algorithms let you search by phonic affinity. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= spSound Control: winsound.dll Archive: spsoun.zip Author: Alfred J. Giordano Price: $0.00 Ver: Keywds: sound Provides low-level port-based sound routines. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= ToolButton Control: toolbutn.vbx Archive: vbtool20.zip Author: Brett Foster Price: $0.00 Ver: 2.0b Keywds: toolbar, help, graphic Full-feature toolbar buttons, with up to 6 states (for attributes). Use your own image and break it into cells of graphic buttons, or use the suite of standard buttons. Also includes ContextHelp control (same vbx) to assist with help management. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= VBCTL3D Control: vbctl3d.vbx Archive: vb3d.zip (?) Author: Bernd Beeks & Jeff Sims Price: $29.00 Ver: 1.32 Keywds: graphic When added to a form, transforms standard controls into embedded, 3d controls. Covers labels, message boxes, check boxes, even menus and user-specified controls (by class name). Does not allow you to specify bevel width or depth. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= VBPoint Control: vbpoint.dll Archive: vbptr.zip Author: Jonathan Zuck Price: $0.00 Ver: Keywds: api Two routines: convert long pointers (LP) to VB strings, and copy strings to another address (another LP). =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= VideoSoft Custom Control Library Control: vsvbx.vbx Archive: 3dctrls or v Author: VideoSoft Price: $45.00 Ver: 2.2a Keywds: matching, graphic Three controls: 3D Elastic, a smart container which resizes it's contents automatically, embeds contained controls in true 3d style, and can be nested to provide code-free window splitter bars; Awksome, a text parser based on the AWK language; and IndexTab, which groups controls with a hypercard looking tabbed notepad. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= VTSocket Control: vtsocket.vbx Archive: vtsocket.zip Author: Visual Technology Products Price: $50.00 Ver: 1.0b Keywds: comm Windows sockets support. Does not support UDP sockets, out of band, or broadcasting. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= WinSock Control: vbwsk.vbx Archive: vbwsk01a.zip Author: Brian Syme Price: $0.00 Ver: 0.1a Keywds: comm Provides access to Windows Sockets API. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= ZipInf Control: zipinf1.vbx Archive: zipinf10.zip Author: Mabry Software Price: $10.00 Ver: 1.0 Keywds: compress Provides thorough information about the files in a zip archive. Does not uncompress files or deal with other sorts of archives. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=