
|
  'Fichier "include" (copiÚ Ó partir de QIWSTOOL) _______________________________________________ API_DCL.BAS _______________________________________________   ________________   Variables GLOBALES (connues de l'ensemble du pgm)   ________________ '***************************************************************** ' systeme par defaut '***************************************************************** Global SysName As String * 8 Global ConvID As Long ______________________   Constantes significatives GLOBALEs   (donnent la signification en clair des codes numériques   utilisées par les APi)   _______________________   '***************************************************************** ' Router DLL Global Definitions * '***************************************************************** ' PURPOSE: ' This file contains global constants, data structures and DLL ' declarations to be used to interface with AS/400 PC Support APPC ' router from a Microsoft Visual Basic application. ' All string inputs are expected to be in ANSI ASCII character set, ' and all output strings are in ANSI ASCII. ' ROUTINES: ' EHNAPPC_Allocate ' EHNAPPC_ExtendedAllocate ' EHNAPPC_SendData ' EHNAPPC_ReceiveAndWait ' EHNAPPC_ReceiveImmediate ' EHNAPPC_Deallocate ' EHNAPPC_Confirm ' EHNAPPC_SendError |
' EHNAPPC_PrepareToReceive ' EHNAPPC_Confirmed ' EHNAPPC_RqsToSend ' EHNAPPC_Flush ' EHNAPPC_QuerySystems ' EHNAPPC_GetCapabilities ' EHNAPPC_IsRouterLoaded ' EHNAPPC_QueryConvState ' EHNAPPC_QueryUserId ' EHNAPPC_GetAttribute ' EHNAPPC_GetDefaultSystem ' EHNAPPC_RemoteProgramStart '**********************************************************************/ ' Global constants for "type" on Allocate requests Global Const EHNAPPC_BASIC = 0 Global Const EHNAPPC_MAPPED = 1 ' Global constants for "whatReceived" on Receive requests Global Const EHNAPPC_DATA = 0 Global Const EHNAPPC_DATACOMPLETE = 1 Global Const EHNAPPC_DATAINCOMPLETE = 2 Global Const EHNAPPC_RECEIVEDCONFIRM = 3 Global Const EHNAPPC_RECEIVEDCONFIRMSEND = 4 Global Const EHNAPPC_RECEIVEDCONFIRMDEALLOC = 5 Global Const EHNAPPC_RECEIVEDSEND = 6 ' Global constants for "fill" on Receive requests Global Const EHNAPPC_BUFFER = 0 Global Const EHNAPPC_LL = 1 ' Global constants for "synchLevel" on Allocate requests */ Global Const EHNAPPC_SYNCLEVELNONE = 0 Global Const EHNAPPC_SYNCLEVELCONFIRM = 1 ' Global constants for "type" on Deallocate requests Global Const EHNAPPC_DEALLOCATESYNCLEVEL = 0 Global Const EHNAPPC_DEALLOCATEFLUSH = 1 Global Const EHNAPPC_DEALLOCATEABEND = 2 ' Global constants for return codes from all router verb routines Global Const EHNAPPC_OK = 0 Global Const EHNAPPC_DEALLOCNORMAL = 1 Global Const EHNAPPC_PROGRAMERRNOTRUNCATION = 2 Global Const EHNAPPC_PROGRAMERRTRUNCATION = 3 Global Const EHNAPPC_PROGRAMERRPURGING = 4 Global Const EHNAPPC_RESOURCEFAILURERETRY = 5 Global Const EHNAPPC_RESOURCEFAILURENORETRY = 6 Global Const EHNAPPC_UNSUCCESSFUL = 7 Global Const EHNAPPC_APPCBUSY = 8 |
Global Const EHNAPPC_PARMCHKINVALIDVERB = 20 Global Const EHNAPPC_PARMCHKINVALIDCONVERID = 21 Global Const EHNAPPC_PARMCHKBUFFERCROSSSEG = 22 Global Const EHNAPPC_PARMCHKTPNAMELENGTH = 23 Global Const EHNAPPC_PARMCHKINVCONVERTYPE = 24 Global Const EHNAPPC_PARMCHKBADSYNCLVLALLOC = 25 Global Const EHNAPPC_PARMCHKBADRETURNCTRL = 26 Global Const EHNAPPC_PARMCHKPIPTOOLONG = 27 Global Const EHNAPPC_PARMCHKBADPARTNERNAME = 28 Global Const EHNAPPC_PARMCHKCONFNOTALLOWED = 29 Global Const EHNAPPC_PARMCHKBADDEALLOCTYPE = 30 Global Const EHNAPPC_PARMCHKPREPTORCVTYPE = 31 Global Const EHNAPPC_PARMCHKBADFILLTYPE = 32 Global Const EHNAPPC_PARMCHKRECMAXLEN = 33 Global Const EHNAPPC_PARMCHKUNKNOWNSECTYPE = 34 Global Const EHNAPPC_PARMCHKRESFLDNOTZERO = 35 Global Const EHNAPPC_STATECHKNOTINCONFSTAT = 40 Global Const EHNAPPC_STATECHKNOTINRECEIVE = 41 Global Const EHNAPPC_STATECHKREQSNDBADSTAT = 42 Global Const EHNAPPC_STATECHKSNDINBADSTATE = 43 Global Const EHNAPPC_STATECHKSNDERRBADSTAT = 44 Global Const EHNAPPC_ALLOCERRNORETRY = 50 Global Const EHNAPPC_ALLOCERRRETRY = 51 Global Const EHNAPPC_ALLOCERRPGMNOTAVAILNR = 52 Global Const EHNAPPC_ALLOCERRTPNNOTRECOG = 53 Global Const EHNAPPC_ALLOCERRPGMNOTAVAILR = 54 Global Const EHNAPPC_ALLOCERRSECNOTVALID = 55 Global Const EHNAPPC_ALLOCERRCONVTYP = 56 Global Const EHNAPPC_ALLOCERRPIPNOTALLOWED = 57 Global Const EHNAPPC_ALLOCERRPIPNOTCORRECT = 58 Global Const EHNAPPC_ALLOCERRSYNCHLEVEL = 59 Global Const EHNAPPC_DEALLOCABENDPROGRAM = 70 Global Const EHNAPPC_INSUFFICIENTMEMORY = 71 Global Const EHNAPPC_MEMORYALLOCERROR = 72 Global Const EHNAPPC_TOOMANYCONVERSATIONS = 73 Global Const EHNAPPC_CONVTABLEFULL = 74 Global Const EHNAPPC_ROUTERNOTINSTALLED = 75 Global Const EHNAPPC_ROUTERWRONGLEVEL = 76 Global Const EHNAPPC_PCSWINNOTLOADED = 77 Global Const EHNAPPC_PCSWINOUTOFMEMORY = 78 Global Const EHNAPPC_INVALIDUSERIDLEN = 79 Global Const EHNAPPC_INVALIDPASSWORDLEN = 80 Global Const EHNAPPC_INVALIDLUNAME = 81 Global Const EHNAPPC_UNDEFINED = 99 |
' Global constants for conversation states Global Const EHNAPPC_RESET_STATE = 0 Global Const EHNAPPC_SEND_STATE = 1 Global Const EHNAPPC_RECEIVE_STATE = 2 Global Const EHNAPPC_RCVD_CONF_STATE = 3 Global Const EHNAPPC_RCVD_CONF_SEND_STATE = 4 Global Const EHNAPPC_RCVD_CONF_DEALL_STATE = 5 Global Const EHNAPPC_PEND_DEALLOCATE_STATE = 6 Global Const EHNAPPC_INVALID_STATE = 7 ' Global constants for security types */ Global Const EHNAPPC_SECURITY_NONE = 0 Global Const EHNAPPC_SECURITY_SAME = 1 Global Const EHNAPPC_SECURITY_PGM = 2 '/******************************************************************* ***/ '/* defines and structures used for get system names call */ '/**********************************************************************/ Global Const EHNAPPC_SYSNAME_LENGTH = 10 ' System name length */ Global Const EHNAPPC_MAX_SYSTEMS = 32 ' Max active systems */ '/******************************************************************* ***/ '/* defines and structures used for get capabilities call */ '/**********************************************************************/ '/* Get capability Operation Code */ Global Const EHNAPPC_OC_CAPABILITIES = &H17 '/* Capability identifier values. */ Global Const EHNAPPC_CAP_OPTIMAL_COM_SIZE = &H2 Global Const EHNAPPC_CAP_QUERY_CONV_STATE = &H3 Global Const EHNAPPC_CAP_EXT_ALLOCATE = &H4 '/* RC values for the header and the individual entries. */ Global Const EHNAPPC_CAP_SUCCESSFUL = &H0 Global Const EHNAPPC_CAP_UNSUCCESSFUL = &H1 '/* The next values are for checking the data field in boolean queries. */ Global Const EHNAPPC_CAP_SUPPORTED = &H1 Global Const EHNAPPC_CAP_UNSUPPORTED = &H0   _______________________________   DÚclaration des donnÚes typÚes.   ________________________________ Type appcrtrcap_hdr ' Router capability list header */ rc As String * 1 ' 0 Overall return code */ ' EHNAPPC_CAP_SUCCESSFUL */ ' EHNAPPC_CAP_UNSUCCESSFUL */ opcode As String * 1 ' 1 Verb operation code */ |
' EHNAPPC_OC_CAPABILITIES */ Length As Integer ' 2 Length of entire verb */ End Type Type appcrtrcap_mult ' Optimal comm. buffer multiplier */ Length As Integer ' Length of this entry */ identifier As String * 1 ' Capability identifier */ ' EHNAPPC_CAP_OPTIMAL_COM_SIZE */ rc As String * 1 ' This entry's return code */ ' EHNAPPC_CAP_SUCCESSFUL */ ' EHNAPPC_CAP_UNSUCCESSFUL */ data As Integer ' The multiplier */ End Type Type appcrtrcap_query ' Used for boolean queries */ Length As Integer ' Length of this entry */ identifier As String * 1 ' Capability identifier */ ' EHNAPPC_CAP_QUERY_CONV_STATE */ rc As String * 1 ' This entry's return code */ ' EHNAPPC_CAP_SUCCESSFUL */ ' EHNAPPC_CAP_UNSUCCESSFUL */ data As String * 1 ' The returned boolean value */ ' EHNAPPC_CAP_SUPPORTED */ ' EHNAPPC_CAP_UNSUPPORTED */ End Type   _______________________________   Déclaration des API PCS/400     (situées dans des DLL répertoire \PCS)   '********************************************************************** Declare Function EHNAPPC_Allocate% Lib "EHNAPPC.DLL" (ByVal hWnd%, ByVal nBufferLe ngth%, ByVal bType%, ByVal bSynchLevel%, ByVal lpszLocationName$, ByVal lpszTpn$, ByVal nPipLength%, ByVal lpPipData As Any, lpdwConversation&) ' PARAMETERS: ' HWND hWnd Caller's Windows handle ' unsigned nBufferLength Size of buffer to be allocated by ' router. It must be at least 271. ' If it is less than 271, a 271 byte ' buffer will be allocated. ' ConversationType bType Basic or Mapped conversation |
' SyncLevelEnum bSynchLevel None or confirm ' LPSTR lpszLocationName ASCIIZ string specifying host system name. ' Set to NULL to use default system. ' LPSTR lpszTpn ASCIIZ string specifying partner ' program name. ' If first character is less than 0x40 ' ASCII to EBCDIC translation is not ' done. ' int nPipLength Length of PIP data. Set to 0 to ' not send PIP data. ' LPVOID lpPipData no translation done, must be in GDS ' format ' LPDWORD lpdwConversation Pointer to a double word handle ' returned by router to be used on ' subsequent calls. ' RETURN VALUE: ' int Use the ReturnCode enumerations to determine the meaning ' of the return code ' USAGE NOTES: ' procedure Allocate is used to start a conversation with a partner '******************************************************************** ** Declare Function EHNAPPC_ExtendedAllocate% Lib "EHNAPPC.DLL" (ByVal hWnd%, ByVal B ufLen%, ByVal bType%, ByVal SynchLvl%, ByVal LocName$, ByVal Tpn$, ByVal ModeName, ByVal SecType%, ByVal UId$, ByVal Pass$, ByVal PipLen%, ByVal PipData As Any, Con v&) ' PARAMETERS: ' HWND hWnd Caller's Windows handle ' unsigned nBufferLength Size of buffer to be allocated by ' router. It must be at least 271. ' If it is less than 271, a 271 byte ' buffer will be allocated. ' ConversationType bType Basic or Mapped conversation ' SyncLevelEnum bSynchLevel None or confirm ' LPSTR lpszLocationName ASCIIZ string specifying host system name. ' Set to NULL to use default system. ' LPSTR lpszTpn ASCIIZ string specifying partner ' program name. ' If first character is less than 0x40 ' ASCII to EBCDIC translation is not ' done. ' LPSTR lpszModeName Must be NULL ' SecurityType bSecurityType Security type: ' EHNAPPC_SECURITY_NONE ' EHNAPPC_SECURITY_SAME |
' EHNAPPC_SECURITY_PGM ' LPSTR lpszUserId ASCIIZ string containing user ID ' Maximum length of 10 characters   ' LPSTR lpszPassword ASCIIZ string containing password ' Maximum length of 10 characters ' int nPipLength Length of PIP data. Set to 0 to ' not send PIP data. ' LPVOID lpPipData no translation done, must be in GDS ' format ' LPDWORD lpdwConversation Pointer to a double word handle ' returned by router to be used on ' subsequent calls. ' RETURN VALUE: ' int Use the ReturnCode enumerations to determine the meaning ' of the return code ' USAGE NOTES: ' procedure Allocate is used to start a conversation with a partner '******************************************************************** ** Declare Function EHNAPPC_SendData% Lib "EHNAPPC.DLL" (ByVal hWnd%, ByVal dwConvers ation&, ByVal nSendDataLength%, ByVal lpSendDataBuffer$, lpRequestToSendRcvd%) ' PARAMETERS: ' HWND hWnd Caller's Windows handle ' DWORD dwConversation Conversation handle returned from ' allocate verb ' int nSendDataLength Length of data in Send buffer ' LPVOID lpSendDataBuffer Address of Send buffer ' LPBYTE lpRequestToSendRcvd Returns whether request to send ' was received ' RETURN VALUE: ' int Use the ReturnCode enumerations to determine the meaning ' of the return code ' USAGE NOTES: ' Sends data to your partner program. See PC Support/400: Application ' Program Interface Reference, under Router Service Verbs and Basic ' Conversation Verbs for the data format. '********************************************************************* * Declare Function EHNAPPC_ReceiveAndWait% Lib "EHNAPPC.DLL" (ByVal hWnd%, ByVal dwC onversation&, ByVal bFill%, ByVal nMaxLength%, ByVal lpReceiveData$, lpWhatReceive d%, lpRequestToSendRcvd%, lpReceiveDataLength%) ' PARAMETERS: ' HWND hWnd Caller's Windows handle ' DWORD dwConversation Conversation handle returned from ' allocate verb |
' FillEnum bFill Fill LL or Fill buffer ' int nMaxLength Largest amount of data that can be ' accepted ' LPVOID lpReceiveData Pointer to receive buffer ' LPBYTE lpWhatReceived Returned by router to indicate whether ' data, confirm, send indication, etc. ' has been received. ' LPBYTE lpRequestToSendRcvd Returns whether request to send ' was received ' LPWORD lpReceiveDataLength Returned by router to indicate the ' amount of data received. ' RETURN VALUE: ' int Use the ReturnCode enumerations to determine the meaning ' of the return code ' USAGE NOTES:   ' ReceiveAndWait is used to wait for information to arrive on ' the conversation and then receives the information. '********************************************************************* * Declare Function EHNAPPC_ReceiveImmediate% Lib "EHNAPPC.DLL" (ByVal hWnd%, ByVal d wConversation&, ByVal bFill%, ByVal nMaxLength%, ByVal lpReceiveData$, lpWhatRecei ved%, lpRequestToSendRcvd%, lpReceiveDaaLength%) ' PARAMETERS: ' HWND hWnd Caller's Windows handle ' DWORD dwConversation Conversation handle returned from ' allocate verb ' FillEnum bFill Fill LL or fill buffer ' int nMaxLength Largest amount of data that can be ' accepted ' LPVOID lpReceiveData Pointer to receive buffer ' LPBYTE lpWhatReceived Returned by router to indicate whether ' data, confirm, send indication, etc. ' has been received. ' LPBYTE lpRequestToSendRcvd Returns whether request to send ' was received ' LPWORD lpReceiveDataLength Returned by router to indicate the ' amount of data received. ' RETURN VALUE: ' int Use the ReturnCode enumerations to determine the meaning ' of the return code ' USAGE NOTES: ' Receive Immediate will check to see if something has been received ' If it has it is returned. If not a return code- unsuccessful ' is returned |
'********************************************************************* * Declare Function EHNAPPC_Deallocate% Lib "EHNAPPC.DLL" (ByVal hWnd%, ByVal dwConve rsation&, ByVal bType%) ' PARAMETERS: ' HWND hWnd Caller's Windows handle ' DWORD dwConversation Conversation handle returned from ' allocate verb ' DeallocateEnum bType Use EHNAPPC_DEALLOCATEFLUSH for normal ' deallocate or EHNAPPC_DEALLOCATEABEND ' for error. ' RETURN VALUE: ' int Use the ReturnCode enumerations to determine the meaning ' of the return code ' USAGE NOTES: ' Deallocates an allocated conversation. '********************************************************************* * Declare Function EHNAPPC_Convirm% Lib "EHNAPPC.DLL" (ByVal hWnd%, ByVal dwConversa tion&, lpRequestToSendRcvd%) ' PARAMETERS: ' HWND hWnd Caller's Windows handle ' DWORD dwConversation Conversation handle returned from ' allocate verb ' LPBYTE lpRequestToSendRcvd Returns whether request to send ' was received ' RETURN VALUE: ' int Use the ReturnCode enumerations to determine the meaning   ' of the return code ' USAGE NOTES: ' Confirm is used to request a confirmation that all data sent so far ' has been received by the partner. '********************************************************************* * Declare Function EHNAPPC_SendError% Lib "EHNAPPC.DLL" (ByVal hWnd%, ByVal dwConver sation&, lpRequestToSendRcvd%) ' PARAMETERS: ' HWND hWnd Caller's Windows handle ' DWORD dwConversation Conversation handle returned from ' allocate verb ' LPBYTE lpRequestToSendRcvd Returns whether request to send ' was received ' RETURN VALUE: ' int Use the ReturnCode enumerations to determine the meaning ' of the return code ' USAGE NOTES: |
' SendError is used to indicate to the partner program that some error ' has been found. After using send error the local program is always ' in receive state. '******************************************************************** ** Declare Function EHNAPPC_PrepareToReceive% Lib "EHNAPPC.DLL" (ByVal hWnd%, ByVal d wConversation&) ' PARAMETERS: ' HWND hWnd Caller's Windows handle ' DWORD dwConversation Conversation handle returned from ' allocate verb ' RETURN VALUE: ' int Use the ReturnCode enumerations to determine the meaning ' of the return code ' USAGE NOTES: ' Prepare to Receive is used as a preface to using ReceiveImmediate '******************************************************************** * Declare Function EHNAPPC_Confirmed% Lib "EHNAPPC.DLL" (ByVal hWnd%, ByVal dwConver sation&) ' PARAMETERS: ' HWND hWnd Caller's Windows handle ' DWORD dwConversation Conversation handle returned from ' allocate verb ' RETURN VALUE: ' int Use the ReturnCode enumerations to determine the meaning ' of the return code ' USAGE NOTES: ' Confirmed is used to send a confirmation to a partner that has ' requested it '********************************************************************* * Declare Function EHNAPPC_RqsToSend% Lib "EHNAPPC.DLL" (ByVal hWnd%, ByVal dwConver sation&) ' PARAMETERS:   ' HWND hWnd Caller's Windows handle ' DWORD dwConversation Conversation handle returned from ' allocate verb ' RETURN VALUE: ' int Use the ReturnCode enumerations to determine the meaning ' of the return code ' USAGE NOTES: ' RequestToSend is used to request that your partner give up control ' of the conversation. Local program must stays in receive state ' until Send is received. '********************************************************************* * |
Declare Function EHNAPPC_Flush% Lib "ENHAPPC.DLL" (ByVal hWnd%, ByVal dwConversati on&) ' PARAMETERS: ' HWND hWnd Caller's Windows handle ' DWORD dwConversation Conversation handle returned from ' allocate verb ' RETURN VALUE: ' int Use the ReturnCode enumerations to determine the meaning ' of the return code ' USAGE NOTES: ' Flush can be used to cause the router to send any data that it may ' have in its buffers '********************************************************************* * Declare Function EHNAPPC_QuerySystems% Lib "EHNAPPC.DLL" (ByVal hWnd%, lpsysCount% , ByVal lpSys As String) ' PARAMETERS: ' HWND hWnd Caller's Windows handle ' LPINT lpSysCount Returns number of systems connected ' LPSYSSTRUC lpSys Pointer to array of system names ' RETURN VALUE: ' EHNAPPC_OK - The list was retrieved ok. ' EHNAPPC_ROUTER_NOT_LOADED - The router is not loaded. ' EHNAPPC_PCSWIN_NOT_LOADED - PCSWIN is not loaded. ' EHNAPPC_ROUTER_WRONG_LEVEL - Down-level router loaded. ' USAGE NOTES: ' The first system in the list is the default system. '********************************************************************* * Declare Function EHNAPPC_GetCapabilities% Lib "EHNAPPC.DLL" (ByVal hWnd%, ByVal lp List$) ' PARAMETERS: ' HWND hWnd Caller's Windows handle ' LPSTR lpList Pointer to data structure that is ' returned indicating the functions ' supported by the router. ' RETURN VALUE: ' int return code ' USAGE NOTES: '********************************************************************* *   Declare Function EHNAPPC_IsRouterLoaded% Lib "EHNAPPC.DLL" (ByVal hWnd%) ' PARAMETERS: ' HWND hWnd Caller's Windows handle ' RETURN VALUE: ' TRUE if router is loaded, FALSE if not. |
' USAGE NOTES: ' This function will return FALSE if: ' 1) router is not loaded ' 2) PCSWIN is not loaded ' 3) wrong level (level that does not match the DLL) of router ' is not loaded '********************************************************************* * Declare Function EHNAPPC_QueryConvState% Lib "EHNAPPC.DLL" (ByVal hWnd%, ByVal dwC onversation&) ' PARAMETERS: ' HWND hWnd Caller's Windows handle ' DWORD dwConversation Conversation handle returned from ' allocate verb ' RETURN VALUE: ' int State of the conversation. ' USAGE NOTES: '********************************************************************* * Declare Function EHNAPPC_QueryUserId% Lib "EHNAPPC.DLL" (ByVal hWnd%, ByVal lpszLo cationName$, ByVal lpszUserId$) ' PARAMETERS: ' HWND hWnd Caller's Windows handle ' LPSTR lpszLocationName ASCIIZ string specifying system name ' to be queried ' LPSTR lpszUserId ASCIIZ string returned by the call ' containing user id for the specified ' system ' RETURN VALUE: ' int return code ' USAGE NOTES: ' Return user ID for the system specified. '********************************************************************* * Declare Function EHNAPPC_GetAttributes% Lib "EHNAPPC.DLL" (ByVal hWnd%, ByVal dwCo nversation&, lpbSyncLevel%, ByVal lpszModeName$, ByVal lpszLuName$, ByVal lpszPluN ame$, ByVal lpszUserId$) ' PARAMETERS: ' HWND hWnd Caller's Windows handle ' DWORD dwConversation Conversation handle returned by ' allocate verb ' LPBYTE lpbSyncLevel Pointer to sync level ' EHNAPPC_NONE ' EHNAPPC_CONFIRM ' LPSTR lpszModeName ASCIIZ string returned by the call ' containing mode name ' Maximum of 8 characters |
' LPSTR lpszLuName ASCIIZ string returned by the call ' containing local logical unit name ' Maximum of 8 characters   ' LPSTR lpszPluName ASCIIZ string returned by the call ' containing partner logical unit name ' Maximum of 8 characters ' LPSTR lpszUserId ASCIIZ string returned by the call ' containing user id for the specified ' system ' Maximum of 10 characters ' RETURN VALUE: ' int return code ' USAGE NOTES: ' Return user for specified conversation handle '********************************************************************* * Declare Function EHNAPPC_GetDefaultSystem% Lib "EHNAPPC.DLL" (ByVal hWnd%, ByVal l pszDefSysName$) ' PARAMETERS: ' HWND hWnd Caller's Windows handle ' LPSTR lpszDefSysName ASCIIZ string returned by the call ' containing the default system name ' RETURN VALUE: ' int return code ' USAGE NOTES: ' Return the default AS/400 system name '********************************************************************* ** Declare Function EHNAPPC_RemoteProgramStart% Lib "EHNAPPC.DLL" (ByVal hWnd%, ByVal lpszHostSystemName$, ByVal lpszHostProgramName$, ByVal lpszHostLibraryname$, ByVa l lpchPipData$, wPipDataLength%) ' SYNTAX: ' extern WORD FAR PASCAL EHNAPPC_RemoteProgramStart(HWND hWindow, ' LPSTR lpszHostSystemName, ' LPSTR lpszHostProgramName, ' LPSTR lpszHostLibraryName, ' char FAR *lpchPipData, ' WORD wPipDataLength); ' PURPOSE: ' This function will allow a Windows application start a program on a ' remote AS/400. ' PARAMETERS: ' HWND hWindow ' Identifies the Window of the calling application ' LPSTR lpszHostSystemName |
' Contains the name of the remote system. Set to NULL to use the ' default system. The string must be an ASCIIZ string up to 8 ' characters. ' LPSTR lpszHostProgramName ' Contains the name of the host program which is to be started. The ' string must be an ASCIIZ string. ' LPSTR lpszHostLibraryName ' Contains the library path of the host program. Set to NULL to use ' the default library list. The string must be an ASCIIZ string. ' char FAR * lpchPipData ' Contains the program initialization parameters for the host program. ' Set to NULL if no PIP data is to be sent. NOTE: this function only ' supports 1 parameter as PIP data.   ' WORD wPipDataLength ' Contains the length of the PIP data. ' RETURN VALUE: ' The return code for this function is the primary return code from the ' router APIs. If the function should fail due to unsuccessful data ' conversion to EBCIDIC it will return the router primary return code ' EHNRT_UNSUCCESSFUL. '***************************************************************** ' ASCII to EBCDIC and EBCDIC to ASCII translation Routines * '***************************************************************** Global Const EHNDT_XLATE_SUCCESSFUL = 0 Global Const EHNDT_A2E_TABLE_NOT_FOUND = 1 Global Const EHNDT_E2A_TABLE_NOT_FOUND = 1 Declare Function EHNDT_ASCIIToEBCDIC% Lib "EHNAPPC.DLL" (ByVal hWnd%, ByVal lpsSou rce$, ByVal lpsTarget$, ByVal wSource%, lpwTarget%) ' PURPOSE: ' Translate an ASCII (OEM codepage) string to EBCDIC. ' PARAMETERS: ' HWND hWnd ' Caller's Windows handle. ' ' LPSTR lpsSource ' Pointer to source string. ' ' LPSTR lpsTarget ' Pointer to target string. ' ' unsigned int wSource ' Length of source string (number of bytes to translate). ' |
' LPWORD lpwTarget ' Pointer to word variable containing the size of the target buffer. ' This variable will be updated with the total number of translated ' characters in the target buffer. ' ' RETURN VALUE: unsigned int ' EHNDT_XLATE_SUCCESSFUL ' EHNDT_A2E_TABLE_NOT_FOUND ' USAGE NOTES: ' The source and target should not be pointed to the same string. The ' source string is not modified. The size of the target buffer must ' be specified in the variable pointed by the pointer lpwTarget. If ' the target string is not large enough to contain the translated ' string, then translation stops at the end of the target string. ' If the target string is larger than required, it is then blank ' filled to the end of the string. The total number of translated ' characters in the target buffer is returned to the caller. ' This routine translates from ASCII to EBCDIC based on the transla tion ' table loaded by the PC Support router. This is the equivalent of ' the Windows OEM character set. ' Declare Function EHNDT_EBCDICToASCII% Lib "EHNAPPC.DLL" (ByVal hWnd%, ByVal lpsSou rce$, ByVal lpsTarget$, ByVal wSource%, lpwTarget%) ' PURPOSE: ' Translate an EBCDIC string to ASCII (OEM codepage).   ' PARAMETERS: ' HWND hWnd ' Caller's Windows handle. ' ' LPSTR lpsSource ' Pointer to source string. ' ' LPSTR lpsTarget ' Pointer to target string. ' ' unsigned int wSource ' Length of source string (number of bytes to translate). ' ' LPWORD lpwTarget ' Pointer to word variable containing the size of the target buffer. ' This variable will be updated with the total number of translated ' characters in the target buffer. ' |
' RETURN VALUE: unsigned int ' EHNDT_XLATE_SUCCESSFUL ' EHNDT_E2A_TABLE_NOT_FOUND ' USAGE NOTES: ' The source and target should not be pointed to the same string. The ' source string is not modified. The size of the target buffer must ' be specified in the variable pointed by the pointer lpwTarget. If ' the target string is not large enough to contain the translated ' string, then translation stops at the end of the target string. ' If the target string is larger than required, it is then blank ' filled to the end of the string. The total number of translated ' characters in the target buffer is returned to the caller. ' This routine translates from EBCDIC to ASCII based on the transla tion ' table loaded by the PC Support router. This is the equivalent of ' the Windows OEM character set. ' |