Click here to Skip to main content
15,918,889 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Calling one exe from other Pin
Magnus Westin27-Aug-03 2:54
Magnus Westin27-Aug-03 2:54 
GeneralProcess End Pin
Andrew Walker27-Aug-03 3:00
Andrew Walker27-Aug-03 3:00 
GeneralRe: Process End Pin
Nish Nishant27-Aug-03 3:05
sitebuilderNish Nishant27-Aug-03 3:05 
GeneralRe: Process End Pin
Andrew Walker27-Aug-03 3:17
Andrew Walker27-Aug-03 3:17 
GeneralRe: Process End Pin
iceage27-Aug-03 3:06
iceage27-Aug-03 3:06 
GeneralRe: Process End Pin
Magnus Westin27-Aug-03 3:09
Magnus Westin27-Aug-03 3:09 
GeneralRe: Process End Pin
vcplusplus27-Aug-03 3:27
vcplusplus27-Aug-03 3:27 
QuestionUpdating the property window from my custom property page? Pin
Daed27-Aug-03 2:41
Daed27-Aug-03 2:41 
I am building an ActiveX control using MFC.
I wonder how can I update the property window when I change a property of type IUnknown from the property page?
I did the following but it is not working with IUnknown property:

In the DoDataExchange of the property page I called a function that sets a new value for the property as follows:

In the property page file:
void CMyPropertyPage::DoDataExchange(CDataExchange* pDX)
{
// NOTE: ClassWizard will add DDP, DDX, and DDV calls here
// DO NOT EDIT what you see in these blocks of generated code !
//{{AFX_DATA_MAP(CPowerListPpgData)
.
.
//}}AFX_DATA_MAP
DDP_PostProcessing(pDX);
if (pDX->m_bSaveAndValidate)
SaveValue();
}

BOOL CMyPropertyPage::SaveValue(IUnknown* lpPropValue, LPCTSTR lpstrPropName)
{
USES_CONVERSION;
COleDispatchDriver PropDispDriver;

ULONG ulObjects;
LPDISPATCH *ppDisp = GetObjectArray(&ulObjects);

DISPID dwDispID;
LPCOLESTR lpOleStr = T2COLE(lpstrPropName);

for(ULONG i = 0; i < ulObjects; i++)
{
if(SUCCEEDED(ppDisp[i]->GetIDsOfNames(IID_NULL, (LPOLESTR*)&lpOleStr, 1, 0, &dwDispID)))
{
PropDispDriver.AttachDispatch(ppDisp[i], FALSE);
PropDispDriver.SetProperty(dwDispID, VT_UNKNOWN, lpPropValue);
PropDispDriver.DetachDispatch();
}
else
return FALSE;
}

return TRUE;
}

In the CTL file:
void CMyCtrl::SetMyProperty(LPUNKNOWN newValue)
{
.
BoundPropertyChanged(dispidMyProperty);
SetModifiedFlag();
}

Is there special case for the proeprties of type IUnknown?
QuestionHow to catch exception? Pin
HansonDavid27-Aug-03 2:39
HansonDavid27-Aug-03 2:39 
AnswerRe: How to catch exception? Pin
Neville Franks27-Aug-03 10:29
Neville Franks27-Aug-03 10:29 
GeneralRe: How to catch exception? Pin
HansonDavid27-Aug-03 18:31
HansonDavid27-Aug-03 18:31 
GeneralRe: How do you link Dialog boxes together Pin
Maximilien27-Aug-03 2:37
Maximilien27-Aug-03 2:37 
GeneralRe: How do you link Dialog boxes together Pin
funjat27-Aug-03 4:00
funjat27-Aug-03 4:00 
GeneralRe: How do you link Dialog boxes together Pin
PremL27-Aug-03 5:36
PremL27-Aug-03 5:36 
GeneralCan't display a file with the SDI framework and CEditView Pin
Anonymous27-Aug-03 2:01
Anonymous27-Aug-03 2:01 
GeneralCan't display a file with the SDI framework and CEditView Pin
Maxime Henrion27-Aug-03 2:01
sussMaxime Henrion27-Aug-03 2:01 
GeneralPreTranslateMessage in ocx Pin
Dudi Avramov27-Aug-03 0:54
Dudi Avramov27-Aug-03 0:54 
GeneralRe: PreTranslateMessage in ocx Pin
igor196027-Aug-03 9:17
igor196027-Aug-03 9:17 
GeneralRe: PreTranslateMessage in ocx Pin
Dudi Avramov27-Aug-03 21:10
Dudi Avramov27-Aug-03 21:10 
GeneralRe: PreTranslateMessage in ocx Pin
igor196028-Aug-03 8:26
igor196028-Aug-03 8:26 
GeneralRe: PreTranslateMessage in ocx Pin
Dudi Avramov30-Aug-03 19:30
Dudi Avramov30-Aug-03 19:30 
GeneralCustom CWnd - Z-Order Pin
Andrew Birt27-Aug-03 0:49
Andrew Birt27-Aug-03 0:49 
GeneralRe: Custom CWnd - Z-Order Pin
l a u r e n27-Aug-03 7:56
l a u r e n27-Aug-03 7:56 
GeneralThreading problem (Threads, Dialogs and Messages) Pin
d-mon27-Aug-03 0:27
d-mon27-Aug-03 0:27 
GeneralRe: Threading problem (Threads, Dialogs and Messages) Pin
Neville Franks27-Aug-03 2:24
Neville Franks27-Aug-03 2:24 

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.