用vc6写了个Activex视频本机ie可以打开,其他机器ie上无法显示,大包成cab也不能解决,
把.cab文件解压后可以在其他机器上手动注册
;inf file for stream.dll
[Version]
Signature="$CHICAGO$"
AdvancedINF=1.0
[Add.Code]
VideoClt.ocx=VideoClt.ocx
msvcp71.dll=msvcp71.dll
Msvcr71.dll=Msvcr71.dll
msvcrt.dll=msvcrt.dll
mfc42.dll=mfc42.dll
HikPlayM4.dll=HikPlayM4.dll
client.dll.dll=client.dll;needed DLL
[msvcp71.dll]
file-win32-x86=thiscab
FileVersion=7.10.3077.0
DestDir=11[msvcrt.dll]
file-win32-x86=thiscab
FileVersion=7.0.2600.2180
DestDir=11[msvcr71.dll]
file-win32-x86=thiscab
FileVersion=7.10.3052.4
DestDir=11
[mfc42.dll]
file-win32-x86=thiscab
FileVersion=6.2.4131.0
DestDir=11[HikPlayM4.dll]
file-win32-x86=thiscab
DestDir=11
[client.dll]
file-win32-x86=thiscab
DestDir=11;hello dll
[VideoClt.ocx]
file-win32-x86=thiscab
clsid={80698D8E-9B0A-424A-AD5E-D9EB77BD642F}
FileVersin=1.0.0.1
DestDir=11
RegisterServer=yes;end of INF file
把.cab文件解压后可以在其他机器上手动注册
;inf file for stream.dll
[Version]
Signature="$CHICAGO$"
AdvancedINF=1.0
[Add.Code]
VideoClt.ocx=VideoClt.ocx
msvcp71.dll=msvcp71.dll
Msvcr71.dll=Msvcr71.dll
msvcrt.dll=msvcrt.dll
mfc42.dll=mfc42.dll
HikPlayM4.dll=HikPlayM4.dll
client.dll.dll=client.dll;needed DLL
[msvcp71.dll]
file-win32-x86=thiscab
FileVersion=7.10.3077.0
DestDir=11[msvcrt.dll]
file-win32-x86=thiscab
FileVersion=7.0.2600.2180
DestDir=11[msvcr71.dll]
file-win32-x86=thiscab
FileVersion=7.10.3052.4
DestDir=11
[mfc42.dll]
file-win32-x86=thiscab
FileVersion=6.2.4131.0
DestDir=11[HikPlayM4.dll]
file-win32-x86=thiscab
DestDir=11
[client.dll]
file-win32-x86=thiscab
DestDir=11;hello dll
[VideoClt.ocx]
file-win32-x86=thiscab
clsid={80698D8E-9B0A-424A-AD5E-D9EB77BD642F}
FileVersin=1.0.0.1
DestDir=11
RegisterServer=yes;end of INF file
解决方案 »
- m_wndSplitter,2行1列,分割线距离状态栏60px。怎样,无论主窗口怎样改变大小,都能令分割线保持在距离状态栏60px处?
- 串口通讯问题。。急!
- 请教关于 CListView 的排序问题。
- 文件读取的问题
- 小问题
- 三阶次样条如何转化成三次贝塞尔曲线?
- 如果考研vc需要掌握到什么水平
- 如何实现组播?用mfc或者c都可以,需要在操作系统做什么设置吗?
- 抢分了!
- 关于使用IDispatch的奇怪的问题,可能你不曾遇到过
- 求购<<directinput原理与api参考>>这本书,纸书好像没见有卖的了,谁有电子版传我,可以付费,有的或知道的帮个忙吧。(详细见帖内)
- 寻找重庆主城区.NET和(VC或DELPHI)兼职程序员
strsafe.h在哪里区找
#include "objsafe.h"
#include "strsafe.h"后Error 1 error C2373: 'CATID_SafeForScripting' : redefinition; different type modifiers e:\StreamClientOcx\StreamClientOcx.cpp 17 Error 2 error C2373: 'CATID_SafeForInitializing' : redefinition; different type modifiers e:\StreamClientOcx\StreamClientOcx.cpp 19 报错的就是下面这两行
const CATID CATID_SafeForScripting =
{0x7dd95801,0x9882,0x11cf,{0x9f,0xa9,0x00,0xaa,0x00,0x6c,0x42,0xc4}};
const CATID CATID_SafeForInitializing =
{0x7dd95802,0x9882,0x11cf,{0x9f,0xa9,0x00,0xaa,0x00,0x6c,0x42,0xc4}};
/打包的.inf
;inf file for stream.dll
[Version]
Signature="$CHICAGO$"
AdvancedINF=1.0
[Add.Code]
ClientVideo.ocx=ClientVideo.ocx
msvcp60.dll=msvcp60.dll
msvcp71.dll=msvcp71.dll
Msvcr71.dll=Msvcr71.dll
msvcr80.dll=msvcr80.dll
msvcrt.dll=msvcrt.dll
mfc42u.dll=mfc42u.dll
mfc80u.dll=mfc80u.dll
HikPlayM4.dll=HikPlayM4.dll
client.dll.dll=client.dll;needed DLL
[msvcp60.dll]
file-win32-x86=thiscab
FileVersion=6,2,3104,0
RegisterServer=yes
DestDir=10[msvcp71.dll]
file-win32-x86=thiscab
FileVersion=7,10,3077,0
RegisterServer=yes
DestDir=10[msvcr71.dll]
file-win32-x86=thiscab
FileVersion=7,10,3052.4
RegisterServer=yes
DestDir=10[msvcr80.dll]
file-win32-x86=thiscab
FileVersion=8,0,50727,42
RegisterServer=yes
DestDir=10[msvcrt.dll]
file-win32-x86=thiscab
FileVersion=7,0,2600,2180
RegisterServer=yes
DestDir=10
[mfc42u.dll]
file-win32-x86=thiscab
FileVersion=6,2,8071,0
RegisterServer=yes
DestDir=10[mfc80u.dll]
file-win32-x86=thiscab
FileVersion=8,0,50727,42
RegisterServer=yes
DestDir=10
[HikPlayM4.dll]
file-win32-x86=thiscab
DestDir=10
[client.dll]
file-win32-x86=thiscab
DestDir=10;ClientVideo dll
[ClientVideo.ocx]
file-win32-x86=thiscab
clsid={CC18815D-5A52-47D3-9930-581A956CAB63}
FileVersin=1,0,0,1
RegisterServer=yes;end of INF file
2.我增加了安全接口后,然后打包成*.cab,如果在别的机器上解包后手动注册
(regsvr32 xxxxx\xxx\ClientVideo.ocx)IE里面就可以访问了。但是没有安装
.netsdk的机器则出不来,不知是哪个文件没有找到。
但ClientVideo.ocx当IE提示下载时,点确定后,还是无法呈现出来。
#include "ClientVideo.h"
#include "strsafe.h"
#include "comcat.h"
#include "objsafe.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
CClientVideoApp theApp;const GUID CDECL BASED_CODE _tlid =
{ 0x72134F49, 0x3E4B, 0x4087, { 0x99, 0xA7, 0xE2, 0xB3, 0x80, 0x1C, 0xDC, 0x3F } };
const WORD _wVerMajor = 1;
const WORD _wVerMinor = 0;/*
const CATID CLSID_SafeItem =
{ 0xcc18815d, 0x5a52, 0x47d3, 0x99, 0x30, 0x58, 0x1a, 0x95, 0x6c, 0xab, 0x63}; HRESULT CreateComponentCategory(CATID catid, WCHAR *catDescription)
{
ICatRegister *pcr = NULL ;
HRESULT hr = S_OK ;
hr = CoCreateInstance(CLSID_StdComponentCategoriesMgr,
NULL, CLSCTX_INPROC_SERVER, IID_ICatRegister, (void**)&pcr);
if (FAILED(hr))
return hr;
// Make sure the HKCR\Component Categories\{..catid...}
// key is registered.
CATEGORYINFO catinfo;
catinfo.catid = catid;
catinfo.lcid = 0x0409 ; // english
size_t len;
// Make sure the provided description is not too long.
// Only copy the first 127 characters if it is.
// The second parameter of StringCchLength is the maximum
// number of characters that may be read into catDescription.
// There must be room for a NULL-terminator. The third parameter
// contains the number of characters excluding the NULL-terminator.
hr = StringCchLength(catDescription, STRSAFE_MAX_CCH, &len);
if (SUCCEEDED(hr))
{
if (len>127)
{
len = 127;
}
}
else
{
// TODO: Write an error handler;
}
// The second parameter of StringCchCopy is 128 because you need
// room for a NULL-terminator.
hr = StringCchCopy(catinfo.szDescription, len + 1, catDescription);
// Make sure the description is null terminated.
catinfo.szDescription[len + 1] = '\0';
hr = pcr->RegisterCategories(1, &catinfo);
pcr->Release();
return hr;
}
HRESULT RegisterCLSIDInCategory(REFCLSID clsid, CATID catid)
{
// Register your component categories information.
ICatRegister *pcr = NULL ;
HRESULT hr = S_OK ;
hr = CoCreateInstance(CLSID_StdComponentCategoriesMgr,
NULL, CLSCTX_INPROC_SERVER, IID_ICatRegister, (void**)&pcr);
if (SUCCEEDED(hr))
{
// Register this category as being "implemented" by the class.
CATID rgcatid[1] ;
rgcatid[0] = catid;
hr = pcr->RegisterClassImplCategories(clsid, 1, rgcatid);
}
if (pcr != NULL)
pcr->Release();
return hr;
}
HRESULT UnRegisterCLSIDInCategory(REFCLSID clsid, CATID catid)
{
ICatRegister *pcr = NULL ;
HRESULT hr = S_OK ;
hr = CoCreateInstance(CLSID_StdComponentCategoriesMgr,
NULL, CLSCTX_INPROC_SERVER, IID_ICatRegister, (void**)&pcr);
if (SUCCEEDED(hr))
{
// Unregister this category as being "implemented" by the class.
CATID rgcatid[1] ;
rgcatid[0] = catid;
hr = pcr->UnRegisterClassImplCategories(clsid, 1, rgcatid);
}
if (pcr != NULL)
pcr->Release();
return hr;
} */ // CClientVideoApp::InitInstance - DLL initializationBOOL CClientVideoApp::InitInstance()
{
BOOL bInit = COleControlModule::InitInstance(); if (bInit)
{
// TODO: Add your own module initialization code here.
} return bInit;
}// CClientVideoApp::ExitInstance - DLL terminationint CClientVideoApp::ExitInstance()
{
// TODO: Add your own module termination code here. return COleControlModule::ExitInstance();
}// DllRegisterServer - Adds entries to the system registrySTDAPI DllRegisterServer(void)
{
//HRESULT hr; // HResult used by Safety Functions
AFX_MANAGE_STATE(_afxModuleAddrThis); if (!AfxOleRegisterTypeLib(AfxGetInstanceHandle(), _tlid))
return ResultFromScode(SELFREG_E_TYPELIB); if (!COleObjectFactoryEx::UpdateRegistryAll(TRUE))
return ResultFromScode(SELFREG_E_CLASS);// Mark the control as safe for initializing.
/*
hr = CreateComponentCategory(CATID_SafeForInitializing,
L"Controls safely initializable from persistent data!");
if (FAILED(hr))
return hr;
hr = RegisterCLSIDInCategory(CLSID_SafeItem,
CATID_SafeForInitializing);
if (FAILED(hr))
return hr;
// Mark the control as safe for scripting.
hr = CreateComponentCategory(CATID_SafeForScripting,
L"Controls safely scriptable!");
if (FAILED(hr))
return hr;
hr = RegisterCLSIDInCategory(CLSID_SafeItem,
CATID_SafeForScripting);
if (FAILED(hr))
return hr;
*/ return NOERROR;
}// DllUnregisterServer - Removes entries from the system registrySTDAPI DllUnregisterServer(void)
{
//HRESULT hr; // HResult used by Safety Functions
AFX_MANAGE_STATE(_afxModuleAddrThis); if (!AfxOleUnregisterTypeLib(_tlid, _wVerMajor, _wVerMinor))
return ResultFromScode(SELFREG_E_TYPELIB); if (!COleObjectFactoryEx::UpdateRegistryAll(FALSE))
return ResultFromScode(SELFREG_E_CLASS); /*// Remove entries from the registry.
hr=UnRegisterCLSIDInCategory(CLSID_SafeItem,
CATID_SafeForInitializing);
if (FAILED(hr))
return hr;
hr=UnRegisterCLSIDInCategory(CLSID_SafeItem,
CATID_SafeForScripting);
if (FAILED(hr))
return hr;
*/
return NOERROR;
}
1.ocx需要数字签名?
2.ocx中需要的.dll文件也需要数字签名?
打包后.cab也需要数字签名