Sky Software Homepage LogicNP Software Knowledge Base And FAQ

 
Contact Product Support    SearchSearch      Subscribe to the RSS feed for this forum

INFO: Using the controls in Shell MegaPack in C++ projects of Visual Studio.Net 2002 and later versions

 
Subscribe to the RSS feed for this forum  Forum Index -> Shell MegaPack ActiveX
View previous topic :: View next topic  
Author Message
Support



Joined: 18 Jul 2005
Posts: 731

Posted: Sun Sep 09, 2007 4:43 am    Post subject: INFO: Using the controls in Shell MegaPack in C++ projects of Visual Studio.Net 2002 and later versions

METHOD 1
Visual C++ 6.0 and earlier versions automatically generated wrapper files for all the classes present in the type library of the ActiveX control; however Visual Studio.Net 2002 and later versions do not do so. To work around this, Shell MegaPack comes with pre-generated wrapper files for all controls. They are present in the 'cpp_wrappers' sub-directory under the directory where Shell MegaPack is installed. For example, assuming the installation path is not changed during installation, the pre-generated wrapper files for the FileView control are present in the directory 'C:\Program Files\LogicNP Software\Shell MegaPack ActiveX\FileView ActiveX Control\cpp_wrappers'.

Copy all the wrapper files to your project folder and add them to your project using Project-->Add Existing Item. To add a new member variable corresponding to a control on the dialog box, right-click on the control on the dialog editor and selecting the 'Add Variable...' menu item. Specify the wrapper class name in the 'Variable Type' field (for example, for FileView, specify CFileView which is defined in the fileview.cpp and fileview.h wrapper files). Also make sure that the 'Control Variable' checkbox is checked. The image below demonstrates this. Notice that the '.h file' and '.cpp file' fields are automatically grayed because you specified a class name (CFileView) which already exists in the project.



Notes
This method does not create definitions for all the enumerations used by the ActiveX controls. To get enumeration definitions, use METHOD 2 below. Once the definitions are generated, you can copy them to another file and switch back to using METHOD 1.

You may get an error message similar to "The Extender Provider failed to return an Extender for this object" when the 'Add Variable' dialog shows up. You can safely ignore this error message by clicking 'Yes' ("continue running scripts").

METHOD 2

Another way to use the controls in your project is to use the #import directive as follows :

#import "filev012.ocx" raw_interfaces_only, raw_native_types, no_namespace, named_guids

This directive generates the wrapper files during compilation.

Notes
This method creates definitions for all the enumerations used by the ActiveX controls.
This method cannot be used to link (at design-time) a control present on the form. However, it is possible to link the control programmatically through code.
Back to top
Display posts from previous:   
Forum Index -> Shell MegaPack ActiveX All times are GMT
Page 1 of 1

 
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group