ShComboBox ActiveX Control How-To GuideCategoriesSearch for a topic in the following categories.. Installation *In this guide the terms folder, file, ComboBoxItem and item are used interchangeably. InstallationHow can my development project start using a new version of the control ? 1. Delete and reinsert the control on the form(and give the reinserted control the original name, so that your code continues to work). How can I register ShComboBox ActiveX Control on my system? Before any ActiveX control can be used, proper information about the control must be entered in the system registry. This process is called as 'registering' the control. Normally ShComboBox ActiveX Control is automatically registered on your system, when you install it. If you need to register the control again, for example if it gets unregistered for some reason and it is not visible in the 'Insert ActiveX Control' dialog box, then you can just reinstall the control again. Alternatively you can quickly register the control by dragging and dropping the shcmb70.ocx file on the regsvr32.exe file that is present in the Windows System directory. Deployment and distributionWhat are the procedures for distributing ShComboBox ActiveX Control with my application? An application which uses ShComboBox ActiveX Control should distribute the file shcmb70.ocx along with the dependencies listed above. No other information or files is necessary for distribution. The developer should make sure that the control is registered in the system registry on the end-users' machines. Registration of the control is done automatically by many installation builders during installation of your program, or you can do the registration yourself during the installation of your program. The redistributable file regsvr32.exe can be used for control registration. This registration is required for every ActiveX control to run on a machine. Note that the above registration is different from 'registering the control', that is entering the registration codes ( username and code ) after you have purchased the control. This registration should only be done on the developers' machines after you have purchased the licenses for the control. Under no circumstances should the developer make available to the end-user or their systems, the sensitive registration and licensing information ( username and codes ) either explicitly or implicitly. Please read the License Agreement for further information. The ShComboBox ActiveX Control handles registration and licensing by embedding the developer's license information in the application. When this application is run, this information is automatically retrieved and verified if the control is licensed. The end-users of my program get one of the following error messages when they run the program : This problem can occur if your program uses ShComboBox v4.3 or earlier, because all these versions of ShComboBox had the same GUID and a filename of shcmbbox.ocx. The problem occurs because the different versions of ShComboBox are not binary compatible with each other. Your program might be compiled with one version of FileView and the end-user might have a different version. This can happen if the end-user installs another program which uses a different versions of ShComboBox. In this case, the version of ShComboBox that comes with the other program will replace the one that your program uses. Till version 4.3, all versions of ShComboBox had the same GUID and a filename of shcmbbox.ocx. However, starting with version 5.0, each version has a different GUID and filename ( e.g. v5.0 has a filename of shcmb50.ocx ). This ensures that multiple versions of ShComboBox can coexist on the same machine. Therefore, if your program uses ShComboBox v5.0 or above, then you wont have this problem. However, if your program uses earlier versions, then the only way to solve the problem on the end-user's machine is to make sure that his machine has only one version of ShComboBox installed and that version is the same version that your program uses. To ensure that the end-user has the correct version he should search all his hard disks for shcmbbox.ocx and shcmb*.ocx and unregister ( using regsvr32.exe ) and remove all such instances. Then he should reinstall your program. Licensing and registrationHow can I enter license information in the ShComboBox ActiveX Control after I have purchased a license? After you have purchased the ShComboBox ActiveX Control, you will receive a username and registration codes for the control. To register the control, follow these steps..
After the above steps are performed, there are still a few more steps that must be done before the control can use the registration information correctly and stop showing the About box. These steps are different for different development environments as described below :
Usage in web developmentHow can I use ShComboBox ActiveX Control on an HTML or ASP page? Beginning with version 4.3 the developer must use the LPKTool to use the control on an HTML or ASP page as described below (Before running the LPKTool the control must already be properly licensed on the developer's machine) :
To have Internet Explorer automatically download the shcmb70.ocx file on a target computer which doesn't have the file installed, you must package the shcmb70.ocx file in a cab file and specify the cab file in the CODEBASE attribute of the shcombobox object tag as shown below : <OBJECT To make a CAB file for shcmb70.ocx, you will need the Cabinet SDK (downloadable from http://download.microsoft.com/download/platformsdk/cab/2.0/w98nt42kmexp/en-us/Cabsdk.exe ) After you have installed the Cabinet SDK, run the cabarc.exe tool that comes with it as follows : cabarc.exe n shcmbbox.cab shcmb70.ocx The above command line creates a new cabinet file named shcmbbox.cab and adds shcmb70.ocx to it. How can I use the ShComboBox ActiveX Controls with the FileView and FolderView ActiveX Controls? Linking the three controls involves only two simple lines of code : Consider a form or a dialog box where you have a ShComboBox Control named shCmbBox, FolderView Control named fldrVw and a FileView Control named fileVw. Visual Basic shCmbBox.FolderView = fldrvVw Visual C++ shCmbBox.SetFolderView((IDispatch*)fldrVw.GetControlUnknown()); fldrVw.SetFileView((IDispatch*)fileVw.GetControlUnknown()); Borland Delphi shCmbBox.FolderView:=fldrvw.ControlInterface ; Borland C++ Builder shCmbBox->FolderView = fldrVw->ControlInterface; Microsoft Access shCmbBox.FolderView = fldrVw.Object
Using ShComboBox with FileView only Using ShComboBox with FileView requires just one line of code on your part. The code required is given below. Consider a form or a dialog box where you have a ShComboBox Control named shCmbBox and a FileView Control named fileVw. Visual Basic shCmbBox.FileView = fileVw Visual C++ shCmbBox.SetFileView((IDispatch*)fileVw.GetControlUnknown()); Borland Delphi shCmbBox.FileView:=filevw.ControlInterface ; Borland C++ Builder shCmbBox->FileView = fileVw->ControlInterface; Microsoft Access shCmbBox.FileView = fileVw.Object
Using ShComboBox with FolderView only Using ShComboBox with FolderView requires just one line of code on your part. The code required is given below. Consider a form or a dialog box where you have a ShComboBox Control named shCmbBox and FolderView Control named fldrVw. Visual Basic shCmbBox.FolderView = fldrVw Visual C++ shCmbBox.SetFolderView((IDispatch*)fldrVw.GetControlUnknown()); Borland Delphi shCmbBox.FolderView:=fldrVw.ControlInterface ; Borland C++ Builder shCmbBox->FolderView= fldrVw->ControlInterface; Microsoft Access shCmbBox.FolderView = fldrVw.Object How can I show only drives like that in the DriveListBox in Visual Basic? You should set the ShowDrivesOnly property to True. How can I enable automatic completion of paths like in Windows Explorer? You should set the AutoComplete property to True. How can I enumerate all the items displayed in ShComboBox ActiveX Control? You should use the ItemsCount and ComboBoxItem properties. Dim x As ComboBoxItem How can I control the number of items that are shown when ShComboBox is dropped down? You should set the DropDownLines property to the desired value. How can I determine the number of items shown in ShComboBox ActiveX Control? You should use the ItemCount property. How can I retrieve the currently selected item in ShComboBox ActiveX Control? You should use the SelectedItem property. How can I select an item as the active item? You should use the SelectItem method. shcmbbox.SelectItem 2 How can I set a file/folder as the active item in ShComboBox ActiveX Control? You should use the SetPath method. shcmbbox.SetPath "c:\win98\system" SetPath can only be used for filesystem folders. To set non-filesystem files/folders like Control Panel, you should use the SetPidl method. How can I show files in ShComboBox ActiveX Control? You should set the ShowFiles property to True. How can I prevent special folders like Control Panel from showing in ShComboBox ActiveX Control? You should set the ShowVirtualFolders property to False. How can I show the full path for the selected item in ShComboBox ActiveX Control? You should set the ShowFullPath property to True.
| |
Quick
Links Copyright © 2007-2020 LogicNP Software. |
|