home *** CD-ROM | disk | FTP | other *** search
/ Supercompiler 1997 / SUPERCOMPILER97.iso / MS_VC.50 / VC / MFC / SRC / INETIMPL.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-12-03  |  10.4 KB  |  331 lines

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1997 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10.  
  11. #ifndef _MAC
  12. #ifdef _AFXDLL
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // AFX_WININET_CALL - used to dynamically load WININET.DLL
  16.  
  17. struct AFX_WININET_CALL
  18. {
  19. // generic connection
  20.  
  21.     HINTERNET (WINAPI* pfnInternetOpen)(
  22.         LPCTSTR lpszAgent, DWORD dwAccessType,
  23.         LPCTSTR lpszProxy, LPCTSTR lpszProxyBypass, DWORD dwFlags);
  24.     HINTERNET (WINAPI* pfnInternetCloseHandle)(HINTERNET hInternet);
  25.     HINTERNET (WINAPI* pfnInternetOpenUrl)(HINTERNET hInternet,
  26.         LPCTSTR pstrUrl, LPCTSTR pstrHeaders, DWORD dwHeadersLength,
  27.         DWORD dwFlags, DWORD dwContext);
  28.     HINTERNET (WINAPI* pfnInternetReadFile)(HINTERNET hInternet,
  29.         LPVOID lpBuffer, DWORD dwNumberOfBytesToRead,
  30.         LPDWORD lpdwNumberOfBytesRead);
  31.     HINTERNET (WINAPI* pfnInternetWriteFile)(HINTERNET hInternet,
  32.         LPCVOID lpBuffer, DWORD dwNumberOfBytesToWrite,
  33.         LPDWORD lpdwNumberOfBytesWritten);
  34.     INTERNET_STATUS_CALLBACK (WINAPI* pfnInternetSetStatusCallback)(
  35.         HINTERNET hInternet, INTERNET_STATUS_CALLBACK lpfnInternetCallback);
  36.     BOOL (WINAPI* pfnInternetQueryOption)(HINTERNET hInternet,
  37.         DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufferLength);
  38.     BOOL (WINAPI* pfnInternetSetOption)(HINTERNET hInternet,
  39.         DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength);
  40.     BOOL (WINAPI* pfnInternetSetOptionEx)(HINTERNET hInternet,
  41.         DWORD dwOption, LPVOID lpBuffer, DWORD dwBufferLength, DWORD dwFlags);
  42.     BOOL (WINAPI* pfnInternetGetLastResponseInfo)(LPDWORD lpdwError,
  43.         LPTSTR pstrBuffer, LPDWORD lpdwBufferLength);
  44.     BOOL (WINAPI* pfnInternetFindNextFile)(HINTERNET hFind,
  45.         LPVOID lpvFindData);
  46.     HINTERNET (WINAPI* pfnInternetConnect)(HINTERNET hInternet,
  47.         LPCTSTR pstrServerName, INTERNET_PORT nServerPort,
  48.         LPCTSTR pstrUsername, LPCTSTR pstrPassword, DWORD dwService,
  49.         DWORD dwFlags, DWORD dwContext);
  50.     DWORD (WINAPI* pfnInternetSetFilePointer)(HINTERNET hFile,
  51.         LONG lDistanceToMove, PVOID reserved, DWORD dwMoveMethod,
  52.         DWORD dwContext);
  53.     BOOL (WINAPI* pfnInternetQueryDataAvailable)(HINTERNET hFile,
  54.         LPDWORD lpdwNumberOfBytesAvailable, DWORD dwFlags, DWORD dwContext);
  55.  
  56. // ftp
  57.  
  58.     HINTERNET (WINAPI* pfnFtpFindFirstFile)(HINTERNET hFtpSession,
  59.         LPCTSTR pstrSearchFile, LPWIN32_FIND_DATA lpFindFileData,
  60.         DWORD dwFlags, DWORD dwContext);
  61.     BOOL (WINAPI* pfnFtpGetFile)(HINTERNET hFtpSession,
  62.         LPCTSTR pstrRemoteFile, LPCTSTR pstrNewFile, BOOL fFailIfExists,
  63.         DWORD dwFlagsAndAttributes, DWORD dwFlags, DWORD dwContext);
  64.     BOOL (WINAPI* pfnFtpPutFile)(HINTERNET hFtpSession,
  65.         LPCTSTR pstrLocalFile, LPCTSTR pstrNewRemoteFile, DWORD dwFlags,
  66.         DWORD dwContext);
  67.     BOOL (WINAPI* pfnFtpDeleteFile)(HINTERNET hFtpSession,
  68.         LPCTSTR pstrFileName);
  69.     BOOL (WINAPI* pfnFtpRenameFile)(HINTERNET hFtpSession,
  70.         LPCTSTR pstrExisting, LPCTSTR pstrNew);
  71.     BOOL (WINAPI* pfnFtpCreateDirectory)(HINTERNET hFtpSession,
  72.         LPCTSTR pstrDirectory);
  73.     BOOL (WINAPI* pfnFtpRemoveDirectory)(HINTERNET hFtpSession,
  74.         LPCTSTR pstrDirectory);
  75.     BOOL (WINAPI* pfnFtpSetCurrentDirectory)(HINTERNET hFtpSession,
  76.         LPCTSTR pstrDirectory);
  77.     BOOL (WINAPI* pfnFtpGetCurrentDirectory)(HINTERNET hFtpSession,
  78.         LPCTSTR pstrCurrentDirectory, LPDWORD lpdwCurrentDirectory);
  79.     BOOL (WINAPI* pfnFtpCommand)(HINTERNET hFtpSession,
  80.         BOOL fExpectResponse, DWORD dwFlags, LPCTSTR pstrCommand,
  81.         DWORD dwContext);
  82.     HINTERNET (WINAPI* pfnFtpOpenFile)(HINTERNET hFtpSession,
  83.         LPCTSTR pstrFileName, DWORD dwAccess, DWORD dwFlags, DWORD dwContext);
  84.  
  85. // gopher
  86.  
  87.     HINTERNET (WINAPI* pfnGopherFindFirstFile)(HINTERNET hGopherSession,
  88.         LPCTSTR pstrLocator, LPCTSTR pstrSearchString,
  89.         LPGOPHER_FIND_DATA lpFindData, DWORD dwFlags, DWORD dwContext);
  90.     HINTERNET (WINAPI* pfnGopherOpenFile)(HINTERNET hGopherSession,
  91.         LPCTSTR pstrLocator, LPCTSTR pstrView, DWORD dwFlags,
  92.         DWORD dwContext);
  93.     BOOL (WINAPI* pfnGopherCreateLocator)(LPCTSTR pstrHost,
  94.         INTERNET_PORT nServerPort, LPCTSTR pstrDisplayString,
  95.         LPCTSTR pstrSelectorString, DWORD dwGopherType,
  96.         LPTSTR pstrLocator, LPDWORD lpdwBufferLength);
  97.     BOOL (WINAPI* pfnGopherGetAttribute)(HINTERNET hGopherSession,
  98.         LPCTSTR pstrLocator, LPCTSTR pstrAttributeName, LPBYTE lpBuffer,
  99.         DWORD dwBufferLength, LPDWORD lpdwCharactersReturned,
  100.         GOPHER_ATTRIBUTE_ENUMERATOR lpfnEnumerator, DWORD dwContext);
  101.     BOOL (WINAPI* pfnGopherGetLocatorType)(LPCTSTR pstrLocator,
  102.         LPDWORD pdwGopherType);
  103.  
  104. // html
  105.  
  106.     HINTERNET (WINAPI* pfnHttpOpenRequest)(HINTERNET hHttpSession,
  107.         LPCTSTR pstrVerb, LPCTSTR pstrObjectName, LPCTSTR pstrVersion,
  108.         LPCTSTR pstrReferrer, LPCTSTR FAR * lppstrAcceptTypes,
  109.         DWORD dwFlags, DWORD dwContext);
  110.     BOOL (WINAPI* pfnHttpAddRequestHeaders)(HINTERNET hHttpRequest,
  111.         LPCTSTR pstrHeaders, DWORD dwHeadersLength, DWORD dwModifiers);
  112.     BOOL (WINAPI* pfnHttpSendRequest)(HINTERNET hHttpRequest,
  113.         LPCTSTR pstrHeaders, DWORD dwHeadersLength, LPVOID lpOptional,
  114.         DWORD dwOptionalLength);
  115.     BOOL (WINAPI* pfnHttpQueryInfo)(HINTERNET hHttpRequest,
  116.         DWORD dwInfoLevel, LPVOID lpvBuffer, LPDWORD lpdwBufferLength,
  117.         LPDWORD dwIndex);
  118.     DWORD (WINAPI*pfnInternetErrorDlg)(HWND hWnd, HINTERNET hRequest,
  119.          DWORD dwError, DWORD dwFlags, LPVOID * lppvData);
  120.  
  121. // utility
  122.  
  123.     BOOL (WINAPI* pfnInternetCrackUrl)(LPCTSTR lpszUrl, DWORD dwUrlLength,
  124.         DWORD dwFlags, LPURL_COMPONENTS lpUrlComponents);
  125.     BOOL (WINAPI* pfnInternetCanonicalizeUrl)(LPCTSTR lpszUrl,
  126.         LPTSTR lpszBuffer, LPDWORD lpdwBufferLength, DWORD dwFlags);
  127. };
  128.  
  129. extern AFX_DATA AFX_WININET_CALL _afxWinINet;
  130.  
  131.  
  132. /////////////////////////////////////////////////////////////////////////////
  133. // macros for AFX_WININET_CALL access
  134.  
  135. // generic connection
  136.  
  137. #ifdef InternetOpen
  138. #undef InternetOpen
  139. #endif
  140. #define InternetOpen _afxWinINet.pfnInternetOpen
  141.  
  142. #ifdef InternetCloseHandle
  143. #undef InternetCloseHandle
  144. #endif
  145. #define InternetCloseHandle _afxWinINet.pfnInternetCloseHandle
  146.  
  147. #ifdef InternetOpenUrl
  148. #undef InternetOpenUrl
  149. #endif
  150. #define InternetOpenUrl _afxWinINet.pfnInternetOpenUrl
  151.  
  152. #ifdef InternetReadFile
  153. #undef InternetReadFile
  154. #endif
  155. #define InternetReadFile _afxWinINet.pfnInternetReadFile
  156.  
  157. #ifdef InternetWriteFile
  158. #undef InternetWriteFile
  159. #endif
  160. #define InternetWriteFile _afxWinINet.pfnInternetWriteFile
  161.  
  162. #ifdef InternetSetStatusCallback
  163. #undef InternetSetStatusCallback
  164. #endif
  165. #define InternetSetStatusCallback _afxWinINet.pfnInternetSetStatusCallback
  166.  
  167. #ifdef InternetSetOption
  168. #undef InternetSetOption
  169. #endif
  170. #define InternetSetOption _afxWinINet.pfnInternetSetOption
  171.  
  172. #ifdef InternetSetOptionEx
  173. #undef InternetSetOptionEx
  174. #endif
  175. #define InternetSetOptionEx _afxWinINet.pfnInternetSetOptionEx
  176.  
  177. #ifdef InternetQueryOption
  178. #undef InternetQueryOption
  179. #endif
  180. #define InternetQueryOption _afxWinINet.pfnInternetQueryOption
  181.  
  182. #ifdef InternetGetLastResponseInfo
  183. #undef InternetGetLastResponseInfo
  184. #endif
  185. #define InternetGetLastResponseInfo _afxWinINet.pfnInternetGetLastResponseInfo
  186.  
  187. #ifdef InternetFindNextFile
  188. #undef InternetFindNextFile
  189. #endif
  190. #define InternetFindNextFile _afxWinINet.pfnInternetFindNextFile
  191.  
  192. #ifdef InternetConnect
  193. #undef InternetConnect
  194. #endif
  195. #define InternetConnect _afxWinINet.pfnInternetConnect
  196.  
  197. #ifdef InternetSetFilePointer
  198. #undef InternetSetFilePointer
  199. #endif
  200. #define InternetSetFilePointer _afxWinINet.pfnInternetSetFilePointer
  201.  
  202. #ifdef InternetQueryDataAvailable
  203. #undef InternetQueryDataAvailable
  204. #endif
  205. #define InternetQueryDataAvailable _afxWinINet.pfnInternetQueryDataAvailable
  206.  
  207.  
  208. // ftp
  209.  
  210. #ifdef FtpFindFirstFile
  211. #undef FtpFindFirstFile
  212. #endif
  213. #define FtpFindFirstFile _afxWinINet.pfnFtpFindFirstFile
  214.  
  215. #ifdef FtpGetFile
  216. #undef FtpGetFile
  217. #endif
  218. #define FtpGetFile _afxWinINet.pfnFtpGetFile
  219.  
  220. #ifdef FtpPutFile
  221. #undef FtpPutFile
  222. #endif
  223. #define FtpPutFile _afxWinINet.pfnFtpPutFile
  224.  
  225. #ifdef FtpDeleteFile
  226. #undef FtpDeleteFile
  227. #endif
  228. #define FtpDeleteFile _afxWinINet.pfnFtpDeleteFile
  229.  
  230. #ifdef FtpRenameFile
  231. #undef FtpRenameFile
  232. #endif
  233. #define FtpRenameFile _afxWinINet.pfnFtpRenameFile
  234.  
  235. #ifdef FtpCreateDirectory
  236. #undef FtpCreateDirectory
  237. #endif
  238. #define FtpCreateDirectory _afxWinINet.pfnFtpCreateDirectory
  239.  
  240. #ifdef FtpRemoveDirectory
  241. #undef FtpRemoveDirectory
  242. #endif
  243. #define FtpRemoveDirectory _afxWinINet.pfnFtpRemoveDirectory
  244.  
  245. #ifdef FtpGetCurrentDirectory
  246. #undef FtpGetCurrentDirectory
  247. #endif
  248. #define FtpGetCurrentDirectory _afxWinINet.pfnFtpGetCurrentDirectory
  249.  
  250. #ifdef FtpSetCurrentDirectory
  251. #undef FtpSetCurrentDirectory
  252. #endif
  253. #define FtpSetCurrentDirectory _afxWinINet.pfnFtpSetCurrentDirectory
  254.  
  255. #ifdef FtpCommand
  256. #undef FtpCommand
  257. #endif
  258. #define FtpCommand _afxWinINet.pfnFtpCommand
  259.  
  260. #ifdef FtpOpenFile
  261. #undef FtpOpenFile
  262. #endif
  263. #define FtpOpenFile _afxWinINet.pfnFtpOpenFile
  264.  
  265. // gopher
  266.  
  267. #ifdef GopherFindFirstFile
  268. #undef GopherFindFirstFile
  269. #endif
  270. #define GopherFindFirstFile _afxWinINet.pfnGopherFindFirstFile
  271.  
  272. #ifdef GopherOpenFile
  273. #undef GopherOpenFile
  274. #endif
  275. #define GopherOpenFile _afxWinINet.pfnGopherOpenFile
  276.  
  277. #ifdef GopherCreateLocator
  278. #undef GopherCreateLocator
  279. #endif
  280. #define GopherCreateLocator _afxWinINet.pfnGopherCreateLocator
  281.  
  282. #ifdef GopherGetAttribute
  283. #undef GopherGetAttribute
  284. #endif
  285. #define GopherGetAttribute _afxWinINet.pfnGopherGetAttribute
  286.  
  287. #ifdef GopherGetLocatorType
  288. #undef GopherGetLocatorType
  289. #endif
  290. #define GopherGetLocatorType _afxWinINet.pfnGopherGetLocatorType
  291.  
  292. // html
  293.  
  294. #ifdef HttpOpenRequest
  295. #undef HttpOpenRequest
  296. #endif
  297. #define HttpOpenRequest _afxWinINet.pfnHttpOpenRequest
  298.  
  299. #ifdef HttpAddRequestHeaders
  300. #undef HttpAddRequestHeaders
  301. #endif
  302. #define HttpAddRequestHeaders _afxWinINet.pfnHttpAddRequestHeaders
  303.  
  304. #ifdef HttpSendRequest
  305. #undef HttpSendRequest
  306. #endif
  307. #define HttpSendRequest _afxWinINet.pfnHttpSendRequest
  308.  
  309. #ifdef HttpQueryInfo
  310. #undef HttpQueryInfo
  311. #endif
  312. #define HttpQueryInfo _afxWinINet.pfnHttpQueryInfo
  313.  
  314. #ifdef InternetErrorDlg
  315. #undef InternetErrorDlg
  316. #endif
  317. #define InternetErrorDlg _afxWinINet.pfnInternetErrorDlg
  318.  
  319. #ifdef InternetCrackUrl
  320. #undef InternetCrackUrl
  321. #endif
  322. #define InternetCrackUrl _afxWinINet.pfnInternetCrackUrl
  323.  
  324. #ifdef InternetCanonicalizeUrl
  325. #undef InternetCanonicalizeUrl
  326. #endif
  327. #define InternetCanonicalizeUrl _afxWinINet.pfnInternetCanonicalizeUrl
  328.  
  329. #endif  //_AFXDLL
  330. #endif  //!_MAC
  331.