Gennum
site map  |  contact  |  search   
 
  The way the world will be seen and heard  
  About UsVideoAudio & WirelessData CommunicationsInvestor RelationsCareersNewsroom  
     
 
Audio & Wireless
Home > Audio & Wireless > Components > Technical Support > Software > ARK Documents
> ARKaid Product Component Library Creation HOW TO
 
 
 
 
Components
 
Technical Support
Software
   
Doc: 12031-3
   
ARKaid Product Component Library Creation HOW TO

The following instructions describe how to create an ARK product component library for one or more of Gennum's programmable analog products, using Microsoft Visual C++ 6 and the ARKaid package, available from Gennum at http://ark.gennum.com. This document is meant for use with ARKaid 2.6.0 and higher. To install ARKaid, unzip it while being sure to preserve pathnames. When this is done, a directory called ARK should be created. Before continuing with this document, please read the README.txt file in the ARK directory for important information on the particular version of ARKaid that was downloaded.

A working example of an ARK product component library, called "DEMO", is included in the ARK\Customs\Demo directory. This document relies on the use of this project, and it is recommended that the developer have the DEMO project open while following the steps below. To maintain compatibility with the paths presented in this document, it is strongly recommended that new projects also be created in the ARK\Customs directory. For example, a project called "MyProj" should be created in ARK\Customs\MyProj. Note that project names should not contain any spaces.

For the purposes of this document, we will define the word clone to mean copying a file from the DEMO project's source directory (ARK/Customs/DEMO/) into the created project directory (i.e. ARK\Customs\MyProj) and adding the file to the new project (Project->Add To Project-> Files).

To create a library with no products in it:
  1. Open Microsoft Visual C++ 6.0 and create a new ATL DLL project with the ATL COM AppWizard. Enter a project name and the location for the project folder (i.e. c:\ARK\Customs). Use the default options and click Finish.
  2. Select Insert->New ATL Object... and create a "Simple Object". Set the short name to Library. Under the Attributes tab, select Threading Model: Both, Interface: Dual, Aggregation: No. Then click OK.
  3. Remove Library.cpp from the project.
  4. Set up the registry files:
    1. Clone InProc.rgs from the DEMO project.
    2. Change the library name (i.e. 'Demo Library' to '<Project> Library'), DLL filename (i.e. 'Demo.DLL' to '<Project>.DLL'), and the GUIDs (Note: both the GUIDs in this file should be the same). Unique GUIDs can easily be generated using the GUIDGEN.EXE program included with Microsoft Visual C++ 6. This utility can be found in the subdirectory \COMMON\TOOLS under the Microsoft Visual Studio install directory. Select Registry Format, click New GUID, then click copy - the GUID can now be pasted into the file.
    3. To have this file compiled as a resource, edit the <Project>.rc file by hand using Notepad. Look for the line that reads:
      IDR_LIBRARY REGISTRY DISCARDABLE "Library.rgs"
      and add the following line below it:
      IDR_INPROC REGISTRY DISCARDABLE "InProc.rgs"
      You should now save the file, and reload it if you are prompted to do so.
    4. Edit resource.h and look for the line that reads:
      #define IDR_LIBRARY 101
      and add the following line below it:
      #define IDR_INPROC 102
    5. Change the _APS_NEXT_SYMED_VALUE value to 103.
    6. Edit Library.rgs: Copy the 'Implemented Categories' and 'ARK Catalog Info' sections from the DEMO library project. Do not forget to change the catalog info (i.e. title, etc.). Note: The 'Implemented Categories' GUID should not be changed. Also copy over the HKLM block from the Library.rgs file in the DEMO project, and change the name and title. Update the CLSID in the HKLM block (number in braces after ForceRemove) to match the CLSID at the top of the file.
  5. Edit <Project>.idl:
    1. Look for the line:
      import "ocidl.idl"
      and add the following line directly below it:
      import "ArkItfs.idl";
    2. Look for the line: importlib ("stdole2.tlb");
      and add the following line directly below it:
      importlib ("..\..\Aid\Include\MSVC\ARK.tlb");
    3. Remove the ILibrary definition (the ten lines directly below import "ArkItfs.idl").
  6. Edit the project settings (Project->Settings):
    1. For all configurations, add:
      ..\..\Aid\Include,..\..\Aid\Include\MSVC
      to the include path both in the C/C++ tab Preprocessor category, and the MIDL section.
    2. Under the C/C++ tab->C++ Language category, turn on exception handling.
    3. For the "Settings For:" Win32 Debug Configuration, under the Link Tab , add the Object/Library Module ..\..\Aid\Lib\MSVC\x86\ArkUtilsd.lib.
  7. Clone Version.h from the DEMO project. Update the component name, version, and title.
  8. Edit <Project>.cpp:
    1. Add the following above #include "<Project>_i.c":
      #include <Ark_i.c>
      #include <ArkItfs_i.c>
    2. Add the following above #include "<Project>.h":
      #include <ARK.h>
    3. Add the following above #include "Library.h":
      #include <Gennum/GP523Map.h>
      #include "Version.h"
    4. Add lines to DllRegisterServer and DllUnregisterServer as is done in the DEMO project.
  9. Edit Library.h:
    1. Remove the IDispatchImpl base class with all its parameters and replace with public CArkLibraryRoot (no parameters). Also remove the CComObjectRootEx<CComMultiThreadModel> base class.
    2. Add ISupportsCatalog and ILibrary2 to the COM map, as shown below:
      BEGIN_COM_MAP(CLibrary)
      	COM_INTERFACE_ENTRY(ILibrary)
      	COM_INTERFACE_ENTRY(ILibrary2)
      	COM_INTERFACE_ENTRY(ISupportsCatalog)
      	COM_INTERFACE_ENTRY(IDispatch)
      END_COM_MAP()
    3. Add the DECLARE_ARK_LIBRARY line and the BEGIN_ and END_ARK_LIBRARY_LIST() lines with no products between them yet. These lines can be copied and pasted from the DEMO project's Library.h file. The arguments referenced are defined in Version.h.
  10. Edit stdafx.h: Add the necessary STL headers and assert.h (these lines can be copied from the stdafx.h file in the DEMO project directory).
  11. Edit the version section of the resources: Make sure that FILEVERSION and PRODUCTVERSION are properly maintained. These are used by installers to determine if the DLL is newer than the currently installed version. If the version number is 0.7.0, set these two values to 0, 7, 0, 0. The text fields are purely cosmetic and appear in the version tab if a user views the DLL's properties in the Windows Explorer. It may be desirable to change these too.
  12. You should now be able to compile the debug configuration.
  13. To create the release configuration:
    1. Go to the Build->Configurations... dialog box and add a new configuration called Release, based on Release MinDependency.
    2. Edit the settings for this new configuration (Project->Settings): Under the General tab, change both output directories to Release.
    3. Under the C/C++ tab, in the Preprocessor Category remove _ATL_MIN_CRT from the Preprocessor definitions and under the Optimizations Category select Maximize Speed.
    4. Under the link tab add the Object/Library Module..\..\Aid\Lib\MSVC\x86\ArkUtils.lib.
To add a product to the library:
  1. Copy the parameter map and graph header files over from the appropriate demo component libraries for the hybrids that you want to use. For example, to add a GA3206-based product, copy and add GA3206Maps.h and GA3206Graphs.h from the GA3206 demo library directory to the new project.
  2. Edit the map and graph headers, making any desired changes (i.e. volume control steps, etc
  3. Edit <Project>.cpp: Add #include statements for the parameter map and graph header files above Library.h.
  4. Edit <Project>.cpp: Add #include statements for the header files for the compiled electrical models themselves after Gennum/GP523Map.h. For the GA3206, #include <Gennum/GA3206Models.h>.
  5. Edit the project settings: Under the Link tab, add the path to the appropriate .lib files for the desired electrical models to the Object/Library modules field. For the Debug configuration, the library filename has a 'd' appended to it. For the Release configuration, use the Release version of the static library (without the 'd' character appended). For the GA3206 Debug static library, for example, add:
    ..\..\Aid\Lib\MSVC\x86\GA3206Modelsd.lib
  6. To add transducer definitions, create a new header file and paste the definitions in. Be sure to #include this header file in the <Project>.cpp file. Note that there are two types of transducer definitions in the transducers.h file of the DEMO project. One type is a Laplace coefficient array, and the other is a look-up table implementation. Be sure to use a look-up table compatible graph class with any look-up table based transducers (for example, in the GA3206Graph.h file in the DEMO project, GA3206SystemGraphLU is used for transducers defined by look-up tables whereas GA3206SystemGraph is used for the standard transducers defined by Laplace Coefficients.)
  7. To add product definitions, create a header file called ProductDefs.h. Each product must have:
    • A class definition file in the ProductDefs.h file.
    • An entry in the library list in Library.h.
    Refer to the DEMO project for examples of each of the above.
  8. Remember to #include "ProductDefs.h" in <Project>.cpp. Also, note that the order of the #includes in <Project>.cpp matters. Ensure that ProductDefs.h is included before Library.h, and after the graph and map header files (refer to the DEMO project code).
   
 
     
 
     © 2006 Gennum Corporation