home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Data 1996 December / CD-ROM DATA 96.ISO / SOFTDEV / VB4FAQ.TXT < prev    next >
Encoding:
Text File  |  1996-11-05  |  12.9 KB  |  250 lines

  1. *Does Visual Basic 4.0 for Windows use the new Microsoft Windows 95 controls?
  2.  
  3. Yes, Visual Basic 4.0 uses the new Windows 95 controls, but because these are 32-bit 
  4. controls for a 32-bit operating system, they are only available in the 32-bit version of 
  5. Visual Basic. 
  6.  
  7.  
  8. *Is there a way to reduce the number of supporting files 
  9. required to run my Visual Basic application?
  10.  
  11. The 16-bit version of Visual Basic 4.0 relies on several run-time OLE files that 
  12. are not included with Windows 3.1. The end result is that more files are needed to 
  13. distribute 16-bit Visual Basic 4.0 applications than 32-bit Visual Basic applications. To minimize the amount of disk space needed, be sure that your 16-bit project does not reference any OLE libraries that are not required. When creating 32-bit applications for Windows 95 or Windows NT, the disk space requirement is smaller because many of the supporting OLE files are included as a part of the operating system. 
  14.  
  15.  
  16.  
  17. *Can a developer create DLL files with Visual Basic 4.0 for Windows?
  18.  
  19. Visual Basic version 4.0 includes an option to make OLE DLL files. These files behave 
  20. similarly to standard DLLs except that they use OLE as an interface to the objects described 
  21. by the DLL. With Visual Basic 4.0, you can create reusable business objects that can be shared 
  22. across applications. Rather than having to create DLLs using a C compiler or other language, 
  23. you can now easily create reusable objects entirely from within Visual Basic. 
  24.  
  25.  
  26.  
  27. *These OLE components accomplish the re-usability of DLLs and are easier to reuse because 
  28. they are essentially self-documenting. 
  29.  
  30. At design time you can browse the components with the Object Browser and examine what 
  31. methods and properties the OLE objects expose. Similar to the way in which VBX vendors 
  32. encapsulated their expertise into controls, Visual Basic programmers can now rapidly package 
  33. their business rules, commonly-used code libraries, as well as any legacy code into reusable, 
  34. programmable objects. Once created, these libraries of reusable objects, complete with custom 
  35. properties and methods, can be used by any application capable that supports OLE Automation. 
  36.  
  37.  
  38.  
  39. *A few examples of applications that can reuse these objects are Visual Basic 4.0 
  40. (which can both use and create OLE objects), Microsoft Excel 5.0, Microsoft Access 2.0, 
  41. and Microsoft Project. Future versions of Microsoft SQL Server, Microsoft FoxPro, 
  42. Microsoft Word For Windows,and Microsoft Windows will take advantage of these objects as well. 
  43.  
  44. *Can a Visual Basic 4.0 32-bit application run on Win32s?
  45.  
  46. No. Win32s is a subsystem of DLLs which extends the Microsoft Windows 3.1 16-bit 
  47. operating system by translating 32-bit calls to the underlying 16-bit operating system. 
  48. Programs written with 32-bit Visual Basic running on Windows 3.1 with Win32s would 
  49. generally run slower (due to the extra memory and overhead of the translation layer) 
  50. than the same program created with 16-bit VB. Instead of using the more limited 
  51. Win32s features, Microsoft chose to have the 32-bit version exploit the more advanced 
  52. 32-bit features available only on Microsoft Windows 95 and Microsoft Windows NT. 
  53.  
  54. *How can I write an application for 16-bit and 32-bit systems at the same time?
  55.  
  56. Microsoft has taken a number of steps to assure source code compatibility between 
  57. 16-bit and 32-bit applications: 
  58.  
  59.  
  60.  
  61. *All Visual Basic-provided language is portable. 
  62.  
  63. *All custom controls have identical object models. 
  64.  
  65. *Basic file I/O enables files to be shared by applications running on different platforms. 
  66.  
  67. *Visual Basic 4.0, Professional Edition includes both 16-bit and 32-bit versions of VB.EXE. 
  68. Using a single source code tree, you can create 16-bit applications that run on 
  69. Microsoft Windows 3.x, 32-bit applications that run on Microsoft Windows NT 3.x (Intel), 
  70. and 32-bit Microsoft Windows 95-based applications. By taking advantage of the new conditional 
  71. compilation switches in Visual Basic 4.0, you can quickly recompile the same source code to 
  72. target and exploit the capabilities of different Windows platforms. Conditional compilation 
  73. switches allow you to easily target different platforms or languages using a single 
  74. source code tree and a simple recompile. 
  75.  
  76.  
  77.  
  78. *Visual Basic provides both the language and command-line support for conditionally compiling 
  79. declarations and procedural code into an application. Both the Project Options dialog and 
  80. the Visual Basic 4.0 command line allow the setting of constants that are subsequently 
  81. used in evaluating 
  82.  
  83.  
  84. *#If...#Else...#End If structures. For example, you can specify Win16=1 in the Conditional 
  85. Compilation Arguments field of the Project Options dialog, thereby selectively compiling 
  86. Windows 3.1 declarations and other constants in an application: 
  87.  
  88.  
  89.  
  90. *#If Win16=1 Then Use Win16 calls 
  91.  
  92. *Declare Function GetWindow Lib "User" (ByVal hWnd As _
  93. Integer, ByVal wCmd As Integer) As Integer
  94. #ANSI=True
  95. #Else Use Win32 calls
  96. Declare Function GetWindow Lib "User32" (ByVal hWnd As _
  97. Long, ByVal wCmd As Integer) As Long 
  98.  
  99. #ANSI=False
  100. You need to use the Alias with the 32-bit Declare call. 
  101.  
  102. Declare Function GetWindow Lib "user32" Alias GetWindowA (ByVal hWnd As Long, ByVal wCmd As 
  103. Long) As Long 
  104.  
  105. #End If 
  106.  
  107.  
  108.  
  109. *Why can't I load a VBX control in the 32-bit version of Visual Basic 4.0 for Windows?
  110.  
  111. VBX custom controls are limited to 16-bit applications and are fully supported only 
  112. by Visual Basic 3.0 and the 16-bit version of Visual Basic 4.0. Visual Basic 4.0 uses 
  113. the new OLE control model as its main control architecture. Visual Basic 4.0 has 
  114. moved to this new, open control model in order to support controls in both 16-bit 
  115. and 32-bit environments. The OLE control architecture merges all of the benefits 
  116. of the VBX custom control with OLE. The new OLE control can be used in any OLE client 
  117. application and is available on 16-bit as well as 32-bit platforms. 
  118.  
  119.  
  120.  
  121. *Visual Basic 4.0 includes OLE (OCX) controls that are upgrades to the VBX custom 
  122. controls that shipped in previous versions. Automatic conversion is provided to replace 
  123. the VBX references in projects with references to its OCX equivalent if present. 
  124. Visual Basic 4.0 includes the OCX equivalents of all of the VBX controls shipped in 
  125. Visual Basic 3.0, in addition to several brand new OCX controls in both the 16-bit and 
  126. 32-bit versions. The 16-bit version of Visual Basic will continue to support VBXs. 
  127.  
  128.  
  129. *Will the 16-bit and 32-bit versions of Visual Basic 4.0 run on Microsoft Windows 95?
  130.  
  131. The 16-bit version of Visual Basic version 4.0 for Windows runs on Microsoft Windows, 
  132. Microsoft Windows for Workgroups, Microsoft Windows NT and Microsoft Windows 95. 
  133. Under Windows NT and Windows 95, it is handled as any other 16-bit application. 
  134. The 32-bit version of Visual Basic 4.0 for Windows only runs on Windows 95 and Windows NT 
  135. version 3.51 or greater. On Windows NT, your application runs in a 16-bit environment provided 
  136. by the Windows On Windows (WOW) layer which allows Windows NT to run 16-bit applications in a 
  137. protected environment. 
  138.  
  139.  
  140. *When I load in an existing application into Visual Basic 4.0, it says it's going to 
  141. ôupgradeö my controls. Is it actually changing my controls and should I back them up?
  142.  
  143. No. Your controls are fine. Visual Basic 4.0 contains newer, backward-compatible 
  144. controls which replace controls that were shipped with previous versions of Visual Basic. 
  145. Your projects .Mak file will be updated to use these newer controls if you answer, 
  146. Yes. We recommend that you use the latest controls so that you can take advantage of any 
  147. new features that have been implemented. 
  148.  
  149.  
  150. *What is included in the Enterprise Edition?
  151.  
  152. The Enterprise Edition contains ALL of the features included in the Professional Edition. 
  153. In addition, the Enterprise Edition adds the following: 
  154.  
  155. Visual Basic 4.0, Enterprise Edition is bringing an entirely new paradigm to front-end 
  156. developers: Remote Data Object (RDO) and Remote Data Control (RDC). 
  157.  
  158. The RDO has a set of data access objects not unlike Jet but tuned and optimized 
  159. specifically for SQL Server. It will also run against Oracle. This means that it knows how 
  160. to gracefully and efficiently deal with server-side cursors, asynchronous queries, 
  161. multiple result sets, input, output and return value parameters from stored procedures and 
  162. much, much more -- but using the same programming paradigm that Jet uses. RDO knows how to 
  163. create a "cursorless" result set and 3 other types of cursors (static, dynamic and keyset). 
  164. It promises to become the new standard for accessing SQL Server from Visual Basic. 
  165.  
  166. The RDC is a replacement for the Jet Data control. It knows how to connect bound controls 
  167. to a selected ODBC data source. Neither the RDC or RDO require any vestige of Jet -- which 
  168. gives it a much smaller footprint (about 250K). 
  169.  
  170. Visual Basic 4.0 also supports the new 16-bit (VBSQL.VBX) and 32-bit (VBSQL.OCX) formats 
  171. which can give much better performance than Jet, but does require a change in programming 
  172. techniques. 
  173.  
  174.  
  175. *Visual Source Safe 
  176.  
  177. The Enterprise Edition of Visual Basic includes Visual SourceSafe, a fully integrated 
  178. Version Control System. It is an easy-to-use tool for team software development. 
  179. Visual SourceSafe tracks changes to files and stores the changes so that files, such as 
  180. code modules, can be easily and economically reused. 
  181.  
  182.  
  183. *Remote OLE 
  184.  
  185. OLE Automation servers are an ideal mechanism for providing business, data, and application 
  186. services. Once a service has been implemented as an OLE server, it can be used as an 
  187. application component by developers throughout the enterprise. Such services can be implemented 
  188. very rapidly using Visual Basic. Remote Automation provides the infrastructure for easily 
  189. extending the OLE client/server relationship across networks. It allows an applications OLE 
  190. client components to access services provided by OLE servers anywhere on the network. 
  191.  
  192.  
  193.  
  194. *What is new in Visual Basic 4.0 for Windows?
  195.  
  196. Visual Basic4.0 for Windows, Applications Edition 
  197. Visual Basic, Applications Edition, (VBA) version 2.0 was added as the language engine 
  198. in Visual Basic 4.0. This version of VBA is fully backward-compatible with earlier versions 
  199. of the stand-alone Visual Basic product, and with Visual Basic, Applications Edition, version 
  200. 1.0, which is included in Microsoft Excel version 5.0 and Microsoft Project version 4.0. 
  201. The insertion of VBA in Visual Basic 4.0 makes it easier to program OLE Automation objects, 
  202. and means that Visual Basic code can be easily moved between modules in the applications 
  203. that support it. 
  204.  
  205.  
  206. *Creating Custom Objects and Collections 
  207.  
  208. You can create custom objects, with their own properties and methods, and assemble them into 
  209. an object model. The definitions of these objects are called classes, and are contained in 
  210. Visual Basic's new class modules. Your object model can include custom collections built using 
  211. Visual Basic's new Collection object. 
  212.  
  213.  
  214. *OLE Automation Servers 
  215.  
  216. Using OLE Automation in Visual Basic, you can borrow the functionality of other applications 
  217. by controlling their objects from within your Visual Basic application. Visual Basic 4.0 
  218. also gives you the capability of creating your own OLE Automation Servers. You can use Visual 
  219. Basic 4.0 Professional Edition to create applications which expose objects with an interface 
  220. of your own design, and are callable from applications supporting OLE Automation, including 
  221. Visual Basic, Microsoft Visual C++, Microsoft Project, Microsoft Access, and Microsoft Excel. 
  222.  
  223.  
  224.  
  225. *Property Procedures 
  226.  
  227. Property procedures allow you to add custom properties to form modules, standard modules and 
  228. code modules, and to execute code when the property is set or retrieved. For example, you could 
  229. add an Inverted property to a form. When Inverted is set to True the code in the associated 
  230. property procedure invokes an API to invert a bitmap on the form. 
  231.  
  232. *32-Bit Support and Conditional Compilation 
  233.  
  234. The 32-bit version of Visual Basic is designed to let you create versions of your programs to 
  235. run on 32-bit systems, using the same source code that runs on 16-bit systems. 32-bit Visual 
  236. Basic supports long filenames in all project components and relaxation of most of the 64K 
  237. capacity constraints for properties and the Visual Basic language. With conditional compilation 
  238. you can embed platform-specific code segments in #If...Then statements, and selectively build 
  239. versions of your application for different platforms. 
  240.  
  241. *Jet 3.0 
  242.  
  243. Many additional features of the Jet 3.0 database engine are available in Visual Basic 4.0 
  244. Professional Edition, including the ability to create new databases, change database 
  245. structure, and the ability to manipulate database security and referential integrity. 
  246. In addition, Visual Basic 4.0 adds the following features:Some of this is a repeat of the 
  247. other list. You should consolidate the information. 
  248.  
  249.  
  250.