Skip to content

Commit

Permalink
blackbox-1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
X547 committed Oct 1, 2022
1 parent 0fa24a9 commit bba0c52
Show file tree
Hide file tree
Showing 242 changed files with 8,710 additions and 168,747 deletions.
1,110 changes: 1,110 additions & 0 deletions BlackBox_1.7_Changes.txt

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Com/Docu/Aggregate.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ComAggregate Example

ComAggregate Example

This example shows how aggregation is implemented using the COM compiler. The example is described in detail in chapter two of the book "Inside OLE".

With aggregation, an object which implements one or several interfaces is reused without modification and without the need to forward each method of the reused interfaces. The reused object is called the inner one, and the object which reuses the inner object is called the outer object. The inner object delegates all calls to QueryInterface to the outer object, and the outer object has a reference to the inner object's IUnknown interface. This latter interface must not forward the QueryInterface calls, otherwise this would produce an infinite recursion. This implies that an aggregatable object must provide a separate implementation of the IUnknown interface, i.e. an aggregatable object consists of at least two records which both implement the IUnknown interface, where one QueryInterface method is forwarded, while the other is not. These two records will be linked by references from one to the other.
Expand Down
5 changes: 2 additions & 3 deletions Com/Docu/Connect.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ComConnect Example

ComConnect Example
This example shows how connectable objects are implemented using the COM compiler. The example is described in detail in chapter four of the book "Inside OLE". Connectable objects offer an interface which allows to install interfaces which can be called back by the connectable object.

A connectable object has to implement the interface IConnectionPointContainer with the two methods FindConnectionPoint and EnumConnectionPoints. With the first method, the connectable object can be asked for a specific outgoing interface. If the interface is supported, then a pointer to the IConnectionPoint is returned, the interface through which the callback interface can be installed. With the method EnumConnectionPoints the supported outgoing interfaces can be requested. The list of supported interfaces is returned in the form of an enumeration interface, IEnumConnectionPoints.
Expand All @@ -25,7 +24,7 @@ All installed connections are stored in the unk array. If an event is distribute
The cookies corresponding to the connections are stored in the cookies array. They are necessary to search a connection when Unadvise is called.
The conn field counts the number of installed connections, and the next field finally contains the last distributed cookie.

The IDuckEvents interface is used in this example as the outgoing interface. This interface supports the following three functions:
The IDuckEvents interface is used in this example as the outgoing interface. This interface supports the following three functions:

 IDuckEvents = POINTER TO ABSTRACT RECORD
["{00021145-0000-0000-C000-000000000046}"] (COM.IUnknown)
Expand Down
6 changes: 2 additions & 4 deletions Com/Docu/EnumRect.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ComEnumRect Example

ComEnumRect Example
This is a simple example adapted form the same example in the book "Inside OLE".

The interface IEnumRECT (an enumerator for rectangles) is defined and implemented in this module.
Expand All @@ -18,5 +17,4 @@ For the implementation, an array of length 15 is used.
As the interface is implemented in one record (EnumRECT), the default implementation for QueryInterface can be used.


ComEnumRect  sources

ComEnumRect  sources
3 changes: 1 addition & 2 deletions Com/Docu/Koala.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ComKoala Example

ComKoala Example
This example is one of the simplest COM examples. It provides a component which implements the IUnknown interface. In DTC Component Pascal, a concrete extension of the base interface must be defined. The two methods AddRef and Release are implemented by the compiler, and for QueryInterface, the default implementation can be taken. Thus, only the following two lines are necessary to implement this simple interface.

TYPE
Expand Down
3 changes: 1 addition & 2 deletions Com/Docu/KoalaDll.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ComKoalaDll Example

ComKoalaDll Example
This version of the Koala example can be linked as an independent DLL. It can be tested with the ObjUser.exe program which is provided with the book "Inside OLE". Note that you have to set the ObjUser.exe program into DLL mode.

The implementation of the DLL only slightly differs from the first ComKoala implementation. One difference is that a counter is provided which counts the number of instances. This counter is incremented whenever a new object is created (CreateInstance method), and it is decremented if the last interface reference is removed (RELEASE finalizer).
Expand Down
3 changes: 1 addition & 2 deletions Com/Docu/KoalaExe.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ComKoalaExe Example

ComKoalaExe Example
This version of the Koala example can be linked as an independent exe. It can be tested with the ObjUser.exe program which is provided with the book "Inside OLE". Note that you have to set the ObjUser.exe program into EXE mode.

The EXE file opens its application window which is closed as soon as the last interface pointer is released. It also must implement a main loop which polls and dispatches all Windows events. Additionally, the body of the module must register the factory upon start up and remove the factory from the registry as soon as the EXE is unloaded.
Expand Down
3 changes: 1 addition & 2 deletions Com/Docu/Object.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ComObject Example

ComObject Example
This example implements a simple OLE server which provides the following OLE object:


Expand Down
3 changes: 1 addition & 2 deletions Com/Docu/PhoneBook.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ComPhoneBook Example

ComPhoneBook Example
In this example we show the implementation of a COM component which implements a simple phone directory database that manages customer names and telephone numbers. This database can be queried by name and by number.

For our phone directory service we define the interface ILookup. This interface contains the methods LookupByName and LookupByNumber, which return a phone number for a given name, and vice versa. Clients of the phonebook component can access the component's services through this interface only. The interface identifier (IID) of this interface is {C4910D71-BA7D-11CD-94E8-08001701A8A3}. This IID is a globally unique identifier (GUID), i.e., unique in time and space. The definition of this interface ILookup.idl in the Microsoft interface definition language (MIDL) is shown below:
Expand Down
3 changes: 1 addition & 2 deletions Com/Docu/PhoneBookActiveX.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ComPhoneBookActiveX Example

ComPhoneBookActiveX Example
In this example a simple ActiveX control is implemented. The control offers the same functionality as the phone book in the ComPhoneBook example, but in this example, clients communicate through a dispatch interface. The control will be linked into a DLL and can be used as an ActiveX control from any client which properly supports the ActiveX standard.

The dispatch interface also has to be described in a MIDL definition. This definition is stored in file Phone.idl and shown below:
Expand Down
2 changes: 1 addition & 1 deletion Com/Docu/Sys-Map.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Map to the COM Examples
Map to the Direct-To-COM Examples


COM Interface Usage
Expand Down
3 changes: 1 addition & 2 deletions Com/Docu/Tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,4 @@ This procedure can be used to quickly initialize a FORMATETC structure.
PROCEDURE GenFormatEtc (format: SHORTINT; aspect, tymed: SET; OUT f: WinOle.FORMATETC);


ComTools  sources

ComTools  sources
17 changes: 9 additions & 8 deletions Com/Rsrc/Menus.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
MENU "COM"
"Show Error" "" "DevComDebug.ShowError" "TextCmds.SelectionGuard"
"Show Interfaces" "" "DevComDebug.ShowInterfaceRecords" ""
MENU "#Com:&COM"
"#Com:&Show Error" "" "DevComDebug.ShowError" "TextCmds.SelectionGuard"
"#Com:&Show Interfaces" "" "DevComDebug.ShowInterfaceRecords" ""
SEPARATOR
"Interface Info" "" "DevBrowser.ShowInterface('+!')" "TextCmds.SelectionGuard"
"#Com:&Interface Info" "" "DevBrowser.ShowInterface('+!')" "TextCmds.SelectionGuard"
"#Com:&Type Libraries" "" "DevComInterfaceGen.Open" ""
SEPARATOR
"New GUID" "" "DevComDebug.NewGuid" ""
"#Com:&New GUID" "" "DevComDebug.NewGuid" ""
SEPARATOR
"Collect" "" "HostMenus.Collect" ""
"#Com:&Collect" "" "HostMenus.Collect" ""
SEPARATOR
"DTC Help" "" "StdCmds.OpenBrowser('Docu/DTC-Help', 'Help Contents')" ""
"DTC Examples" "" "StdCmds.OpenBrowser('Com/Docu/Sys-Map', 'DTC Examples')" ""
"#Com:&DTC Help" "" "StdCmds.OpenBrowser('Docu/DTC-Help', '#Com:DTC Help')" ""
"#Com:&DTC Examples" "" "StdCmds.OpenBrowser('Com/Docu/Sys-Map', '#Com:DTC Examples')" ""
END
14 changes: 14 additions & 0 deletions Com/Rsrc/Strings.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
STRINGS
&COM COM
&Show Error Show Error
&Show Interfaces Show Interfaces
&Interface Info Interface Info
&Type Libraries Type Libraries
&New GUID New GUID
&Collect Collect
&DTC Help DTC Help
&DTC Examples DTC Examples

DTC Help DTC Help
DTC Examples DTC Examples
Type Libraries Type Libraries
6 changes: 2 additions & 4 deletions Comm/Docu/Sys-Map.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@
CommTCP TCP/IP streams (sockets)
CommV24 V24 unreliable streams

CommObxStreamsClient
CommStreams example
CommObxStreamsServer
CommStreams example
CommObxStreamsClient CommStreams example
CommObxStreamsServer CommStreams example
16 changes: 7 additions & 9 deletions Comm/Docu/TCP.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
CommTCP

Driver for CommStreams.
It implements TCP/IP streams, using the operating system's sockets interface. It provides the NewListener and NewStream factory functions as needed for CommStreams. Do not import CommTCP directly; instead, use CommStreams and specify "CommTCP" as the protocol name.
It implements TCP/IP streams, using the operating system's sockets interface. It provides the NewListener and NewStream factory functions as needed for CommStreams. Do not import CommTCP directly; instead, use CommStreams and specify "CommTCP" as the protocol name.

Parameters localAdr and remoteAdr:
The CommStreams procedures NewStream and NewListener feature string parameters remoteAdr and localAdr. The interpretation of the strings passed depends on the implementation of the actual driver module. For CommTCP the following holds.

The remoteAdr (only used with NewStream) must be either an IP address or a host's name, followed by a colon (":") and a port number. (Examples: "127.0.0.1:2", "loopback:2".)

The parameter localAdr identifies the port on which a listener is established (NewListener) or from which a remote connection is attempted (NewStream). Valid values are
Parameters localAdr and remoteAdr
The CommStreams procedures NewStream and NewListener feature string parameters remoteAdr and localAdr. The interpretation of the strings passed depends on the implementation of the actual driver module. For CommTCP the following holds.
The remoteAdr (only used with NewStream) must be either an IP address or a host's name, followed by a colon (":") and a port number. (Examples: "127.0.0.1:2", "loopback:2".)
The parameter localAdr identifies the port on which a listener is established (NewListener) or from which a remote connection is attempted (NewStream). Valid values are
- an empty string
- an IP address or a host's name (Examples: "127.0.0.1", "loopback")
- an IP address or a host's name followed by a colon (":") and a port number
(Examples: "127.0.0.1:2", "loopback:2")
- a port number (Example: "2")
For unspecified parts, IP addresses / host's names or port numbers respectively, a wildcard is used, directing the operating system to choose freely. If in a call to NewListener neither IP address nor host name is specified for localAdr, the listener will check on all IP numbers available on the local machine.
Note: Certain operating systems (e.g. Microsoft Windows Server 2003) do not accept an empty string or just a port number as valid values for localAdr. Use the values "0.0.0.0:0" or "0.0.0.0:<port number>" (e.g. "0.0.0.0:2") instead.
For unspecified port numbers, a wildcard is used, directing the operating system to choose freely. For unspecified local addresses the local host's address "127.0.0.1" is used.
The special IP address "0.0.0.0" means all available IP addresses on the local machine (including "127.0.0.1"). This can be used for listening on all available network interfaces or for connecting to a server using any available network interface. In this case network traffic may leave the local machine.
10 changes: 6 additions & 4 deletions Comm/Mod/TCP.Mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ MODULE CommTCP;
FIONBIO = WinNet.IOC_IN + 00040000H + ASH(ORD("f"), 8) + 126; (* set/clear non-blocking i/o *)
FIOASYNC = WinNet.IOC_IN + 00040000H + ASH(ORD("f"), 8) + 125; (* set/clear async i/o *)

localhost = "127.0.0.1";

TYPE
Stream = POINTER TO RECORD (CommStreams.Stream)
sock: WinNet.SOCKET; (* socket must be in non-blocking mode, otherwise recv() or send() could block *)
Expand All @@ -44,7 +46,7 @@ MODULE CommTCP;
PROCEDURE CopyOfAdrString (a: CommStreams.Adr): CommStreams.Adr;
VAR b: CommStreams.Adr;
BEGIN
NEW(b, LEN(a)); b := a;
NEW(b, LEN(a)); b^ := a$;
RETURN b
END CopyOfAdrString;

Expand Down Expand Up @@ -103,12 +105,12 @@ MODULE CommTCP;
VAR i, res: INTEGER;
BEGIN
IF adr = "" THEN
port := 0; peername := ""; ok := TRUE (* default port number 0 means 'don't care which port is used' *)
port := 0; peername := localhost; ok := TRUE (* default port number 0 means 'don't care which port is used' *)
ELSE
i := 0;
WHILE (adr[i] # 0X) & ((adr[i] >= "0") & (adr[i] <= "9")) OR (adr[i] = " ") DO INC(i) END;
IF adr[i] # 0X THEN ParseAdr(adr, peername, port, ok)
ELSE Strings.StringToInt(adr, port, res); peername := ""; ok := res = 0
ELSE Strings.StringToInt(adr, port, res); peername := localhost; ok := res = 0
END
END
END ParseLocalAdr;
Expand All @@ -124,7 +126,7 @@ MODULE CommTCP;
hostentry := WinNet.gethostbyname(shortPName);
ok := hostentry # NIL;
IF ok THEN
inaddr := hostentry.h_addr_list^[0]^[0]
inaddr := SYSTEM.VAL(WinNet.in_addr, hostentry.h_addr_list^[0]^)
ELSE
Error("gethostbyname()", WinNet.WSAGetLastError())
END
Expand Down
5 changes: 0 additions & 5 deletions Ctl/Docu/Access8.txt

This file was deleted.

5 changes: 0 additions & 5 deletions Ctl/Docu/DAO35.txt

This file was deleted.

15 changes: 2 additions & 13 deletions Ctl/Docu/Dev-Man.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
 BlackBox
Developer Manual
Ctl Subsystem

Developer Manual


Introduction

Expand Down Expand Up @@ -118,28 +117,18 @@ The following table contains all automation interfaces currently available in Bl

Module Name Controlled Application Help File

CtlExcel5 MS Excel 5.0 VBA_XL.HLP
CtlExcel8* MS Excel 8.0 VBAXL8.HLP
CtlExcel9 MS Excel 9.0 VBAXL9.CHM
CtlWord8* MS Word 8.0 VBAWRD8.HLP
CtlWord9 MS Word 9.0 VBAWRD9.CHM
CtlOutlook8* MS Outlook 8.0 VBAOUTL.HLP
CtlOutlook9 MS Outlook 9.0 VBAOUTL9.CHM
CtlPowerPoint8* MS PowerPoint 8.0 VBAPPT8.HLP
CtlPowerPoint9 MS PowerPoint 9.0 VBAPPT9.CHM
CtlAccess8* MS Access 8.0 ACVBA80.HLP
CtlAccess9 MS Access 9.0 ACMAIN9.CHM
CtlGraph8* MS Graph 8.0 VBAGRP8.HLP
CtlGraph9 MS Graph 9.0 VBAGRP9.CHM
CtlOffice MS Office 9.0 VBAOFF9.CHM / VBAOFF8.HLP
CtlOfficeBinder MS Binder 9.0 VBABDR8.HLP
CtlMSForms MS Forms 2.0 FM20.HLP
CtlDAO35* MS Data Access Objects 3.5 DAO35.HLP
CtlDAO36 MS Data Access Objects 3.6 DAO36.HLP
CtlADODB MS ActiveX Data Objects 2.0 -
CtlVBIDE MS Visual Basic VEENOB3.HLP
CtlStdType Standard OLE Types -

The modules marked with * used to be without a number in the previous release of BlackBox. Because Microsoft changed the interfaces of these products for Office 9.0, the names of the modules have been changed accordingly so that users can choose which interface to use.

CtlVBIDE and CtlStdType contain types imported by other modules and are usually not used directly.
4 changes: 0 additions & 4 deletions Ctl/Docu/Excel5.txt

This file was deleted.

6 changes: 0 additions & 6 deletions Ctl/Docu/Excel8.txt

This file was deleted.

1 change: 0 additions & 1 deletion Ctl/Docu/Excel9.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
CtlExcel9


CtlExcel9 contains the automation interface for Microsoft Excel 9.0. The objects contained in this module are explained in the corresponding help file (VBAXL9.CHM) which is located on the MS Office CD but is not installed by default.
For more information about automation controllers in BlackBox see the Ctl Docu.
5 changes: 0 additions & 5 deletions Ctl/Docu/Graph8.txt

This file was deleted.

5 changes: 0 additions & 5 deletions Ctl/Docu/Outlook8.txt

This file was deleted.

5 changes: 0 additions & 5 deletions Ctl/Docu/PowerPoint8.txt

This file was deleted.

8 changes: 0 additions & 8 deletions Ctl/Docu/Sys-Map.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,15 @@
Developer Manual

T base module for automation
Excel5 MS Excel 5.0 automation interface
Excel8 MS Excel 8.0 automation interface
Excel9 MS Excel 9.0 automation interface
Word8 MS Word 8.0 automation interface
Word9 MS Word 9.0 automation interface
Outlook8 MS Outlook 8.0 automation interface
Outlook9 MS Outlook 9.0 automation interface
PowerPoint8 MS PowerPoint 8.0 automation interface
PowerPoint9 MS PowerPoint 9.0 automation interface
Access8 MS Access 8.0 automation interface
Access9 MS Access 9.0 automation interface
Graph8 MS Graph 8.0 automation interface
Graph9 MS Graph 9.0 automation interface
Office MS Office 9.0 automation interface
OfficeBinder MS Binder 9.0 automation interface
MSForms MS Forms 2.0 automation interface
DAO35 MS Data Access Objects 3.5 automation interface
DAO36 MS Data Access Objects 3.6 automation interface
ADODB MS ActiveX Data Objects 2.0 automation interface
VBIDE MS Visual Basic automation interface
4 changes: 2 additions & 2 deletions Ctl/Docu/T.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ DEFINITION CtlT;
OutObject = POINTER TO ABSTRACT RECORD (Object)
source: Object;
(obj: OutObject) GetIID (OUT iid: GUID), NEW, ABSTRACT;
(obj: OutObject) Invoke (id, n: INTEGER; VAR par: ParList; VAR ret: Variant), NEW, ABSTRACT
(obj: OutObject) Invoke (id, n: INTEGER; VAR [nil] par: ParList; VAR [nil] ret: Variant), NEW, ABSTRACT
END;

ByteT = POINTER TO RECORD (Any) val: BYTE END;
Expand Down Expand Up @@ -210,7 +210,7 @@ source: Object;
The connected source object.

PROCEDURE (obj: OutObject) GetIID (OUT iid: GUID)
PROCEDURE (obj: OutObject) Invoke (id, n: INTEGER; VAR par: ParList; VAR ret: Variant)
PROCEDURE (obj: OutObject) Invoke (id, n: INTEGER; VAR [nil] par: ParList; VAR [nil] ret: Variant),
NEW, ABSTRACT
Implemented in the automation interface module, used internally.

Expand Down
Loading

0 comments on commit bba0c52

Please sign in to comment.