'     -----------------  Group builder function demo ---------------------
'                   (c) Main Street Software Company 1995  
'                             {  ver 1.0 (beta)}
'
'        This file details the use of the DLL in a Visual Basic Applications 
'        environment.
'        
'        This program shows how to use the build_group function.
'        Use this Beta version of the group builder program to build
'        groupboxes for your windows projects.  It was developed in
'        Turbo Pascal but should work with other compilers which have
'        the ability to utilize DLLs.  Some notes:
'
'             1)  The function build_group does not wait around to
'                 check if the group window is actually built.  You will
'                 have to hook the appropriate windows message for this
'                 info if you desire to check for successful completion.
'
'             2)  I welcome comments about this program.  If you have some
'                 idea for other functions that I should include in this
'                 package then please call or write:
'                 Our mailing address is :
'
'                                              Ron Scheckelhoff
'                                              % Main Street Software Co.
'                                              PO BOX 1083
'                                              Findlay OH   45840       
'
'
'              3) We (Main Street Software Co., and myself (Ron Scheckelhoff)
'                 take no responsibility for use of the program, or direct or
'                 indirect damages.  All responsibility is shouldered by the
'                 user. It is delivered on an "As is" basis. Please report any
'                 problems to the aforementioned address.  We reserve the
'                 copyright to this program, but you may use this version
'                 without any royalties.  If you are one of those who feels
'                 badly about using software without paying for it, you may
'                 send $10. to the aforementioned address.
'
'             4)  Notes about some return codes:  The function returns some
'                 integer return codes including :
'                       3 - GROUPNAME TOO LONG (max is 30)
'                       4 - ITEMNAME TOO LONG
'
'                 There are 2 DLL libraries.  (INST2.DLL and VB_INST2.DLL)
'                 Use VB_INST2.DLL  with Visual Basic and the INST2.DLL 
'                 file for Pascal, Powerbuilder, or C.  The difference is 
'                 mostly the return value, which is integer for Visual Basic.
'
'             5)  Usage is simple: the example at the bottom of the page
'                 details the way to use the single function that builds
'                 the boxes.  The function returns an integer which is
'                 a code like the ones mentioned in paragraph 4.  You will
'                 need to declare the function according to your compilers
'                 directives.  The name of the DLL is 'VB_INST2' for VB. 
'                 (See the declaration in the example (below).                    
'                    
'                 In my example, I have used the MsgBox function to
'                 grab the return code and display it.
'                    
'                 The groupname is the name that will be displayed on the
'                 title bar for the groupbox.  The itemname consist of
'                 6 pieces, as follows:
'
'                         1-  The application EXE and directory
'                         2-  The title that will be displayed below the icon.
'                         3-  The EXE from which the icon will be taken
'                         4-  The default icon (if any)
'                         5-  The x position within the groupbox of the icon
'                         6-  The y position within the groupbox of the icon
'
'                   Successive calls to the same Groupname will add icons
'                   to the same groupbox.
'
'                   Have Fun!
'                   -- R.S.
'
'
' Testdll Macro
' Use of this demo code is at users risk.  This code is an example
' of what we have found to work with the Visual Basic Applications
' environment at least once, and is delivered "as is", with no guarantees.
' Please feel free to correspond about this with suggestions that
' you may have.
'
Declare Function build_group Lib "VB_INST2.DLL" (ByVal GroupName As String, ByVal ItemName As String) As Integer
Sub testdll()
   ' --------------------------------------
   ' -- This is one way to embed quotes ---
   ' --------------------------------------
   Q = Chr$(34): C = ",": QCQ = Q + C + Q
   ' --------------------------------------
   ' -------- Build the strings -----------
   ' --------------------------------------
   ItemName = Q + "C:\windows\write.exe" + QCQ
   ItemName = ItemName + "Write-On!" + QCQ + "C:\windows\write.exe"
   ItemName = ItemName + Q + ",0,100,100" + Q
   GroupName = Q + "Joes Construction Pgms" + Q
   ' ---------------------------------------
   ' --- call the build_group function   ---
   ' ---------------------------------------
   RC = MsgBox("RC:" + Str$(build_group(ByVal GroupName, ByVal ItemName)))
End Sub



'
