vb Code
在CreateObject调用之前,先调用CreateObjectEx函数
下面实现,这样可以知道我们的Class参数是否能创建成功!!!
Type CLSID
Data1 as long
Data2 as Integer
Data3 as Integer
Data(7) as byte
end Type
public declare Function CLSIDFromProgID lib "Ole32.dll" (Byval lpszProgID as long,pClsid as CLSID) as long
public Function CreateObjectEx(Class as string) as object
'--注意最好写上
on error goto ErrHandler
dim myclsid as CLSID
dim lngRet as long
dim Obj
lngRet = CLSIDFromProgID (strptr(Class), myclid)
debug.print Hex(myclid.Data1)
debug.print Hex(myclid.Data2)
debug.print Hex(myclid.Data3)
debug.print Hex(myclid.Data(0)) & Hex(myclid.Data(1)) & Hex(myclid.Data(2)) & Hex(myclid.Data(3)