| Kadmos.com - Frequently Asked Questions Frequently Asked Questions
Back to FAQ index How do I access Hidden Properties in C++. I need to get the ANGDIR property, but it is not available as a part of the OCX. - The procedure listed on:
http://kadmos.com/activex/dxfreaderinstallation.html
doesn't create the wrapper code for Microsoft Visual C++ for hidden properties.
Here how you can do:
- Create the IDL file for DXFReader. You can create it easily using the "OLE View" tool coming with Visual Studio or simply click here.
- Inside this file you will find the declarations for also hidden properties, for example for ANGDIR you will find:
[id(0x4003007e), propget, hidden, helpstring("1 = clockwise angles, 0 = counterclockwise."), helpcontext(0x00015f90)]
HRESULT ANGDIR([out, retval] short* ANGDIR);
[id(0x4003007e), propput, hidden, helpstring("1 = clockwise angles, 0 = counterclockwise."), helpcontext(0x00015f90)]
HRESULT ANGDIR([in] short ANGDIR);
Please note the ID values (showed in bold)
- modify the DXFReader class header file (xfreader.h) adding:
short GetANGDIR();
void SetANGDIR(short nNewValue);
- modify the IDispatch wrapper class created by Microsoft Visual C++ (xfreader.cpp) adding:
short CXFReader::GetANGDIR()
{
short result;
InvokeHelper(0x4003007e, DISPATCH_PROPERTYGET, VT_I2, (void*)&result, NULL);
return result;
}
void CXFReader::SetANGDIR(short nNewValue)
{
static BYTE parms[] = VTS_I2;
InvokeHelper(0x4003007e, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, parms,nNewValue);
}
Note again the ID values in bold.
-
Repeat for every hidden properties you need.
Copyright © 2010 Kadmos.com. All rights reserved. Privacy Policy
|