a CPropertySheet on CDialogBar question #2

hi,i develop a application based on MainFrame,
 i want to place a CDialogBar on the right of my
windows and place a CPropertySheet on this DialogBar.
i create a class,CMyDialogBar which derived from CDialogBar,
and its Create function as below:
BOOL CMyDialogBar::Create(CWnd* pParentWnd, UINT nIDTemplate, UINT
nStyle, UINT nID)
{
	// TODO: Add your specialized code here and/or call the base class

	 CDialogBar::Create(pParentWnd, nIDTemplate, nStyle, nID);
	m_pDlg1 = new CDialogPage1;//m_pDlg1 is member variable of this class
	m_pDlg2 = new CDialogPage2;//m_pDlg2 is member variable of this class
	m_MyPageSheet.AddPage(m_pDlg1);
	m_MyPageSheet.AddPage(m_pDlg2);
	m_MyPageSheet.Create(
		this,
		DS_CONTEXTHELP | DS_SETFONT | WS_CHILD | WS_VISIBLE);
	m_MyPageSheet.SetWindowPos(NULL, 0, 0, 100, 100,SW_SHOW);

	// we use the style from the template - but make sure that
	// the WS_BORDER bit is correct.
	// the WS_BORDER bit will be whatever is in dwRequestedStyle

	//m_MyPageSheet.ModifyStyle(WS_BORDER|WS_CAPTION,
	//	(WS_BORDER|WS_CAPTION));

	return true;
}
and i call this function in CMainfrm::OnCreate() to create a
mydialogbar as below:
	if (!m_wndDlgBar.Create( //m_wndDlgBar is type of CMyDialogBar
		this,
		IDD_VIEWSELECT,
		CBRS_RIGHT|CBRS_TOOLTIPS|CBRS_FLYBY,
		IDD_VIEWSELECT))
	{
		TRACE0("Failed to create DlgBar\n");
		return -1;      // fail to create
	}
but is dosen't work
and then i change the code of CMyDialogBar::Create function as below:
	//m_pDlg1 = new CDialogPage1;//m_pDlg1 is member variable of this
class
	//m_pDlg2 = new CDialogPage2;//m_pDlg2 is member variable of this
class
	CDialogPage1 dlg1;
                CDialogPage2 dlg2;
                m_MyPageSheet.AddPage(dlg1);
	m_MyPageSheet.AddPage(dlg2);
	m_MyPageSheet.Create(
		this,
		DS_CONTEXTHELP | DS_SETFONT | WS_CHILD | WS_VISIBLE);
	m_MyPageSheet.SetWindowPos(NULL, 0, 0, 100, 100,SW_SHOW);
then it do work and can display .,but when i click the tab of this
dialogbar,it tip "iskindof() error "
i don't Know why? and i think i only changed code of member variable to
local variable.
could anyone help me?
your help will be appreciated.
i

0
12/7/2006 8:52:44 AM
vc.mfc 33608 articles. 0 followers. Follow

0 Replies
519 Views

Similar Articles

[PageSpeed] 39

Reply:

Similar Artilces:

Scaled printing #2
how do I scale an A3 page to print on an A4 page ...

Linked database question
If i have a database linked into Access, and that database only allows "read- only" access, and my other problem is the data i need to pull from it, the column names do not match up with any of my other column names and i cannot change them. This is looking impossible to do but is there anyway i can bring up a record on the read only database and have that record copied to another table? -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200707/1 I don't know if this is what you are looking for. If you can see the data in the ...

CPropertySheet
hi i am working in a dialog based MFC appwizard project. I have created a wizard from CPropertySheet( 6 pages). In my fist page i want the user to select the working directory when the user clicks a browse button. for that i have used SHBrowseForFolder. i want the next button in the first page to be enabled only if the user selects a folder and clicks the ok button. i have included the following code in OnSetActive() function of the first page CPropertySheet* parent =(CPropertySheet*)GetParent(); parent->SetWizardButtons(PSWIZB_NEXT); I am able to hide the Help button from all...

REQ: Can Someone Help Me With This Outlook XP Question?
Hello All: I use Word to edit my e-mail msgs in Outlook XP. I had to reinstall Office the other day and now whenever I want to start a new e-mail or reply to an e-mail I get a warning that comes up: "A program is trying to access e-mail addresses you have stored in Outlook. Do you want to allow this? If this is unexpected it may be a virus and you should choose 'No'" There is a box that asks for the amount of time to allow the access: 1 to 10 minutes. Do I have to have specific settings for my Outlook address book? I use the Contact area in Outlook for addresses. I have ...

Three questions about fields in worksheets
Hello! I have a workbook that tracks patients (mothers) and contacts (mom's family members). The mother worksheet is named MAT_INF and the contacts one is named CONTACTS. 1. In MAT_INF, I have a field named CASE_NUMBER. How can I tell this field to automatically start out with a value like "2009-"? An example case number would look like 2009-001 or 2010-099. 2. Once CASE_NUMBER, LAST_NAME_MOM and FIRST_NAME_MOM have been populated by the user in MAT_INF, how can I automate adding those values to the CONTACT sheet, where the corresponding fields are named CASE_N...

noob questions
sorry, to bother u with a noob question, but for selfstudy purposes i have come across a thing that i would like to figure out on how it works. how does it work ? (i don t even know what it is called, so i best describe what i mean.... if you have a few rows and you want to make them dissappear with a "plus sign in front! so you can open and close this range of coloumns ... how do you do that ... i mean how do you make this kind of view? (or at least what is this feature called, so i can find out in the office help feature... that would already be a superb help! thankx y´all ...

"Show Placeholders" in options/view menu does'nt work. #2
I have a macro that places a large number of pictures on a spreadsheet. I would like the pictures to show as "placeholders" to speed up viewing/editing. The only problem is that this feature (under Tools/Options/View) does not work. All the images are being display normally. I have tried this in Excel 2000/2003/XP with the same result. This feature works great in MS Word. Please help. To see what I'm talking about. Go to Tools/Options/View and check the "Show Placeholders" option. Now insert a picture or clipart. The image will be displayed normally instead of just a b...

How to limit file size on user account or group? #2
Thanks a lot, but how can i add a limit row to be exported to excel? Thanks for your answer >and how can i see a list of users who have limit on ther account or users who do not have limit on there account - on exchange 5.5? Export the contents of the directory after you add the appropriate column names to the export file's header record. -- Rich Matheisen MCSE+I, Exchange MVP MS Exchange FAQ at http://www.swinc.com/resource/exch_faq.htm ...

Access question
Our Help Desk is trying to give access to the following menu, but can't seem to find the correct setting: <transactions><financial><financial deferral>. Can someone help point me in the right direction so we can get it accomplished? Thanks Merle: They'll find the deferral items in Advanced Security here - Set the View to: By Dictionary Look for Revenue Expense Deferrals The deferral windows are listed there. Frank Hamelly MCP-GP, MCT, MVP East Coast Dynamics www.eastcoast-dynamics.com ...

Ugrading exchange 5.5 to 2003 in a NT 4.0 domain question
When upgrading to exchange 2003 from 5.5, dows the 5.5 server need to be on a windows 2000 sxerver running active directory? Do you have to upgrade to AD from NT 4.0 before you can upgrade to 2003 Exchange. If so does that mean : 1. You have to upgrade to AD first from NT 4.0? 2. Will 5.5 run on a AD domain (with a Windows 2003 GC/DC server)? If not, how do you go from NT 4.0 to Server 2003 AD and Exchange 5.5 to Exchange 2003? Thanks, Jim Burns Upgrade the NT4 PDC to Windows 2000 or 2003 (2000 if it is the 5.5 Server) Install Windows 2003 on another box. At this point you can make th...

MSFlexGrid killing parent CPropertySheet
Hello, I am very new to VC++ and COM in general. I am developing an ActiveX control which is basically - 3 Tabs with grids on them. I used dialog resources and added 3 CPropertyPage derived classes to be my tab pages by adding the the each them one-by-one to an instance CPropertySheet. This far, things work ok. I added MSFlexGrid control to my project and it generated a couple of classes. I don't see anything wrong with that either. I placed a MSFlexGrid control on one of my Dialogs and that's where problems started. If I click on the tab where I placed the grid in the designer...

spacing question
I have a document set up with double spacing. The spaces between paragraphs, however, are double that. How can I make the spaces between paragraphs the same as between lines of the document? Thanks In the Paragraph dialog, make sure Spacing Before/After is set to 0. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA http://word.mvps.org "richard" <rmk@wonderland.net> wrote in message news:eZIzyFj9KHA.3840@TK2MSFTNGP02.phx.gbl... >I have a document set up with double spacing. The spaces between >paragraphs, however, ar...

IF statement? #2
Not sure where to start, but here goes. I have been working on creating a cost estimate. Cell I29 is the total cost. Based on the value in this cell I would like to multiply it by a certain percentage. I have 16 possiblies; $1-$100,000 = 20%, $100,001-$200,000 = 19.5%, $200,001 - $300,000 = 19% & so on. Excel 2000 Assuming that your table of values for ranges of discounts are in cells D1:F3 with D having the starting amount, E have the upper amount and F have the Discount, ie 1 100000 20% 100001 200000 19.5% etc etc etc Use the following formula:- vlookup(A1,D1...

Schema validation question
I'm a bit of a novice at XML/XSD, so this is probably pretty trivial, but hopefully someone can help me out. I need to modify the Schema that comes with Visual Studio called DotNetConfig.xsd (it's the schema that validates conformance to .NET config files) slightly and include it in my application. I need to validate that under the configuration/appSettings section, there's certain <add> keys. For example, I know that if I just want to make sure there's one <add> with the "key" attribute set to "Orange" I can just do this, but ...

Tabs in CPropertySheets
I am having 3 pages in a PropertySheet and I have added two pages in between 1st page and 2nd page. Now newly added pages are having taborder 2 and 3 respectively. But the problem is that, I want to display tabs...1,2,3 in a row. But they are not displaying. When I decrease caption size of 2 and 3 pages then these 1,2,3 pages are displaying in a row. But if I decrease caption size there is no meaning for 2 and 3 tabs. How can I solve it ? (I must have to use scrolling tabs). Please send your reply to mvs.ravikumar@wipro.com The display is like this: (3rd page )(4th page)(5th p...

question/Issue with Cached Exchange Mode and the 'Connected (headers) mode
I am running Outlook 2003 SP1 setup with cached exchange mode and I have the following issue; when I work in connected mode with the download Header option selected, Outlook 2003 downloads completly(header & body) all incoming emails instead of downloading only emails headers I initially thought this was due to Active Sync which was installed on my PC (Win2000 SP4) , so I desinstalled it , reboot but still Outlook keeps on downloading the full emails (header & Body). Any idea why Outlook behaves in such a way and how to correct it? Thank You, Jean ...

Count if question
I am trying to get a formula to count the number of outstanding letters by member of staff. I am trying to use the countif function with the isblank function (ie the date of response isn't filled in). =COUNTIF(Sheet1!$D$2:$D$20=$A4,&(ISBLANK(Sheet1!$F$2:$F$20))) where sheet 1 col D = officer initials matched to col A Is there an easy answer to my question? If you require further details please ask. Many thanks in advannce Jody and sheet1 col F will either be blank if no response has been made or contain a date of response. =SUMPRODUCT(--(Sheet1!$D$2:$D$20=$A4),--(ISBLANK...

Question
We have two users in our organization that we wish to limit the size of mail they sent to each other but no one else. Does anyone know how to do this? Thanks in advance, Michael "Michael Henderson" <mhenderson@nospam.amerlink.com> wrote: >We have two users in our organization that we wish to limit the size of mail >they sent to each other but no one else. > >Does anyone know how to do this? I don't think you can. But why look for a technical fix for the problem when a simple warning to them should suffice? Would you chain them to their desks if you found ...

Printing 1st 2 rows of spreadsheeet on each page
Really simple question, haven't been at this for to long, and all I want to do is have my column headings show on each page when I print. (not the labels - I know how to do that one !) Thanks -- Jools Not too taxing this one: Select File, Page setup and go to the Sheet tab. Just type "1:2" or whatever (without the quotes) in the "Rows to repeat at top" box "Jools" wrote: > Really simple question, haven't been at this for to long, and all I want to do is have my column headings show on each page when I print. (not the labels - I know how to do t...

Spilt Screen Question
I'm trying to fix the upper left corner (Section I) of the worksheet that is divided like this: Sec I * Sec II * * * ************************** Sec III * Sec IV * * * * I really only want to split it on the vertical. On the horizontal I want to keep section II and IV together. Right now, IV disappears under II when scrolling. But I want III to disappear under I when scrolling because I'm trying to fix I. I also want IV to disappear under III when scrolling. What do you think? Joe Sounds like you should be using Free...

Ballmer says Microsoft can survive crisis #2
While the technology industry is not immune to the troubles facing the U.S economy, it is positioned to weather a downturn, Microsoft CEO Steve Ballmer said in a talk last week in Santa Clara. "As I travel and talk to people in the industry, I would say given the current circumstances, people still see a certain buoyancy in the market," he said. Ballmer said the industry is global, shielding it in part from the crisis in the United States. In addition, he said, the consumer side of the market has been less hard hit than the business side. Ballmer spoke at the Churchill Club'...

Xslt question: how to transform children of a node into siblings?
Hi, I need some help figuring out how to do something in xslt. I have an xml document with a list of items. Each item in turn can have a list of options, like so: <item> <stuff>Item 1 Stuff</stuff> <option> <option_stuff>Option 1 Stuff</option_stuff> </option> <option> <option_stuff>Option 2 Stuff</option_stuff> </option> ... </item> .... I need to transform that by turning the option tags into item tags, and making them siblings of their parent item, like so: <item> <stuff>...

How to gracefully (programmatically) kill an app? #2
Hi All, I have an app that runs 24x7. It is win32 console application & MFC support. It is socket based exe application. We are launching worker threads using AfxBeginThread. This exe always have minimum 50 - 60 worker threads.We are closing this application for every 24 hours manually. I mean, simply close the console window using mouse. We are getting some side effects becoz of closing the exe abnormally. Q: I want to close this application gracefully? How? Which mechanism is good to close all threads? -- Thanks & Regards, John. If this is an MFC application you ca...

Safe Pay Formatting Question
We are attempting to use Safe Pay to transmit a positive pay file for Bank of America and I'm having a couple of issues. Has anyone been able to achieve a Hash Total of the check numbers included in the file (where each check issue number is added together)? I'm also curious if anyone's been able to get a cutoff date into their file without manual manipulation? I guess any words of advice on this product would be helpful, I'm finding it seems rather limited...thanks! I'm just curious if you have figured this out. We are about to begin an initiative to produce produ...

time
Thanks Myrna Thats exactly what I was looking for. Ada -- Adam ----------------------------------------------------------------------- AdamB's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1549 View this thread: http://www.excelforum.com/showthread.php?threadid=27070 ...