Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Applies to: WG1-3.x (Client)

Editor's note: the Year 2000 changes to client date entry and output (replace masked edit boxes with text boxes, use Format$() and DateValue()) are client-side material that first appears in the WG 3.12 addendum; see chapter 24, "Client Application Date Entry", "Date Output" and "Date Input", where they are tagged WG1-3.x (Client).

...

Here’s how to identify all URLs in a string:

Code Block
Dim idx As Integer, urllen As Integer

' stg is the string we're finding URLs in
idx = 1
Do
        urllen = findurl(idx, stg)
        If urllen > 0 Then
                ' URL found at index idx in stg, length urllen
                idx = idx + urllen
        End If
Loop While urllen <> 0

Once you know the location of a URL within a string, it’s your decision as to what to do with it. You can make a clickable (hypertext-like) link out of it, put it in a URL list for the user to select, etc.

...

To pass a URL to the currently running Web browser, call the gotoURL() routine. For example, assuming urlstg contains a string of characters which form a URL, this passes the URL to the browser:

Code Block
gotoURL urlstg

It’s that easy. If a supported Web browser is currently running, it will be sent to that URL. If not, the user will be asked to run a Web browser and try again. Be on the lookout for opportunities to take advantage of URLs in any apps you develop. Users appreciate not having to type URLs by hand.

...

In the case of dynapak reads, the callback’s response value is the value of the dynapak. In the case of statuses, the value is the appropriate length, as a Long. To get the value, use cbkrsp():

Code Block
junk = cbkrsp(Len(lenaslong), lenaslong)

See stsdpk() for more on getting the status of dynapaks and the lengths that result.

...

rmventid — removes entries from one or more windows’ paint lists, by image id

SYNOPSIS

Code Block
result = rmventid(fromall, imgid, hwnd)

result As Integer SUCCESS if entries were removed, else an error code

fromall As Integer True to remove from all windows, False for just one

imgid As Integer id of the image to be removed

hwnd As Integer if fromall is False, window to remove from, else ignored

DESCRIPTION

This function removes one or more entries from windows’ paint lists. Given an image id, it will remove all occurrences of that image in one or all windows. Specify fromall as True to remove the image from all windows’ paint lists. Specify fromall as False and the hWnd of the window to remove the image from if you only want it removed from one window.

...

rmventidrect — removes entries from one or more windows’ paint lists, by image id and rectangle

SYNOPSIS

Code Block
result = rmventidrect(fromall, imgid, imgrect, hwnd)

result As Integer SUCCESS if entries were removed, else an error code

fromall As Integer True to remove from all windows, False for just one

imgid As Integer id of the image to be removed

imgrect As RECT rectangle of image to be removed

hwnd As Integer if fromall is False, window to remove from, else ignored

DESCRIPTION

This function removes one or more entries from windows’ paint lists. Given an image id and a rectangle, it will remove all occurrences of that image in that rectangle in one or all windows. Specify fromall as True to remove the image from all windows’ paint lists. Specify fromall as False and the hWnd of the window to remove the image from if you only want it removed from one window. This function is the same as rmventid() except that it’s more specific in handling images displayed at particular locations.

...

rmventnum — removes entry from a window’s paint list, by entry index

SYNOPSIS

Code Block
result = rmventnum(entidx, hwnd)

result As Integer SUCCESS if the entry was removed, else an error code

entidx As Integer 0-based index of paint entry to remove

hwnd As Integer hWnd of the window to remove from

DESCRIPTION

This function removes a paint entry from a window’s paint list. Just pass in the index (0-based) of the entry to remove and the hWnd of the window to remove it from. See the pntlst() function for getting the paint list for a specific window. A list returned from pntlst() would generally be used to find the index of a paint entry to remove.

...

paintimgbkgd — paints an image to a window, behind any others

SYNOPSIS

Code Block
painted = paintimgbkgd(hwnd, imgid, destrect, result)

painted As Integer True if image was successfully painted, False otherwise

hwnd As Integer hWnd of the window (form, picture box, etc.) to paint to

imgid As Integer image id of the image to paint

destrect As RECT destination rectangle to paint to (in pixels)

result As Integer if the function fails, this contains an error code

DESCRIPTION

This function is exactly the same as paintimg() except that it paints the image behind any others already painted. It puts this image, if successfully painted, first in the window’s paint list. See paintimg() for full details.

...

Applies to: WG1-3.x (client side: C/S, WGM)

Covered, with the server-side installation rules, under "Shared support files" in Chapter 3.

Toolbars

In our never-ending battle to keep the overall size of the client down, we’ve created a VB API for supporting standard toolbars with bubble help (rather than using a .vbx). All of our baseline apps that have toolbars use this API. Since you have the VB sources for those apps, check them out for good, working examples. Below is a brief description of the API.

...

gcsdlm.bas contains these three routines as your app’s interface to the Download Manager:

Code Block
Function tagpath (ByVal filname as String) as String

Pass a default filename to this function and it brings up a file dialog (gcsfdlgd.frm) to allow the user to select a path and filename to download to. This is called automatically by tagsub() if dlpath is passed as "".

Code Block
Sub tagrmv (ByVal appid as String, ByVal locdpk as String, ByVal tagspec as String)

Pass the App-ID, local dynapak prefix, and tagspec to cause a file to be removed from the Download Manager.

Code Block
Sub tagsub (ByVal desc as String, ByVal appid as String, ByVal filpfx as String, ByVal locpfx As String, ByVal tagspec As String, ByVal dlpath As String, ByVal recfname As String, ByVal later As Integer, ByVal launch As Integer)

Pass all necessary information to the Download Manager so it can manage the downloading of a file from the server:

...

If your application wanted to cause a particular file to be downloaded from the File Libraries agent, say the file plotter.doc in the GRAPHICS Library, allowing the user to specify the destination directory, and you wanted to download now, launching the file after completion (usually, .doc files launch into Microsoft Word, if installed), you would call tagsub() with the following parameters:

Code Block
tagsub "PLOTTER.DOC", "MYAPPID", "sa=GALFIL;uf:download ", "sa=GALFIL;ul:fl ", "GRAPHICS PLOTTER.DOC", "", "PLOTTER.DOC", False, True

Given this tagspec for a File Libraries file of "GRAPHICS PLOTTER.DOC", the following dynapaks will be associated with a file:

Code Block
sa=GALFIL;ul:fl GRAPHICS PLOTTER.DOC

sa=GALFIL;uf:download GRAPHICS PLOTTER.DOC

The first dynapak is used by the Download Manager to keep track of the file locally. The second is used to actually download the file.

...

Applies to: WG1-3.x (client side: C/S, WGM)

Server side (forreal() and stsdpk() support in agents): see "Download Manager Support in Agents" in Chapter 5.

Virtual Terminal Mode

The Virtual Terminal Mode (VTM) API is the Major BBS equivalent of Windows NT’s console mode API. Some Major BBS apps will need to make use of a standard, ANSI terminal window to allow the user to interact. Doors is one of those apps in the Major BBS’s baseline package. Without dropping into terminal mode and running a terminal mode module, users in apps that use VTM (like Doors) can make use of a terminal window alongside other client/server apps.

...

Applies to: WG1-3.x (client side: C/S, WGM)

Agent side of VTM: see "Virtual Terminal Mode (Agent Side)" in Chapter 4.

Miscellaneous

Be very careful about the times and dates of client files. Released files with the same name but different time/date stamps will conflict on user’s hard drives, causing them to potentially re-download files needlessly when switching from system to system. Read through the Procedures for Proper Version Control section of the Client App Developer’s Guide very carefully. Follow those guidelines. Failure to do that results in lots of bug reports to Galacticomm due to files re-downloading when the user doesn’t think they should.

...

Only call posisave() after first calling posiload() or reporeg(). This was not clear in the Client App Developer’s Guide. You can call the new posiexist() function to find out whether a saved position currently exists for a particular form. Using the return value from posiexist(), you can determine whether you want to call posiload() or position the form initially yourself and call reporeg().

...

Previous: Major BBS v10: 19 X.25 Programming  |  Contents  |  Next: Major BBS v10: 21 Development Environment (Worldgroup 3.x)