|
If "botton" means "button" then check this code:
CWnd *pBtn = GetDlgItem (IDC_BTNMNU);<br />
CRect btnrect, wndrect;<br />
<br />
pBtn->GetWindowRect (&btnrect);<br />
GetWindowRect (&wndrect);<br />
CPoint mnupoint (btnrect.left, btnrect.bottom);<br />
BOOL bRet = menu.CreatePopupMenu ();<br />
bRet = menu.TrackPopupMenu (TPM_LEFTALIGN | TPM_LEFTBUTTON, <br />
mnupoint.x, <br />
mnupoint.y, <br />
this);<br />
<br />
<br />
when IDC_BTNMNU is the name of the button.
regards,
Andrea
|
|
|
|
|
Try TrackPopupMenu() function SDK or MFC
for example
void CMyView::OnRButtonDown(UINT nFlags, CPoint point)
{
CMenu menu;
if (menu.LoadMenu(IDR_MYMENU))
{
CMenu* pPopup = menu.GetSubMenu(0);
ASSERT(pPopup != NULL);
pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON,
point.x, point.y, this);
}
}
and better than OnRButtonDown() OnContextMenu()
viliam
|
|
|
|
|
I have followed your words with my simple C version:
Menu=LoadMenu(hInstance,MAKEINTRESOURCE(IDR_MENU_DESPLEGABLE));
TrackPopupMenuEx(hMenu,TPM_LEFTBUTTON|TPM_LEFTALIGN|TPM_TOPALIGN,LOWORD(lParam),HIWORD(lParam),hWindow,NULL);
but I still have a small problem:
-The popup menu isn't showed complet, only is showed the border but it works fine when calls the WM_COMMAND.
Why the popup menu isn't showed normal??
thanks
Christian
|
|
|
|
|
PLEASE HELP: I'm trying to populate the fields in the 'wave properties dialog'. What I'm I doing wrong?
typedef struct output_tag // any special vars associated with output file
{
short nFile;
long lSize;
DWORD dwDataOffset;
long lSamprate;
WORD wBitsPerSample;
WORD wChannels;
DWORD dwFormat;
BOOL bWroteHeader;
char szTITLE[256]; // Title Displayed
char szARTIST[256]; // Artist
char szNAME[256]; // Name
char szGENRE[256]; // Genre
char szKEYWORDS[256]; // Keywords
char szSOURCE_FORM[256]; // Source Form
char szMEDIUM[256]; // Medium
char szENGINEER[256]; // Engineer
char szTECHNICIAN[256]; // Technician
char szSOURCE[256]; // Source
char szCOPYRIGHT[256]; // Copyright
char szSOFTWARE[256]; // Software
char szCREATION_DATE[256]; // Creation Date
char szSUBJECT[256]; // Subject
char szCOMMENTS[256]; // Comments
char szNumExtraDatas[256];
char extra[256];
} MYOUTPUT;
MYINPUT is the same.
DWORD WINAPI FilterGetNextSpecialData(HANDLE hInput, SPECIALDATA * psp)
{ //return 0; // only has 1 special data! Otherwise we would use psp->hSpecialData
// as either a counter to know which item to retrieve next, or as a
// structure with other state information in it.
DWORD dwCount=(DWORD)psp->hSpecialData;
BOOL bContinue=TRUE;
char * pData=NULL; // Pointer to data
DWORD dwSuccess=1;
int i;
char tmp[48];
MYINPUT *mi;
mi=(MYINPUT *)GlobalLock(hInput);
while (bContinue)
{
bContinue=FALSE;
if (dwCount >= 8)
{
char * pData;
int i = (int)(dwCount - 8);
if ((i >= mi->szNumExtraDatas) || (!mi->extra[i].pData))
{
dwSuccess = 0;
break;
}
psp->dwExtra = (DWORD)-1; // so CEP handles this automatically
psp->dwSize = mi->extra[i].dwLength;
psp->hData = GlobalAlloc(GMEM_MOVEABLE|GMEM_ZEROINIT, psp->dwSize+8);
pData=(char *)GlobalLock(psp->hData);
CopyMemory(pData, mi->extra[i].pData, mi->extra[i].dwLength);
lstrcpy(psp->szListType, mi->extra[i].szList);
lstrcpy(psp->szType, mi->extra[i].szType);
GlobalUnlock(psp->hData);
}
else switch (dwCount)
{
case 0:
if (!*mi->szTITLE)
{
bContinue=TRUE;
dwCount++;
break;
}
lstrcpy(psp->szListType,"WAVE");
lstrcpy(psp->szType,"DISP");
psp->dwExtra=1;
psp->dwSize=lstrlen(mi->szTitle)+1+4;
psp->hData=NULL;
pData=psp->szDataIn;
i=1;
CopyMemory(pData,&i,4);
lstrcpy(pData+4,mi->szTitle);
break;
case 1:
if (!*mi->szArtist)
{
bContinue=TRUE;
dwCount++;
break;
}
lstrcpy(psp->szListType,"INFO");
lstrcpy(psp->szType,"IART");
psp->dwExtra=1;
psp->dwSize=lstrlen(mi->szArtist)+1;
psp->hData=NULL;
pData=psp->szDataIn;
lstrcpy(pData,mi->szArtist);
break;
case 2:
if (!*mi->szAlbum)
{
bContinue=TRUE;
dwCount++;
break;
}
lstrcpy(psp->szListType,"INFO");
lstrcpy(psp->szType,"INAM");
psp->dwExtra=1;
psp->dwSize=lstrlen(mi->szAlbum)+1;
psp->hData=NULL;
pData=psp->szDataIn;
lstrcpy(pData,mi->szAlbum);
break;
case 3:
if (!*mi->szComment)
{
bContinue=TRUE;
dwCount++;
break;
}
lstrcpy(psp->szListType,"INFO");
lstrcpy(psp->szType,"ICMT");
psp->dwExtra=1;
psp->dwSize=lstrlen(mi->szComment)+1;
psp->hData=NULL;
pData=psp->szDataIn;
lstrcpy(pData,mi->szComment);
break;
case 4:
if (!*mi->szYear)
{
bContinue=TRUE;
dwCount++;
break;
}
lstrcpy(psp->szListType,"INFO");
lstrcpy(psp->szType,"ICRD");
psp->dwExtra=1;
psp->dwSize=lstrlen(mi->szYear)+1;
psp->hData=NULL;
pData=psp->szDataIn;
lstrcpy(pData,mi->szYear);
break;
case 5:
if (!mi->szTrackNumber)
{
bContinue=TRUE;
dwCount++;
break;
}
lstrcpy(psp->szListType,"INFO");
lstrcpy(psp->szType,"ISBJ");
psp->dwExtra=1;
wsprintf(tmp,"%d",mi->szTrackNumber);
psp->dwSize=lstrlen(tmp)+1;
psp->hData=NULL;
pData=psp->szDataIn;
lstrcpy(pData,tmp);
break;
case 6:
if (!mi->szGenre)
{
bContinue=TRUE;
dwCount++;
break;
}
lstrcpy(psp->szListType,"INFO");
lstrcpy(psp->szType,"IGNR");
psp->dwExtra=1;
if (mi->szGenre>126)
mi->szGenre=126;
lstrcpy(tmp,Genres[mi->szGenre]);
psp->dwSize=lstrlen(tmp)+1;
psp->hData=NULL;
pData=psp->szDataIn;
lstrcpy(pData,tmp);
break;
case 7:
{
char * pData;
if (!mi->pID3v2)
{
bContinue=TRUE;
dwCount++;
break;
}
psp->dwExtra = 1;
psp->dwSize = mi->dwSizeID3v2;
psp->hData = GlobalAlloc(GMEM_MOVEABLE|GMEM_ZEROINIT, psp->dwSize+8);
pData=(char *)GlobalLock(psp->hData);
CopyMemory(pData, mi->pID3v2, mi->dwSizeID3v2);
lstrcpy(psp->szListType, "WAVE");
lstrcpy(psp->szType, "ID3x");
GlobalUnlock(psp->hData);
}
break;
default:
// all done!
dwSuccess=0;
break;
}
}
dwCount++;
psp->hSpecialData=(HANDLE)dwCount;
GlobalUnlock(hInput);
return dwSuccess;
}
DWORD WINAPI FilterGetFirstSpecialData(HANDLE hInput, SPECIALDATA * psp)
{
MYINPUT * mi;
DWORD dwSuccess=0;
BOOL bHasTagInfo = TRUE;
if (!hInput)
return 0; // return is boolean
mi=(MYINPUT *)GlobalLock(hInput);
psp->hSpecialData=(HANDLE)0; // start at the case 0: item in FilterGetNextSpecialData
GlobalUnlock(hInput);
if (bHasTagInfo)
return FilterGetNextSpecialData(hInput,psp);
else
return FALSE;
}
Trevor Scott Ph.D., MSc, Eng Hons.
|
|
|
|
|
This is the other part of the code:
DWORD WINAPI FilterWriteSpecialData(HANDLE hOutput, LPCSTR szListType, LPCSTR szType, char * pData,DWORD dwSize)
{
MYOUTPUT * mo;
BOOL bHandled = FALSE;
if (!hOutput)
return 0; // FALSE
mo=(MYOUTPUT *)GlobalLock(hOutput);
if (strcmp(szListType,"INFO")==0)
{
if (strcmp(szType,"IART")==0)
{
CopyMemory(mo->szArtist,pData,min(lstrlen(pData)+1,30));
mo->iTagVersion=1;
//bHandled = TRUE;
}
else if (strcmp(szType,"INAM")==0)
{
CopyMemory(mo->szAlbum,pData,min(lstrlen(pData)+1,30));
mo->iTagVersion=1;
//bHandled = TRUE;
}
else if (strcmp(szType,"ICRD")==0)
{
CopyMemory(mo->szYear,pData,min(lstrlen(pData)+1,4));
mo->iTagVersion=1;
//bHandled = TRUE;
}
else if (strcmp(szType,"ICMT")==0)
{
CopyMemory(mo->szComment,pData,min(lstrlen(pData)+1,30));
mo->iTagVersion=1;
//bHandled = TRUE;
}
else if (strcmp(szType,"ISBJ")==0)
{
if (atoi(pData)!=0)
{
int i;
i=atoi(pData);
if (i<255)
{
mo->iTrackNumber=i;
mo->iTagVersion=1;
//bHandled = TRUE;
}
}
}
}
else if (strcmp(szListType,"WAVE")==0)
{
if (strcmp(szType, "ID3x")==0)
{
mo->dwSizeID3v2 = dwSize;
mo->hID3v2 = GlobalAlloc(GMEM_MOVEABLE, dwSize);
mo->pID3v2 = (BYTE *)GlobalLock(mo->hID3v2);
CopyMemory(mo->pID3v2, pData, dwSize);
bHandled = TRUE;
}
else if (strcmp(szType,"DISP")==0)
{
DWORD dw;
CopyMemory(&dw,pData,4); // Display Name string
if (dw==1)
{
CopyMemory(mo->szTitle,pData+4,min(lstrlen(pData+4)+1,30));
mo->iTagVersion=1;
//bHandled = TRUE;
}
}
}
// Any ancillary data items from Audition that we don't how to handle, let's save them here
if (!bHandled)
{
int i = mo->iNumExtraDatas;
strcpy(mo->extra[i].szList, szListType);
strcpy(mo->extra[i].szType, szType);
mo->extra[i].dwLength = dwSize;
mo->extra[i].hData = GlobalAlloc(GMEM_MOVEABLE|GMEM_ZEROINIT, dwSize);
mo->extra[i].pData = (BYTE *)GlobalLock(mo->extra[i].hData);
CopyMemory(mo->extra[i].pData, pData, dwSize);
mo->iNumExtraDatas++;
}
GlobalUnlock(hOutput);
return 1; // OK
}
HANDLE WINAPI OpenFilterOutput(LPSTR lpstrFilename,long lSamprate,WORD wBitsPerSample,WORD wChannels,long lSize, long *lpChunkSize, DWORD dwOptions)
{
HANDLE hOutput;
short nFile;
nFile=_lcreat(lpstrFilename,0);
if (nFile==-1) return NULL;
if (hOutput=GlobalAlloc(GMEM_MOVEABLE|GMEM_SHARE,sizeof(MYOUTPUT)))
{
MYOUTPUT *mo;
DWORD dw;
mo=(MYOUTPUT *)GlobalLock(hOutput);
mo->nFile=nFile;
mo->lSize=lSize; // size in bytes 16-bit PCM
mo->lSamprate=lSamprate;
mo->wBitsPerSample=wBitsPerSample;
mo->wChannels=wChannels;
dw=0x646e732e;
_lwrite(mo->nFile,(LPCSTR)&dw,4);
mo->dwFormat=dwOptions;
FillMemory(mo->szTITLE,255,0);
FillMemory(mo->szNAME,255,0);
FillMemory(mo->szARTIST,255,0);
FillMemory(mo->szGENRE,255,0);
FillMemory(mo->szKEYWORDS,255,0);
FillMemory(mo->szSOURCE_FORM,255,0);
FillMemory(mo->szMEDIUM,255,0);
FillMemory(mo->szENGINEER,255,0);
FillMemory(mo->szTECHNICIAN,255,0);
FillMemory(mo->szSOURCE,255,0);
FillMemory(mo->szCOPYRIGHT,255,0);
FillMemory(mo->szCREATION_DATE,255,0);
FillMemory(mo->szSUBJECT,255,0);
FillMemory(mo->szCOMMENTS,255,0);
mo->bWroteHeader=FALSE;
//dw=0;
//_lwrite(mo->nFile,&dw,4);
GlobalUnlock(hOutput);
}
*lpChunkSize=16384;
return hOutput;
}
THANKS!!!!!
Trevor Scott Ph.D., MSc, Eng Hons.
|
|
|
|
|
I use two classes to work with my database:
CADODatabase and CADORecordset from Carlos Antollini(See http://www.codeproject.com/database/caaadoclass1.asp#CommonQuestions[^] ).
the following part demonstrates it:
>CString strConnection=_T("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=module.mdb");
>if(m_db.Open(strConnection))
>{
> m_rec=CADORecordset(&m_db);
> if(m_rec.Open(_T("main"), CADORecordset::openTable))
> MessageBox("Table 'main' is opened.");
>}
but I need a bi-directional scrolling in my database. It is important for me, because I use CTreeCtrl, that have records from my database as TVITEM's pszText. But I can't
realise it(bi-directional scrolling) like I can do it with another class CRecordset::dynaset or CRecordset::dynamic as a parameter of
m_rec.Open(...);
If someone had faced with this problem, please, leave your note here.
|
|
|
|
|
bilas,
I am using a very early version of Carlos's classes and this interested me
a bit as I would like to upgrade to Version 2.
I wrote quick program to test your problem, but could not find anything at
fault! The program connects to an existing database (JET 4), and then cycles
through a particular field. I then starts at the end of the recordset and traverse
backwards to the beginning. I hope this is what you meant by bi-directional
scrolling!
The program opens the table in direct mode (openTable) to mimic what you have
done. Have a look below and see if you can see anything amiss between yours and mine.
void CMytestDlg::OnOK()
{
CString strConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\temp\\MyDB.mdb");
CADODatabase db;
if(db.Open(strConnection))
{
CADORecordset rs;
if(rs.Open(db.GetActiveConnection(), "Categories", CADORecordset::openTable))
{
rs.MoveFirst();
while(!rs.IsEOF())
{
CString strKeyword;
if(rs.GetFieldValue("Keyword", strKeyword))
{
Log(strKeyword);
}
else
{
Log("--EMPTY--");
}
rs.MoveNext();
}
Log("");
Log("==== AND NOW THE REVERSE =====");
rs.MoveLast();
while(!rs.IsBOF())
{
CString strKeyword;
if(rs.GetFieldValue("Keyword", strKeyword))
{
Log(strKeyword);
}
else
{
Log("--EMPTY--");
}
rs.MovePrevious();
}
rs.Close();
}
db.Close();
}
}
I Dream of Absolute Zero
|
|
|
|
|
RChin, I've done everythink, but now it does not work again.
Please, if you can, look at my code. You can download my program from
http://bilasguitar.narod.ru/confidential/tempo.zip - 54Kb.
A problem is in MyDialog.cpp
Thanks in advance,
bilas.
|
|
|
|
|
bilas, I've had a quick look at your code and although there are quite a
few issues with the code, I will try to only comment on the revelant ones.
You have a JET database with the following dataset:
<small>
Sys_Cd Sys_Nm Sys_ParRcd Sys_Rcd
-------+-----------+------------+---------
25 | record15 | 3 | 8
30 | Parent 2 | 0 | 9
31 | Child 1 | 9 | 10
32 | Child 2 | 9 | 11
33 | Child 3 | 9 | 12
10 | Parent 0 | 0 | 1
11 | record01 | 1 | 2
20 | Parent 1 | 0 | 3
21 | record11 | 3 | 4
22 | record12 | 3 | 5
23 | record13 | 3 | 6
24 | record14 | 3 | 7
</small>
.First off, this is the order that you will get when you open up the recordset
in openTable mode. If you require a different order (which I suspect you do), you will have to
either:
1. Open the recordset in openQuery mode, using an SQL statement to order your
result set. ("SELECT * FROM [main] ORDER BY [sys_Rcd]")
2. If you need to open up the table directly, you will have to ensure that the indices of the
field that you want returned in a specific order exist. Currently you have three indices defined, in addition
to the primary key.
I suspect that you wanted your tree to be ordered by the Sys_Rcd field, with the Sys_ParRcd
field determining whether the item is a parent or a child, so whould look a bit like this:
<small>
+---Parent 0
| \---record01
+---Parent 1
| +---record11
| +---record12
| +---record13
| +---record14
| \---record15
+---Parent 2
+---Child 1
+---Child 2
\---Child 3
</small>
Secondly, the problem you seem to be having is not a database
connectivity issue, but a tree population one. The ADO class acts just as it should,
you just need to know what its doing so that you can populate your tree accordingly.
The population code seems a bit messy and at times confusing. Separate this out into a separate
function and work through what you want to achieve logically. Possibly write down first on a
sheet of paper in psuedo-programming exactly what you want to be done before creating your function.
Thirdly. There one or two potentially serious coding errors that
may trouble you later on. For Example:
if(val1 == '0') , should be changed to
if(strcmp(val1,_T("0")) == 0) or if(val1.Compare("0")==0)
Infact, since the field is already a number, you can retrieve this to an integer variable.
Also, your CMyDialog is being allocated on the heap via the View class without being
deleted, so you will see memory leaks when the application exits.
Anyway, I hope these comments helps in your quest for programming peace and fulfilment
I Dream of Absolute Zero
|
|
|
|
|
RChin, I really thank you for your explanation. It is very important for me to have information you
wrote. Can't express my gratitude for your usefull efforts.
Only one question: how can I know the order of records(like you wrote above) when I open my
database?
Bilas.
|
|
|
|
|
I have slider control control with 4 ticks,
but if I ask position of index=2 tick
slider return error value - incorrect index:
<br />
int tic_min, tic_max;<br />
<br />
pForm->m_SliderPage.GetRange (tic_min, tic_max);<br />
<br />
int x= pForm->m_SliderPage.GetTicPos(poz);<br />
<br />
<br />
<br />
why so happens?
thanks
|
|
|
|
|
Have you tested other positions ? 0, 1, 3 ?
Do they return correct values ?
Your code only shows that your slider's range is from 0 to 3. It does not show whether you have set it to have ticks at 1 intervals. For this purpose, the style TBS_AUTOTICKS must be set when creating, after which a call to SetTicFreq member with parameter 1 would do the job.
Try calling GetTickPos with different values. If all return -1, you've forgotten something in the initialization of the control. If only position 2 returns -1, then check your tic frequency and/or force it to '1'.
Remember, that the range setting does not assume that there are ticks in the control. A slider control with a range 0 -> 3 without ticks would result in a bar which has 0 at the other end, 3 at the other, and nothing inbetween. This would cause a '-1' to be returned from a query for an invalid position. In this case, only positions 0 (0) and 1 (3) would be valid.
Here, I assume you use CSliderCtrl MFC class. If you use a custom slider control, then it's implementation might be buggy.
Try out those suggestions and reply with results. Then I might be able to help you more.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
0,1 postions are working.
If I make 10 positions
0-8 positions working, but not two last...
what problem witj two last positions can be?
thanks.
|
|
|
|
|
Add the style 'TBS_AUTOTICK' to the control's style flags.
Then call SetTickFreq(1) after setting the ranges. Now try again, it should work. At least I got my slider to work smoothly
The last option is to do the above, and a button to show the currently selected notch index. Then run the program, moving the slider and pressing the button at each notch to see it's index. If the "currently selected notch" query handles all notches correctly, then there's a bug in the implementation of the control. Getting an upgraded version of MFC might help.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Is there any possibility to call a function when an email arrives in the Outlook Express. How to get notification when an email arrives.
Please help
|
|
|
|
|
Could you specify a bit more of what you want to do ?
The Outlook Express will send a self-notification when a new e-mail message is available. This notification will cause a small task tray icon to pop up. We have all seen this.
You would need to do some hacking with Spy++ to find out what message it is that OE generates/sends when a new e-mail message is available. Then hook the OE's window procedure, and handle this message yourself before posting it forwards to OE or dumping it.
Remember that dumping the new message notification may cause the message not to be displayed on OE's message list.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Well, what I really want to do is a project which scans an incoming email content and puts it to a folder dependently what the content looks like.
Please give me any suggestions, maybe a piece of code.
Thank you
|
|
|
|
|
Get the Outlook Express ActiveX component. It is available freely for evaluation, and exposes the entire OE Interface for your use. Works much like Word/Excel/Outlook automation objects.
Of course there are alternative, and free, ways to accomplish all this, but it would be much more difficult. Use the ActiveX component, as it is available. Trust me, although the component does cost £19, it will make your work a whole lot easier. Especially if you're trying to build a spam filter or something similar...
Here's a link to the component creator's website: Small Office Solutions Ltd.[^]
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Well, I would rather write it in C++ without using any components(especially in case the component is written in VB). How to check in spy++ what kind of message is comming when an email arrives?
I know there are some products which have control on Outlook, without using any components, so I want to achive the same.
Any more sugestions?
P.S Thank ypu for your help
|
|
|
|
|
Another question. Can I use MAPI to solve the problem?
|
|
|
|
|
Outlook Express does not get notified if there are new messages in the POP3 mailbox (it is Outlook which does get notications), OE rather checks itself the contents of the POP3 mailbox after a user defined time intervall has elapsed.
That means you can programmatically do the same from your own prog, independently of Outlook Express. You can also use for this ready made POP3 classes like
http://www.codeproject.com/internet/win32_pop3.asp
Then analyze the messages in the POP3 mailbox, and also let OE download them.
The data (like user, server name etc.) of the predefined POP3 mailboxes of OE you can find find under HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts
The full path to the message files (like incoming messages, sent messages etc. is under HKEY_CURRENT_USER\Identities\..Identity GUID..\Software\Microsoft\Outlook Express\...Version...\Store Root
Peter Molnar
|
|
|
|
|
Int the following code, I'm overriding CPropertySheet::RemovePage(int nPage)
How can I return a pointer to cdxCDynamicPropPage?
class cdxCDynamicPropSheet:public CPropertySheet {}
class cdxCDynamicPropPage :public CPropertyPage{}
void cdxCDynamicPropSheet::RemovePage( int nPage )
{
ASSERT_VALID(this);
// remove the page externally
if (m_hWnd != NULL)
SendMessage(PSM_REMOVEPAGE, nPage);
cdxCDynamicPropPage* page = ???
page->m_pSheet = NULL;
}
|
|
|
|
|
Use CPropertySheet::GetPage before sending the message to get a pointer to the CPropertyPage . Then use DYNAMIC_DOWNCAST to cast a pointer to your derived cdxDynamicPropPage class.
cdxCDynamicPropPage* pPage = DYNAMIC_DOWNCAST(cdxCDynamicPropPage, this->GetPage(nPage) );<DIV>
SendMessage(PSM_REMOVEPAGE, nPage); Something like that. Remember, though, that a better way would be to call CPropertySheet::RemovePage instead of sending a message. This way, the property page window will be deleted, but the page object would remain, leaving the pointer returned by GetPage valid.
Here is a different implementation of your RemovePage method, which removes a page from a property sheet, and then fiddles with the page object.
void cdxCDynamicPropSheet::RemovePage(int nPage)
{
ASSERT_VALID(this);<DIV>
this->CPropertySheet::RemovePage(nPage);<DIV>
cdxCDynamicPropPage* pRemovedPage = DYNAMIC_DOWNCAST( cdxCDynamicPropPage, this->GetPage(nPage) );<DIV>
ASSERT( pRemovedPage != NULL );<DIV>
pRemovedPage->SomeMethod( someParams );
} Hope this helps.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
It helped Thanks a lot
|
|
|
|
|
BOOL LookupAccountName(
LPCTSTR lpSystemName, // address of string for system name
LPCTSTR lpAccountName, // address of string for account name
PSID Sid, // address of security identifier
LPDWORD cbSid, // address of size of security identifier
LPTSTR ReferencedDomainName,
// address of string for referenced domain
LPDWORD cbReferencedDomainName,
// address of size of domain string
PSID_NAME_USE peUse // address of SID-type indicator
);
Best Wishes and Happy Holiday's,
ez_way
|
|
|
|
|