这些类型来自FastCGI Dll Library (with SIGTERM handler) for Windows Web Servers的演示并且用PowerBASIC编写。我试图将它们转换为VB6(也发现了如何call a CDECL DLL from VB6)。如何将PowerBASIC类型转换为VB6类型?
' Structures
TYPE FCGX_STREAM
pData AS DWORD ' Pointer to the first byte of data
LenStored AS DWORD ' Bytes Total data stored - up to 4.2GB
Capacity AS DWORD ' Bytes Total available - up to 4.2GB
CurPos AS DWORD ' Current Position within the buffer of the next byte to read, as an offset from pData
Reserved AS STRING*12 ' Opaque Variables
END TYPE ' 28 bytes
TYPE FCGX_REQUEST
Version AS LONG ' Dll Version Number * 1000 = %FCGI_VERSION
ReqCount AS LONG ' Request Counter
Role AS LONG ' FastCGI Role
ConnFlags AS LONG ' Connection flags - zero = application closes connection after responding
ReqMethod AS LONG ' Request HTTP Method - Code 1 - 8
ContLen AS LONG ' CONTENT_LENGTH - Length of POST data sent (in the pInStream Data String)
pzQuery AS ASCIIZ PTR ' Pointer to ASCIIZ (Null Terminated) QUERY_STRING (Values Only) - Always a valid pointer
nParam AS LONG ' Number of Request Params in the array
envp AS DWORD PTR ' Pointer to Array of Request Parameters
pIn AS FCGX_STREAM PTR ' Pointer to a String Builder object
pOut AS FCGX_STREAM PTR ' Pointer to a String Builder object
pErr AS FCGX_STREAM PTR ' Pointer to a String Builder object
pzLastErr AS ASCIIZ PTR ' Pointer to ASCIIZ String containing Last Error description
Reserved AS STRING*108 ' Opaque Variables
END TYPE ' 160 bytes
我的问题是在理解如何在存储ASCIIZ PTR
,FCGX_STREAM PTR
和DWORD PTR
项目的信息获取。
您可以发布PowerBasic示例之一的链接吗?我找不到一个。 – 2009-07-21 16:13:05
请注意,超级大师Matt Curland的书“高级Visual Basic 6”还包含一种从VB6调用CDECL DLL的方法。 – MarkJ 2009-07-31 11:43:49