Click here to Skip to main content
16,005,181 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: SSL? Pin
Rob Caldecott20-Mar-06 6:15
Rob Caldecott20-Mar-06 6:15 
GeneralRe: SSL? Pin
dandy7220-Mar-06 7:24
dandy7220-Mar-06 7:24 
AnswerRe: SSL? Pin
valikac20-Mar-06 10:14
valikac20-Mar-06 10:14 
GeneralRe: SSL? Pin
dandy7220-Mar-06 10:51
dandy7220-Mar-06 10:51 
Questiondll Pin
ss200620-Mar-06 5:57
ss200620-Mar-06 5:57 
AnswerRe: dll Pin
toxcct20-Mar-06 6:03
toxcct20-Mar-06 6:03 
Questionoverloading IpropertyPage part of COlePropertyPage Pin
norbert_barbosa20-Mar-06 5:39
norbert_barbosa20-Mar-06 5:39 
Questionoverloading IpropertyPage part of COlePropertyPage Pin
norbert_barbosa20-Mar-06 5:30
norbert_barbosa20-Mar-06 5:30 
Hello,
I want to overload only the IPropertyPage::Apply() part of the COlePropertyPage, and keep the call to other IPropertyPage method managed by COlePropertyPage
I have some thing similar to this:
class COleBaseParamPage : public COlePropertyPage
{
...
DECLARE_INTERFACE_MAP()
BEGIN_INTERFACE_PART(PropertyPage, IPropertyPage)
INIT_INTERFACE_PART(COleBaseParamPage, PropertyPage)
STDMETHOD(Apply)();
STDMETHOD(SetPageSite)(LPPROPERTYPAGESITE);
...

END_INTERFACE_PART(PropertyPage)
}

BEGIN_INTERFACE_MAP(COleBaseParamPage, COlePropertyPage)
INTERFACE_PART(COleBaseParamPage, IID_IPropertyPage, PropertyPage)
END_INTERFACE_MAP()

STDMETHODIMP COleBaseParamPage::XPropertyPage::SetPageSite(LPPROPERTYPAGESITE pPageSite)
{
METHOD_PROLOGUE_EX(COleBaseParamPage, PropertyPage)
// here I would call the original COlePropertyPage::XPropertyPage::SetPageSite()
}

I have made some test for calling the original COlePropertyPage::XPropertyPage::SetPageSite() by using the _GetBaseInterfaceMap() to get it's adress, but without success. I can't figure how to optain the original COlePropertyPage::XPropertyPage object adress

If someone have a suggestion, I will be very happy...

Thanck's

---
for information, I'm using some code issued from the CmdTarget code, like:

#define GetInterfacePtr(pTarget, pEntry) \
((LPUNKNOWN)((BYTE*)pTarget + pEntry->nOffset))
static LPUNKNOWN _getInterface(REFIID _iid, LPVOID me, const AFX_INTERFACEMAP* pMap)
{
const void* iid = &_iid;
DWORD lData1 = ((IID*)iid)->Data1;
do
{
const AFX_INTERFACEMAP_ENTRY* pEntry = pMap->pEntry;
ASSERT(pEntry != NULL);
while (pEntry->piid != NULL)
{
if (((DWORD*)pEntry->piid)[0] == lData1 &&
((DWORD*)pEntry->piid)[1] == ((DWORD*)iid)[1] &&
((DWORD*)pEntry->piid)[2] == ((DWORD*)iid)[2] &&
((DWORD*)pEntry->piid)[3] == ((DWORD*)iid)[3])
{
// check INTERFACE_ENTRY macro
LPUNKNOWN lpUnk = GetInterfacePtr(me, pEntry);

// check vtable pointer (can be NULL)
if (*(DWORD*)lpUnk != 0)
return lpUnk;
}

// entry did not match -- keep looking
++pEntry;
}
#ifdef _AFXDLL
} while ((pMap = (*pMap->pfnGetBaseMap)()) != NULL);
#else
} while ((pMap = pMap->pBaseMap) != NULL);
#endif
return NULL;
}
STDMETHODIMP COleBaseParamPage::XPropertyPage::SetPageSite(LPPROPERTYPAGESITE pPageSite)
{
METHOD_PROLOGUE_EX(COleBaseParamPage, PropertyPage)
IPropertyPagePtr p = _getInterface(IID_IPropertyPage, pThis, pThis->_GetBaseInterfaceMap());
p->SetPageSite(pPageSite);
return S_OK;
}

This code do recursive call, because the 'me' parameter is not the COlePropertySheet adress (I admit I'm a little lost with all these stuff)


QuestionAnother example of variable number of parameters (using ellipsis)? Pin
Link260020-Mar-06 5:25
Link260020-Mar-06 5:25 
AnswerRe: Another example of variable number of parameters (using ellipsis)? Pin
toxcct20-Mar-06 5:34
toxcct20-Mar-06 5:34 
GeneralRe: Another example of variable number of parameters (using ellipsis)? Pin
Link260020-Mar-06 5:55
Link260020-Mar-06 5:55 
GeneralRe: Another example of variable number of parameters (using ellipsis)? Pin
toxcct20-Mar-06 6:01
toxcct20-Mar-06 6:01 
GeneralRe: Another example of variable number of parameters (using ellipsis)? Pin
Link260020-Mar-06 6:12
Link260020-Mar-06 6:12 
GeneralRe: Another example of variable number of parameters (using ellipsis)? Pin
toxcct20-Mar-06 6:17
toxcct20-Mar-06 6:17 
GeneralRe: Another example of variable number of parameters (using ellipsis)? Pin
Link260020-Mar-06 6:21
Link260020-Mar-06 6:21 
AnswerRe: Another example of variable number of parameters (using ellipsis)? Pin
Michael Dunn20-Mar-06 7:59
sitebuilderMichael Dunn20-Mar-06 7:59 
AnswerRe: Another example of variable number of parameters (using ellipsis)? Pin
Stephen Hewitt20-Mar-06 11:44
Stephen Hewitt20-Mar-06 11:44 
QuestionBit Fields, and sub field size. Pin
Iain Clarke, Warrior Programmer20-Mar-06 5:06
Iain Clarke, Warrior Programmer20-Mar-06 5:06 
AnswerRe: Bit Fields, and sub field size. Pin
Bob Flynn20-Mar-06 8:21
Bob Flynn20-Mar-06 8:21 
GeneralRe: Bit Fields, and sub field size. Pin
Iain Clarke, Warrior Programmer20-Mar-06 21:40
Iain Clarke, Warrior Programmer20-Mar-06 21:40 
GeneralRe: Bit Fields, and sub field size. Pin
Bob Flynn21-Mar-06 3:05
Bob Flynn21-Mar-06 3:05 
Questionassertion errors Pin
theprinc20-Mar-06 4:52
theprinc20-Mar-06 4:52 
AnswerRe: assertion errors Pin
PJ Arends20-Mar-06 5:05
professionalPJ Arends20-Mar-06 5:05 
GeneralRe: assertion errors Pin
theprinc20-Mar-06 5:22
theprinc20-Mar-06 5:22 
GeneralRe: assertion errors Pin
PJ Arends21-Mar-06 15:56
professionalPJ Arends21-Mar-06 15:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.