在vc中怎么发布(或者说注册)微软自带用vc写的MSMask32.ocx阿?急死了...

tongdings 2004-07-01 10:33:54
如题.
...全文
109 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
tongdings 2004-07-02
  • 打赏
  • 举报
回复
to jiangsheng(蒋晟.MSMVP2004Jan) ,
3x a lot.
tongdings 2004-07-01
  • 打赏
  • 举报
回复
纠正:MsMask32.ocx是微软用vb实现的.
蒋晟 2004-07-01
  • 打赏
  • 举报
回复
Registering Without a License
Dear Dr. GUI,
After registering mscomm32.ocx with regsvr32 on a machine that does not have Visual C++ installed, I still have problems using it. If Visual C++ has been installed, no problems arise. Of course I want my application working on a machine without Visual C++ installed.

In the following code, the Create function returns a value of 0, which means that no OLE control has been created.

CMSComm pComm;
pComm->Create(NULL, WS_VISIBLE, CRect(0,0,0,0), pWnd, nIDC );

The Create function is declared in mscomm.h, which calls (and returns the result of) the function CreateControl.

Do you know what I might have forgotten?

M. Haring

Dr. GUI replies:
Dr. GUI thinks he has a pretty good idea.

The mscomm32.ocx you mention is a licensed control. On a developer machine, creating it works because a design-time license was installed on the machine when you installed Microsoft Visual Studio®. On a non-developer machine, only a run-time license can be used. The Microsoft Knowledge Base article Q151771: "SAMPLE: LICREQST.EXE Requesting a License Key from an Object" (http://support.microsoft.com/support/kb/articles/q151/7/71.asp) tells what your program needs to do to create licensed controls on non-developer machines dynamically.

Basically, the process is to query the control for its license string, and then copy the license string to the Clipboard in a format you can paste into your C++ program. DO NOT use this technique to violate any software licenses—but you can use it for mscomm32.ocx. (There should be no need to do this for controls you've legitimately licensed for redistribution—the vendor should supply you with the license key.)

You can also place the licensed control on a dialog resource and get it to work. By doing so, the license key is placed into the dialog resource and the control will be created with the license information automatically. The MFC framework has the necessary code to create licensed controls in this case.

Just to double-check, you might also try running Depends.exe or Dumpbin.exe on the .ocx and the .dll files needed to support the application on a development machine and compare the versions of the resultant DLLs to those of your target machine (http://msdn.microsoft.com/library/techart/redistribvc6.htm#redistribvc6_topic3). Actually, read the whole article—it tells you all sorts of things you need to know to successfully distribute Microsoft ActiveX® controls.

3,245

社区成员

发帖
与我相关
我的任务
社区描述
ATL,Active Template Library活动(动态)模板库,是一种微软程序库,支持利用C++语言编写ASP代码以及其它ActiveX程序。
社区管理员
  • ATL/ActiveX/COM社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧