Add the extension to the component category, Build and register the com server – Echelon OpenLDV User Manual

Page 129

Advertising
background image

OpenLDV Programmer’s Guide

121

}

STDMETHOD(SetOptions)(BSTR options)

{

return E_NOTIMPL;

}

// ILdvxLookup Methods

public:

STDMETHOD(DownlinkLookup)(ILdvxSCO * xSCO)

{

return E_NOTIMPL;

}

STDMETHOD(UplinkLookup)(ILdvxSCO * xSCO)

{

return E_NOTIMPL;

}

STDMETHOD(UpdateLookup)(ILdvxSCO * xSCO)

{

return E_NOTIMPL;

}

};

Add the Extension to the Component Category

To allow the OpenLDV xDriver Profile Wizard (and other xDriver-related tools)

to display your custom lookup extension, you must register the lookup extension

as belonging to the xDriver Lookup Component Category:

1. Add the following lines to your component’s header file (after

END_COM_MAP()in SampleLookupCsv.h):

// COM component category map

// (CATID_LdvxLookup is defined in LdvxTypes.h)

BEGIN_CATEGORY_MAP(CSampleLookupCsv)

IMPLEMENTED_CATEGORY(CATID_LdvxLookup)

END_CATEGORY_MAP()
2. Add the following line at the top of your component’s header file:
#include "LdvxTypes.h"
3. Add the directory that contains the LdvxTypes.h header file

(L

ON

W

ORKS

\OpenLDV SDK\Include) to your project’s include path

(select Project → ProjectName Properties to open the project’s

properties dialog, expand Configuration Properties, expand C/C++,

select General, then add the path to the Additional Include

Directories field).

Build and Register the COM Server

Select Build → Build SampleLookup to build the SampleLookup part of the

solution.
Note: For Windows operating systems that include User Account Control

(Windows 7 or Windows Vista), if you do not run Visual Studio with elevated

permissions (for example, as an Administrator), you will likely see the following

error message during registration:

Advertising