{
char buff[1024*20+1]
typedef int (WINAPI ICEPUB_OPENURL)(char *currentUrlString,char *strHtmlText,int textMaxLen,char *strProxy)
ICEPUB_OPENURL *icePub_openUrl = 0
HINSTANCE hDLLDrv = LoadLibrary("icePubDll.dll")
if(hDLLDrv)
{
icePub_openUrl =(ICEPUB_OPENURL *)GetProcAddress(hDLLDrv,"icePub_openUrl")
}
if(icePub_openUrl)
{
icePub_openUrl(Url,buff,1024*20,"")
}
if(hDLLDrv)
FreeLibrary(hDLLDrv)
//AfxMessageBox(buff)
}
帮你加上注释吧,晕倒... On Error Resume Next '发生错误时继续下一步Inet1.AccessType = 2 '访问类型Inet1.RequestTimeout = 60 '请求超时
Inet1.Proxy = "HTTP=" &"59.74.42.152" &":" &"8080" '代理
Inet1.OpenURL (" http://www.baidu.com/") '打开的网址
MsgBox Val(Mid(Trim(Inet1.GetHeader), 10, 3))
If Err Then
If Err.Number = 35756 Then MsgBox "代理不可用"
MsgBox Err.Number &":" &Err.Description
End If
End Sub
3.60 icePub_openUrll 函数原型:
int WINAPI icePub_openUrl(char *currentUrlString,char *strHtmlText,int textMaxLen,char *strProxy)
输入:currentUrlString http地址
textMaxLen strHtmlText的最大长度
strProxy 代理服务器地址
输出:strHtmlText 返回的页面代码
l VC连接Lib方式声明
__declspec(dllexport)
int WINAPI icePub_openUrl(char *currentUrlString,char *strHtmlText,int textMaxLen,char *strProxy)
l 动态调用例程
VC sample代码:
char buff[1024*20+1]
typedef int (WINAPI ICEPUB_OPENURL)(char *currentUrlString,char *strHtmlText,int textMaxLen,char *strProxy)
ICEPUB_OPENURL *icePub_openUrl = 0
HINSTANCE hDLLDrv = LoadLibrary("icePubDll.dll")
if(hDLLDrv)
{
icePub_openUrl =(ICEPUB_OPENURL *)GetProcAddress(hDLLDrv,"icePub_openUrl")
}
if(icePub_openUrl)
{
icePub_openUrl("http://www.baidu.com",buff,1024*20,"")
}
if(hDLLDrv)
FreeLibrary(hDLLDrv)
AfxMessageBox(buff)
VB sample 代码:
Private Declare Function icePub_openUrl Lib "icePubDll.dll" (ByVal currentUrlString As String, ByVal strHtmlText As String, ByVal TextMaxLen As Integer) As Integer
Dim a2 As Integer
a2=icePub_openUrl("http://www.baidu.com",buff,1024*20,"")
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)