Demonstrates the use of string pointer handles to represent objects in Excel
This add-in contains code very similar to that described in the User Guide topic Using object handles. The difference is that it uses string pointer handles instead.
String pointer handles (as implemented in the StringPtrHandles.xpe
extension) consist of the object's name followed by its address in memory.
This is a more verbose form of handle than the other two styles,
but it is both robust and a little more transparent for the user than the
purely numeric handle type.
To edit the functions in this add-in, you need to load the extension file
StringPtrHandles.xpe
.
See Loading an extension file
for instructions.
You should also make sure that neither of the following extension files is loaded, since the three types of handles are mutually exclusive.
NumericHandles.xpe
StringHandles.xpe
The add-in functions in this sample were copied from the NumericHandleDemo sample. The following steps are required to change the handle type from numeric to string pointer:
NumericHandles.xpe
and load
StringPtrHandles.xpe
.
#include <extensions\NumericHandles.h>
.
The project can then immediately be rebuilt and run.
CXlOper::operator = | CXlOper::Ret
Each sample project is located in a sub-directory of the Samples directory of the XLL+ installation. To use the sample project, open the solution file StringPtrHandleDemo.sln or the project file StringPtrHandleDemo.vcproj.
You can enable debugging under Excel by using the Setup Debugging command in the XLL+ ToolWindow.
When delivered, the help files are excluded from the build.
You can enable the help build by selecting the files
StringPtrHandleDemo.help.xml
and
StringPtrHandleDemo.chm
in the Solution Explorer,
and using the right-click menu to view Properties.
Select the page "Configuration Properties/General" and
set the "Excluded from build" property to "No".
See Generating help
in the User Guide for more information.
List of Sample Projects | Using object handles | RtdHandleDemo sample | NumericHandleDemo sample | StringHandleDemo sample