The WinAPPCStartup function allows an application to specify the version of Windows APPC required and to retrieve details of the specific Windows APPC implementation. An application must call this function to register itself with a Windows APPC implementation before issuing any further Windows APPC calls.
int WINAPI WinAPPCStartup(
WORD wVersionRequired,
LPWAPPCDATA lpAPPCData
);
typedef struct {
WORD wVersion;
char szDescription[WAPPCDESCRIPTION_LEN+1];
} WAPPCDATA, FAR * LPWAPPCDATA;
where WAPPCDESCRIPTION_LEN is defined as 127
The return value specifies whether the application was registered successfully and whether the Windows APPC implementation can support the specified version number. If the value is zero, it was registered successfully and the specified version can be supported. Otherwise, the return value is one of the following:
To support future Windows APPC implementations and applications that may have functionality differences from Windows APPC version 1.0, a negotiation takes place in WinAPPCStartup. An application passes to WinAPPCStartup the Windows APPC version that it can use. If this version is lower than the lowest version supported by the Windows APPC DLL, the DLL cannot support the application and WinAPPCStartup fails. If the version is not lower, however, the call succeeds and returns the highest version of Windows APPC supported by the DLL. If this version is lower than the lowest version supported by the application, the application either fails its initialization or attempts to find another Windows APPC DLL on the system.
This negotiation allows both a Windows APPC DLL and a Windows APPC application to support a range of Windows APPC versions. An application can successfully use a DLL if there is any overlap in the versions. The following table illustrates how WinAPPCStartup works in conjunction with different application and DLL versions.
Application versions | DLL versions | To WinAPPCStartup | From WinAPPCStartup | Result |
---|---|---|---|---|
1.0 | 1.0 | 1.0 | 1.0 | Use 1.0 |
1.0, 2.0 | 1.0 | 2.0 | 1.0 | Use 1.0 |
1.0 | 1.0, 2.0 | 1.0 | 2.0 | Use 1.0 |
1.0 | 2.0, 3.0 | 1.0 | WAPPCINVALID | Fail |
2.0, 3.0 | 1.0 | 3.0 | 1.0 | App Fails |
1.0, 2.0, 3.0 | 1.0, 2.0, 3.0 | 3.0 | 3.0 | Use 3.0 |
1.0 | 1.0 | 4.0 | 1.0 | App Fails |
1.0, 2.0, 3.0, 4.0 | 1.0, 2.0, 3.0, 4.0 | 4.0 | 4.0 | Use 4.0 |
Details of the actual Windows APPC implementation are described in the WAPPCDATA structure defined as follows that is returned by WinAPPCStartup:
typedef struct tagWAPPCDDATA { WORD wVersion;
char szDescription[WAPPCDESCRIPTION_LEN+1];
} WAPPCDATA, FAR *LPWAPPCDATA;
The structure members are as follows:
After it makes its last Windows APPC call, an application should call the WinAPPCCleanup routine.
Each Windows APPC implementation must make a WinAPPCStartup call before issuing any other Windows APPC calls.