- 浏览: 449345 次
- 性别:
- 来自: 广州
最新评论
-
lhgyy00:
很好,回去好好研究下,3Q
博客资源与博客工具大全 -
ljl.java:
♦
你会遇到几段恋情?很准的哦~ -
ljl.java:
♦
你会遇到几段恋情?很准的哦~ -
jzzwy:
你这个red5是什么版本 Iterator<IConne ...
red5获取在线用户列表 -
81365341:
看着标题“red5配置详解”点进来的,结果没看到一句和配置有关 ...
red5配置详解
每个ActiveX Dll都应该有个DllGetClassObject函数,利用该函数就可以直接创建所需的com对象,而不需要通过注册表(或者注册),
STDAPI DllGetClassObject(
REFCLSID rclsid, //CLSID for the class object
REFIID riid, //Reference to the identifier of the interface
// that communicates with the class object
LPVOID * ppv //Address of output variable that receives the
// interface pointer requested in riid
);
这里必须知道两样东西,一个rclsid,就是需要创建的com对象的CLSID,另一个是 riid,该对象的一个接口的 id.
然而,调用DllGetClassObject,并不能直接创建所需要的对象,但可以得到对应的 IClassFactory,再由 IClassFactory.CreateInstance得到所需的对象.
vb实现代码大概如下:
需要用到一个库,http://www.mvps.org/emorcillo/download/vb6/tl_ole.zip
(引用页,http://www.mvps.org/emorcillo/en/code/vb6/wbframe.shtml)
另外,也将那个ActiveX Dll引用进工程,这里,并不是需要注册它,而是为了方便使用它的方法,因为并没有使用new来创建对象,
程序编译后即使不注册那个Dll文件都能够正常使用.
Option Explicit
'假设ActiveX Dll 的文件名为dllDemo.dll,并且处于工程同一目录
Private Declare Function DllGetClassObject Lib "dllDemo.dll" ( _
rclsid As UUID, riid As UUID, ByRef ppv As Any) As Long
'class id
Private Const ClsStr_Obj As String = "{C1A334BA-D1A4-48D0-98D5-47FE934961DF}"
'接口id
Private Const IidStr_Ins As String = "{231114D5-E046-4DAE-B192-0AB49D493A85}"
'IClassFactory id
Private Const strIID_IClassFactory As String = "{00000001-0000-0000-C000-000000000046}"
Private ClsId_Obj As UUID
Private Iid_Ins As UUID
Private iid_iunknow As UUID
Private iid_iclassfactory As UUID
Private Sub Command1_Click()
Dim tobj As olelib.IUnknown
Dim tobj2 As dllDemo.IDemo
Dim tFac As olelib.IClassFactory
Call DllGetClassObject(ClsId_Obj, iid_iclassfactory, tFac)
tFac.CreateInstance Nothing, iid_iunknow, tobj
Set tFac = Nothing
Set tobj2 = tobj
'调用IDemo.Test测试所创建的对象
tobj2.Test
End Sub
Private Sub Form_Load()
'将string转换为 UUID
CLSIDFromString ClsStr_Obj, ClsId_Obj
CLSIDFromString IidStr_Ins, Iid_Ins
CLSIDFromString IIDSTR_IUnknown, iid_iunknow
CLSIDFromString strIID_IClassFactory, iid_iclassfactory
End Sub
至此,问题似乎已经解决了,只要为不同的ActiveX Dll编写对应的DllGetClassObject函数就可以了,只是当文件名未定时就比较难办了,例如编写插件时.
解决办法是用LoadLibrary动态的调用各个dll上的DllGetClassObject.可惜的是vb不支持函数指针.我的办法是借助vc来解决.用vc写dll供vb调用,主要代码如下:
// CrCom.cpp : Defines the entry point for the DLL application.
//
#include "stdafx.h"
#include <unknwn.h>
#include <objbase.h>
typedef int (CALLBACK *MYPROC)(REFCLSID,REFIID,LPVOID *);
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}
// if(riid==NULL)riid=&IID_IUnknown
int _stdcall CrComObj(
LPCSTR lpDll,
CLSID *rclsid,
IID *riid,
LPVOID * ppv)
{
HINSTANCE hinstLib;
MYPROC ProcAdd;
BOOL fFreeResult, fRunTimeLinkSuccess = FALSE;
int rtn=0;
// Get a handle to the DLL module.
hinstLib = LoadLibrary(lpDll);
// If the handle is valid, try to get the function address.
if (hinstLib != NULL)
{
ProcAdd =(MYPROC)GetProcAddress(hinstLib, "DllGetClassObject");
// If the function address is valid, call the function.
if (fRunTimeLinkSuccess = (ProcAdd != NULL))
{
if(rclsid==NULL)
{
FreeLibrary(hinstLib);
return 0;
}
if(riid==NULL)
riid=(IID *)&IID_IUnknown;
IClassFactory *pIf;
pIf=NULL;
if(ProcAdd(*rclsid,IID_IClassFactory,(void **)&pIf)==S_OK && pIf!=NULL)
{
if(pIf->CreateInstance(NULL,*riid,ppv)==S_OK)
rtn=(int)hinstLib;
pIf->Release();
pIf=NULL;
}
}
// Free the DLL module.
if(!rtn)fFreeResult = FreeLibrary(hinstLib);
}
return rtn;
}
// if strriid==NULL, use IID_IUnknown;
int _stdcall CrComObj2(
LPCSTR lpDll,
LPCSTR strrclsid,
LPCSTR strriid,
LPVOID * ppv )
{
HINSTANCE hinstLib;
MYPROC ProcAdd;
BOOL fFreeResult, fRunTimeLinkSuccess = FALSE;
int rtn=0;
// Get a handle to the DLL module.
hinstLib = LoadLibrary(lpDll);
// If the handle is valid, try to get the function address.
if (hinstLib != NULL)
{
ProcAdd =(MYPROC)GetProcAddress(hinstLib, "DllGetClassObject");
// If the function address is valid, call the function.
if (fRunTimeLinkSuccess = (ProcAdd != NULL))
{
CLSID rclsid;
IID riid;
if(strrclsid==NULL)
{
FreeLibrary(hinstLib);
return 0;
}
CLSIDFromString((LPOLESTR )strrclsid,&rclsid);
if(strriid!=NULL)
CLSIDFromString((LPOLESTR )strriid,&riid);
else
riid=IID_IUnknown;
IClassFactory *pIf=NULL;
if(ProcAdd(rclsid,IID_IClassFactory,(void **)&pIf)==S_OK && pIf!=NULL)
{
if(pIf->CreateInstance(NULL,riid,ppv)==S_OK)
rtn=(int)hinstLib;
pIf->Release();
pIf=NULL;
}
}
// Free the DLL module.
if(!rtn)fFreeResult = FreeLibrary(hinstLib);
}
return rtn;
}
在vb中的使用方法,CrComObj传递的是UUID,CrComObj2传递的是String,
'函数声明
Private Declare Function CrComObj Lib "CrCom.dll" ( _
ByVal lpDll As String, ByVal rclsid As Long, ByVal riid As Long, ByRef ppv As Any) As Long
Private Declare Function CrComObj2 Lib "CrCom.dll" ( _
ByVal lpDll As String, ByVal strrclsid As Long, ByVal strriid As Long, ByRef ppv As Any) As Long
Dim tobj As olelib.IUnknown
Dim tobj2 As dllDemo.IDemo
hlib = CrComObj(App.Path & "\dllDemo.dll", VarPtr(ClsId_Obj), 0, tobj)
Set tobj2 = tobj
tobj2.Test
'或者
hlib=CrComObj2(App.Path & "\dllDemo.dll", StrPtr(ClsStr_Obj), 0, tobj)
Set tobj2 = tobj
tobj2.Test
CrComObj与CrComObj2返回的是LoadLibrary的返回值,必要的时候需要用FreeLibrary释放.
我的多页面浏览器LE中,也实现了不注册调用ActiveX Dll,我是直接使用了一本书(Advanced Visual Basic)的代码,代码颇长,似乎也挺复杂,原先使用的时候也不明所以然,后来终于搞清楚了,其原理是一样的,但是因为vb不支持函数指针,于是它花了很大力气去处理这个问题.相比而言,我觉得还是借用一下vc比较好,这样的话简捷的多.
那本书(Advanced Visual Basic)中让vb能够函数指针的方法不错,但是要添加类型库,还要自己创建轻量com对象显得颇为麻烦.我想,不如直接利用vb自己建对象算了.
代码如下:
'建一class,如下
'---------------------------------------------------------------------------------------
' Module : cFucPtr
' DateTime : 2008-12-23 0:49
' Author : hereson
' Email : hereson@163.com
' HomePage : http://sanbook.iteye.com
' Purpose :
'---------------------------------------------------------------------------------------
Option Explicit
'存储加载dll后获得的函数地址
Private m_NewFucPtr As Long
Public Function DllGetClassObject( _
ByRef rclsid As UUID, ByRef riid As UUID, ByRef ppv As IClassFactory) As Long
End Function
Public Sub SetFunctionPtr(newptr&)
m_NewFucPtr = newptr
End Sub
'再建一module
Option Explicit
Public Declare Function LoadLibrary Lib "kernel32.dll" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
Public Declare Function FreeLibrary Lib "kernel32.dll" (ByVal hLibModule As Long) As Long
Public Declare Function GetProcAddress Lib "kernel32.dll" (ByVal hModule As Long, ByVal lpProcName As String) As Long
Public Declare Sub CopyMemory Lib "kernel32.dll" Alias "RtlMoveMemory" (ByRef Destination As Any, ByRef Source As Any, ByVal Length As Long)
Public Type typAsm
code(1) As Long
End Type
Public asm As typAsm
'然后,初始化时,让asm为如下值,
asm.code(0) = &HFF515859
asm.code(1) = &H90003460
'这个是汇编代码,具体是
'pop ecx
'pop eax
'push ecx
'jmp DWORD PTR [eax + 52]
'这是抄回来的,具体原理我不太清楚,如下是原注释
'Here's the magic asm for doing the function pointer call.
'The stack comes in with the following:
'esp: return address
'esp + 4: this pointer for FunctionDelegator
'All that we need to do is remove the this pointer from the
'stack, replace it with the return address, then jmp to the
'correct function. In other words, we're just squeezing the
'this pointer completely out of the picture.
'The code is:
'pop ecx (stores return address)
'pop eax (gets the this pointer)
'push ecx (restores the return address)
'jmp DWORD PTR [eax + 4] (jump to address at this + 4, 3 byte instruction)
'The corresponding byte stream for this is: 59 58 51 FF 60 04
'We pad these six bytes with two int 3 commands (CC CC) to get eight
'bytes, which can be stored in a Currency constant.
'Note that the memory location of this constant is not executable, so
'it must be copied into a currency variable. The address of the variable
'is then used as the forwarding function.
'下面是调用代码:
Dim tadd As Long, vTab&
Dim tobj As cFucPtr
Dim tLib&
Dim tUn As olelib.IUnknown
Dim tDem As dllDemo.IDemo
Dim tFac As olelib.IClassFactory
Set tobj = New cFucPtr
'加载dll
tLib = LoadLibrary(App.Path & "\dllDemo.dll")
If tLib <> 0 Then
tadd = GetProcAddress(tLib, "DllGetClassObject")
End If
Dim asmadd&
If tadd <> 0 Then
'获取vtable地址
CopyMemory vTab, ByVal ObjPtr(tobj), 4
asmadd = VarPtr(asm)
'替换掉cFucPtr.DllGetClassObject地址
CopyMemory ByVal (vTab + (8 - 1) * 4), asmadd, 4
'设置函数地址
tobj.SetFunctionPtr tadd
tobj.DllGetClassObject ClsId_Obj, iid_iclassfactory, tFac
If Not tFac Is Nothing Then
tFac.CreateInstance Nothing, iid_iunknow, tUn
Set tFac = Nothing
Set tDem = tUn
Set tUn = Nothing
tDem.test
End If
End If
Set tDem = Nothing
If tLib <> 0 Then FreeLibrary tLib
'一定要在所有对象都释放掉了才能使用FreeLibrary,不然会出错
将上面的代码修改一下,就可以很方便的在vb中使用函数指针了,hoho,vb可以用函数指针咯,不写了.
STDAPI DllGetClassObject(
REFCLSID rclsid, //CLSID for the class object
REFIID riid, //Reference to the identifier of the interface
// that communicates with the class object
LPVOID * ppv //Address of output variable that receives the
// interface pointer requested in riid
);
这里必须知道两样东西,一个rclsid,就是需要创建的com对象的CLSID,另一个是 riid,该对象的一个接口的 id.
然而,调用DllGetClassObject,并不能直接创建所需要的对象,但可以得到对应的 IClassFactory,再由 IClassFactory.CreateInstance得到所需的对象.
vb实现代码大概如下:
需要用到一个库,http://www.mvps.org/emorcillo/download/vb6/tl_ole.zip
(引用页,http://www.mvps.org/emorcillo/en/code/vb6/wbframe.shtml)
另外,也将那个ActiveX Dll引用进工程,这里,并不是需要注册它,而是为了方便使用它的方法,因为并没有使用new来创建对象,
程序编译后即使不注册那个Dll文件都能够正常使用.
Option Explicit
'假设ActiveX Dll 的文件名为dllDemo.dll,并且处于工程同一目录
Private Declare Function DllGetClassObject Lib "dllDemo.dll" ( _
rclsid As UUID, riid As UUID, ByRef ppv As Any) As Long
'class id
Private Const ClsStr_Obj As String = "{C1A334BA-D1A4-48D0-98D5-47FE934961DF}"
'接口id
Private Const IidStr_Ins As String = "{231114D5-E046-4DAE-B192-0AB49D493A85}"
'IClassFactory id
Private Const strIID_IClassFactory As String = "{00000001-0000-0000-C000-000000000046}"
Private ClsId_Obj As UUID
Private Iid_Ins As UUID
Private iid_iunknow As UUID
Private iid_iclassfactory As UUID
Private Sub Command1_Click()
Dim tobj As olelib.IUnknown
Dim tobj2 As dllDemo.IDemo
Dim tFac As olelib.IClassFactory
Call DllGetClassObject(ClsId_Obj, iid_iclassfactory, tFac)
tFac.CreateInstance Nothing, iid_iunknow, tobj
Set tFac = Nothing
Set tobj2 = tobj
'调用IDemo.Test测试所创建的对象
tobj2.Test
End Sub
Private Sub Form_Load()
'将string转换为 UUID
CLSIDFromString ClsStr_Obj, ClsId_Obj
CLSIDFromString IidStr_Ins, Iid_Ins
CLSIDFromString IIDSTR_IUnknown, iid_iunknow
CLSIDFromString strIID_IClassFactory, iid_iclassfactory
End Sub
至此,问题似乎已经解决了,只要为不同的ActiveX Dll编写对应的DllGetClassObject函数就可以了,只是当文件名未定时就比较难办了,例如编写插件时.
解决办法是用LoadLibrary动态的调用各个dll上的DllGetClassObject.可惜的是vb不支持函数指针.我的办法是借助vc来解决.用vc写dll供vb调用,主要代码如下:
// CrCom.cpp : Defines the entry point for the DLL application.
//
#include "stdafx.h"
#include <unknwn.h>
#include <objbase.h>
typedef int (CALLBACK *MYPROC)(REFCLSID,REFIID,LPVOID *);
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}
// if(riid==NULL)riid=&IID_IUnknown
int _stdcall CrComObj(
LPCSTR lpDll,
CLSID *rclsid,
IID *riid,
LPVOID * ppv)
{
HINSTANCE hinstLib;
MYPROC ProcAdd;
BOOL fFreeResult, fRunTimeLinkSuccess = FALSE;
int rtn=0;
// Get a handle to the DLL module.
hinstLib = LoadLibrary(lpDll);
// If the handle is valid, try to get the function address.
if (hinstLib != NULL)
{
ProcAdd =(MYPROC)GetProcAddress(hinstLib, "DllGetClassObject");
// If the function address is valid, call the function.
if (fRunTimeLinkSuccess = (ProcAdd != NULL))
{
if(rclsid==NULL)
{
FreeLibrary(hinstLib);
return 0;
}
if(riid==NULL)
riid=(IID *)&IID_IUnknown;
IClassFactory *pIf;
pIf=NULL;
if(ProcAdd(*rclsid,IID_IClassFactory,(void **)&pIf)==S_OK && pIf!=NULL)
{
if(pIf->CreateInstance(NULL,*riid,ppv)==S_OK)
rtn=(int)hinstLib;
pIf->Release();
pIf=NULL;
}
}
// Free the DLL module.
if(!rtn)fFreeResult = FreeLibrary(hinstLib);
}
return rtn;
}
// if strriid==NULL, use IID_IUnknown;
int _stdcall CrComObj2(
LPCSTR lpDll,
LPCSTR strrclsid,
LPCSTR strriid,
LPVOID * ppv )
{
HINSTANCE hinstLib;
MYPROC ProcAdd;
BOOL fFreeResult, fRunTimeLinkSuccess = FALSE;
int rtn=0;
// Get a handle to the DLL module.
hinstLib = LoadLibrary(lpDll);
// If the handle is valid, try to get the function address.
if (hinstLib != NULL)
{
ProcAdd =(MYPROC)GetProcAddress(hinstLib, "DllGetClassObject");
// If the function address is valid, call the function.
if (fRunTimeLinkSuccess = (ProcAdd != NULL))
{
CLSID rclsid;
IID riid;
if(strrclsid==NULL)
{
FreeLibrary(hinstLib);
return 0;
}
CLSIDFromString((LPOLESTR )strrclsid,&rclsid);
if(strriid!=NULL)
CLSIDFromString((LPOLESTR )strriid,&riid);
else
riid=IID_IUnknown;
IClassFactory *pIf=NULL;
if(ProcAdd(rclsid,IID_IClassFactory,(void **)&pIf)==S_OK && pIf!=NULL)
{
if(pIf->CreateInstance(NULL,riid,ppv)==S_OK)
rtn=(int)hinstLib;
pIf->Release();
pIf=NULL;
}
}
// Free the DLL module.
if(!rtn)fFreeResult = FreeLibrary(hinstLib);
}
return rtn;
}
在vb中的使用方法,CrComObj传递的是UUID,CrComObj2传递的是String,
'函数声明
Private Declare Function CrComObj Lib "CrCom.dll" ( _
ByVal lpDll As String, ByVal rclsid As Long, ByVal riid As Long, ByRef ppv As Any) As Long
Private Declare Function CrComObj2 Lib "CrCom.dll" ( _
ByVal lpDll As String, ByVal strrclsid As Long, ByVal strriid As Long, ByRef ppv As Any) As Long
Dim tobj As olelib.IUnknown
Dim tobj2 As dllDemo.IDemo
hlib = CrComObj(App.Path & "\dllDemo.dll", VarPtr(ClsId_Obj), 0, tobj)
Set tobj2 = tobj
tobj2.Test
'或者
hlib=CrComObj2(App.Path & "\dllDemo.dll", StrPtr(ClsStr_Obj), 0, tobj)
Set tobj2 = tobj
tobj2.Test
CrComObj与CrComObj2返回的是LoadLibrary的返回值,必要的时候需要用FreeLibrary释放.
我的多页面浏览器LE中,也实现了不注册调用ActiveX Dll,我是直接使用了一本书(Advanced Visual Basic)的代码,代码颇长,似乎也挺复杂,原先使用的时候也不明所以然,后来终于搞清楚了,其原理是一样的,但是因为vb不支持函数指针,于是它花了很大力气去处理这个问题.相比而言,我觉得还是借用一下vc比较好,这样的话简捷的多.
那本书(Advanced Visual Basic)中让vb能够函数指针的方法不错,但是要添加类型库,还要自己创建轻量com对象显得颇为麻烦.我想,不如直接利用vb自己建对象算了.
代码如下:
'建一class,如下
'---------------------------------------------------------------------------------------
' Module : cFucPtr
' DateTime : 2008-12-23 0:49
' Author : hereson
' Email : hereson@163.com
' HomePage : http://sanbook.iteye.com
' Purpose :
'---------------------------------------------------------------------------------------
Option Explicit
'存储加载dll后获得的函数地址
Private m_NewFucPtr As Long
Public Function DllGetClassObject( _
ByRef rclsid As UUID, ByRef riid As UUID, ByRef ppv As IClassFactory) As Long
End Function
Public Sub SetFunctionPtr(newptr&)
m_NewFucPtr = newptr
End Sub
'再建一module
Option Explicit
Public Declare Function LoadLibrary Lib "kernel32.dll" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
Public Declare Function FreeLibrary Lib "kernel32.dll" (ByVal hLibModule As Long) As Long
Public Declare Function GetProcAddress Lib "kernel32.dll" (ByVal hModule As Long, ByVal lpProcName As String) As Long
Public Declare Sub CopyMemory Lib "kernel32.dll" Alias "RtlMoveMemory" (ByRef Destination As Any, ByRef Source As Any, ByVal Length As Long)
Public Type typAsm
code(1) As Long
End Type
Public asm As typAsm
'然后,初始化时,让asm为如下值,
asm.code(0) = &HFF515859
asm.code(1) = &H90003460
'这个是汇编代码,具体是
'pop ecx
'pop eax
'push ecx
'jmp DWORD PTR [eax + 52]
'这是抄回来的,具体原理我不太清楚,如下是原注释
'Here's the magic asm for doing the function pointer call.
'The stack comes in with the following:
'esp: return address
'esp + 4: this pointer for FunctionDelegator
'All that we need to do is remove the this pointer from the
'stack, replace it with the return address, then jmp to the
'correct function. In other words, we're just squeezing the
'this pointer completely out of the picture.
'The code is:
'pop ecx (stores return address)
'pop eax (gets the this pointer)
'push ecx (restores the return address)
'jmp DWORD PTR [eax + 4] (jump to address at this + 4, 3 byte instruction)
'The corresponding byte stream for this is: 59 58 51 FF 60 04
'We pad these six bytes with two int 3 commands (CC CC) to get eight
'bytes, which can be stored in a Currency constant.
'Note that the memory location of this constant is not executable, so
'it must be copied into a currency variable. The address of the variable
'is then used as the forwarding function.
'下面是调用代码:
Dim tadd As Long, vTab&
Dim tobj As cFucPtr
Dim tLib&
Dim tUn As olelib.IUnknown
Dim tDem As dllDemo.IDemo
Dim tFac As olelib.IClassFactory
Set tobj = New cFucPtr
'加载dll
tLib = LoadLibrary(App.Path & "\dllDemo.dll")
If tLib <> 0 Then
tadd = GetProcAddress(tLib, "DllGetClassObject")
End If
Dim asmadd&
If tadd <> 0 Then
'获取vtable地址
CopyMemory vTab, ByVal ObjPtr(tobj), 4
asmadd = VarPtr(asm)
'替换掉cFucPtr.DllGetClassObject地址
CopyMemory ByVal (vTab + (8 - 1) * 4), asmadd, 4
'设置函数地址
tobj.SetFunctionPtr tadd
tobj.DllGetClassObject ClsId_Obj, iid_iclassfactory, tFac
If Not tFac Is Nothing Then
tFac.CreateInstance Nothing, iid_iunknow, tUn
Set tFac = Nothing
Set tDem = tUn
Set tUn = Nothing
tDem.test
End If
End If
Set tDem = Nothing
If tLib <> 0 Then FreeLibrary tLib
'一定要在所有对象都释放掉了才能使用FreeLibrary,不然会出错
将上面的代码修改一下,就可以很方便的在vb中使用函数指针了,hoho,vb可以用函数指针咯,不写了.
发表评论
-
TEA算法的VB实现代码的使用说明
2008-12-30 11:28 1908自从公开了TEA算法的VB代码之后一直有人追问我如何调用这两个 ... -
TEA算法的VB实现代码
2008-12-30 11:02 1615前些日子不少人都要挂QQ,有客户需求就自然有人去研究,所以不少 ... -
QQ通讯协议
2008-12-30 10:56 4154协议说明: 协议由报文 ... -
hoxede的QQ填充算法和TEA 加解密的python实现
2008-12-30 10:31 2825""" The MIT Lic ... -
如何从 Visual Basic 中调用 GetNetworkParams / GetAdapter
2008-12-30 09:52 16571. 启动一个新的 Visual Basic 标准 EX ... -
VB调用GetAdaptersInfo 的正确方法
2008-12-30 09:51 2678网上的教程没有一个能在多网卡或多IP下用的,总是在 Cop ... -
VB做的EXE文件设参数
2008-12-29 12:26 1137这个其实很简单 在 Private Sub Form_L ... -
VB常用字符串函数
2008-12-29 12:26 14531. ASC(X),Chr(X):转换字 ... -
VB常用函数
2008-12-29 12:25 22591. Time 返回系统时钟的当前时间。 Date 返回 ... -
VB使用*.res资源文件
2008-12-29 12:23 1608你一定也常常因苦于无法组织自己程序中大量的picture,而头 ... -
在不同的模式下实现定时关闭计算机
2008-12-29 12:20 828Option Explicit Const SM_CLEANB ... -
强制关闭指定QQ号
2008-12-29 12:19 1281'添加 Text1 Command1 ... -
VB读取武林外传内存地址
2008-12-29 12:18 2078一 模块代码 复制内容到剪贴板 代码: Option Expl ... -
怎么编程把用户名,密码提交到网页上的登录页?
2008-12-29 12:06 1412首先在程序中加入Webbrowser控件并加入引用 Micro ... -
在XP/2K 任务管理器的进程列表中隐藏当前进程
2008-12-29 12:05 1212新建一个模块,把以下代码复制进去,然后在load中调用即可实现 ... -
用VB制作IE工具条自定义按钮
2008-12-29 12:04 1162Private Sub UserControl_Resize( ... -
Webbrowser(Internet 控件)属性方法事件一览表
2008-12-29 11:56 4746想找个Webbrowser控件的详细使用手册,网上找了好久,都 ... -
使用vbs下载文件
2008-12-29 11:52 1504使用vbs下载文件 iLocal=LCase(Wscript. ... -
如何用VB制作半透明窗体?
2008-12-29 11:51 1641函数SetLayeredWindowAttributes ... -
vb api 控制 任务栏 桌面 托盘。。
2008-12-29 11:45 2062VB无疑是最先进的编程 ...
相关推荐
通常情况下,ActiveX DLL需要注册后才能被调用,使用本方法,可以无需注册就能调用ActiveX DLL,非常方便。
VS2010 调用 VB6.0 activeX DLL源码 有四种调用方式 均通过验证, 同时附有VS2010成功引用VB6的说明
vs2008 环境下C++代码调用vb6.0生成的Activex dll。
如同书名一样,是用来介绍ACTIVEX控件动态调用DLL函数的方法,希望对大家有所帮助
JavaScript 调用 C++ 生成的 DLL,DLL 使用 ATL 封装的 ActiveX 控件,仅支持 IE 浏览器。 本资源为整套工程,编译 ATL_API 后,在Debug/Release目录下,使用 IE 打开TestJavaScript.html,点击“Add”按钮查看结果...
本例子中实现在c#中调用由vb生成的dll文件(com调用)例子由两个主要步骤组成:一 ...二 是在c#中引入步骤一中生成的dll,然后生成实例调用步骤一:首先在vb中新建一个ActiveX DLL 工程,然后在类模块文件中填入以下代
ActiveX控件加载外部dll及html测试Demo 用VC2010编写,自已测试成功 Test.html为测试ActiveX控件页面 TestDll是dll动态库 Loaddll是测试TestDll的Demo FROMYANTAI为ActiveX控件,加载外部库TestDll,使用VC STL项目
VB.NET调用VB6 Activex EXE实现PowerBasic和FreeBasic的标准DLL调用,x64和x86编译输出均可运行,因为 Activex EXE是外置32位进程。
java调用DLL、activex框架,非常实用,可以自动生成代码
php调用activeX dll dll用vb做,可以加密代码
火狐调用dll文件需要的activex控件和插件。亲测完全满足要求。
VC 在ActiveX中动态调用外部DLL函数,演示如何在ActiveX控件中动态调用来自外部的DLL函数,虽然不常用,研究学习一下也不多余哦,里面有两个调用DLL的例子。
JavaScript 调用 C++ 生成的 DLL,DLL 使用 ATL 封装的 ActiveX 控件,仅支持 IE 浏览器。 本文档是对工程实现时的每一个步骤进行描述,大量截图,非常详细。 完整工程代码路径:...
最近在研究nodejs和node-webkit,需要在node-webkit应用中调用dll ,折腾了好久,遇到不少麻烦,国内没怎么介绍具体方法,就将这几天的研究成果说明下,希望对后来人有用。 说明:本文档主要说明如何通过nodejs中的...
PfcUtils ActiveX DLL控件 向VB和VBA应用程序添加基本剖析器(Parse),秒表,状态框,定时消息框和计时器等功能。 <br> PfcUtils ActiveX DLL控件的关键特点: 剖析对象提供简单的界面来快速分析程序,...
A simple way to call a VB ActiveX DLL from a VC/MFC Client在VC客户端调用vb的dll
DLL调用OCX(activex)的例子, 代码都是DEBUG编译的, 内容包括OCX, DLL, EXE文件。 OCX制作方法就不说了, 说下关键点就是OCX必需要重载一下IsInvokeAllowed函数,,让它直接返回true,否则将不成功,被告之是灾难性...
WEB页面通过ActiveX控件调用DLL动态库系列教程全部例程(vs2013)可用,配合教程。教程共分为四个小节,快速掌握DLL,C++静态/动态调用DLL,ActiveX静态/动态调用DLL。
VB调用VC编写的DLL.一般来说,VB和VC共同编程有3种方式:一种是VC生成DLL,在VB中调用DLL;一种是VC生成ActiveX控件(.ocx),在VB中插入;还有一种是在VC中生成ActiveX Automation服务器
在ActiveX控件中如何动态调用DLL函数