由于,之前从没用过,InstallShield打包,还请说明详细步骤,
时间紧迫,在线等!

解决方案 »

  1.   

    以下内容为CMSComm注册相关的Q/A
    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. HaringDr. 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.
      

  2.   

    以下内容讲述了如何配置VS提供的控件
    Redistributing Visual C++ ActiveX Controls
    Visual C++ 6.0 supplies ActiveX controls you can use in applications that you then redistribute. For a list of the redistributable Visual C++-supplied ActiveX controls, see Common\Redist\Redist.txt on Disc 1 of the Visual C++ 6.0 product CDs; any .ocx files in the Os\System folder are redistributable. When you are in the Visual C++ Components and Controls Gallery, highlighting a control will display its .ocx file.When distributing applications, you must install and register (using Regsvr32.exe) the .ocx for the ActiveX control. In addition, you should make sure the target computer has current versions of the following system files (an asterisk indicates the file needs to be registered): Oleaut32.dll *
    Olepro32.dll *
    Stdole2.tlb
    Asycfilt.dll
    Comcat.dll * 
    You can run Vbrun60.exe to update the target computer with the Visual Studio 6.0 versions of these system files. To get the version of Vbrun60.exe with the most up-to-date files for Visual Studio 6.0, see http://msdn.microsoft.com/support/ and search for Vbrun60.exe from the downloadable files. Be aware that when you run Vbrun60.exe, Msvbvm60.dll is also installed and registered. However, this file is not required to run Visual C++ applications; you can unregister and delete it. Further, if you are going to run Dcom98 (discussed next), you will get updated system files and do not need to also run Vbrun60.exe.If your application uses one of the ActiveX controls that connects to a database: You need to run DCom98.exe on any Windows 95 or Windows 98 computer. DCom98.exe is in the Dcom98 folder located on Disc 1 of the Visual C++ 6.0 product CDs.
    You should run Mdac_typ.exe on the target computer to install the Microsoft Data Access SDK. Mdac_typ.exe is in the Mdac2 folder of Disc 2 of the Visual C++ products CDs (Enterprise Edition only). You can also download Mdac_typ.exe from the Universal Data Access Web site at www.microsoft.com/data/. 
    When using an ActiveX control that connects to a database, you will also need to replicate the data source name on the target computer. You can do this programmatically with functions such as ConfigDSN.Some redistributable ActiveX controls have additional dependencies. For each .ocx file in the Visual C++ Os\System folder, there is also a .dep file. For each .ocx file that you want to redistribute, look for one or more USES entries in the corresponding .dep file. If a file is listed that is not included in Vbrun60.exe, you must ensure the file will be on the target computer. Any DLLs directly supporting an .ocx file need to be registered. (For Regsvr32.exe to succeed, the target computer must first contain all the DLLs the control statically loads.) Further, if a DLL that is listed as a dependency also has a .dep file in the Os\System folder, you must also investigate that .dep file for USES entries.Visual Studio Licensed Controls: Visual Studio licensees can redistribute the additional ActiveX controls specific to Visual Studio's other development tools. For example, the Chart control is distributed with Visual Basic, which also ships in Visual Studio. Thus, if you are using Visual C++ as a part of a Visual Studio license, you can redistribute the Chart control. However, if you purchased only Visual C++, you will not have a license to redistribute it.