Simple help with implementing Outlook-like GUI

Hi All.

I am an experienced unix programmer who sometimes has to do something
in the windows world, and always has newbie-questions.

Basically I want to write an application program that looks like outlook
in that it has nice icons down the left hand side that choose the 
content of the main area in the right hand side.

So I started the MFC App wizard, and got me a SDI program with a 
CLeftFrame (CTreeView) and a CMainFrame (CFrameWnd).

Then I prepared the following snippet of code to draw the buttons:

// Create a pushbutton

         CBitmapButton* pmyButton;

         pmyButton = new CBitmapButton;

         if(!(pmyButton->Create(_T("My button"), 
WS_CHILD|WS_VISIBLE|BS_OWNERDRAW,
    CRect(10,30,100,30), this, 1)))
                 AfxMessageBox("Button Creation Error");
pmyButton->LoadBitmaps(IDB_BITMAP1);

At first I thought this code belongs in CLeftView::OnCreate, but the 
classwizard didnt let me create a handler in this class for the ON 
CREATE message.

I tried declaring and defining my own, but it was never called.

The classwizard did however let me create a OnCreate in the MainFrm 
class. And if I put the code in there, I do get my button being drawn in 
the wrong place.

By playing with the CRect, I can get the button appearing over the icon 
bar buttons. But if I try to put it in the left panel area, i cant see 
it, presumably it is hidden underneath the LeftView.

I also dont seem to have access to the LeftViews window handle from 
MainFrm either. So I cant pass it instead of this.

I am sure though, that I do want a CLeftView::OnCreate.

Any ideas why classwizard didnt let me create one?

Am I totally on the wrong track for developing a outlook-style gui?

Any hints?

Thanks a lot

Kurt H�usler

0
usenet13 (13)
11/11/2003 11:02:10 AM
vc.mfc 33608 articles. 0 followers. Follow

5 Replies
976 Views

Similar Articles

[PageSpeed] 28

"Kurt H�usler" <usenet@fub-group.de> wrote in message
news:boqfji$fp9$01$1@news.t-online.com...
> I am sure though, that I do want a CLeftView::OnCreate.
>
> Any ideas why classwizard didnt let me create one?

It should do. Remember you've got to add a message handler for WM_CREATE to
have a handler called OnCreate.

You could try adding ON_WM_CREATE() to CLeftView's message map, and
implementing int CLeftView::OnCreate(CREATESTRUCT*).

-- 
Tim Robinson (MVP, Windows SDK)
http://www.themobius.co.uk/


0
11/11/2003 11:32:49 AM
Thanks for the info Tim,

im still not having any luck.  I can handle the WM_CREATE message with 
the CLeftView::Create but I cant handle the ON_WM_CREATE message. Its 
simply not in the messages list.

I see some other On function names such as OnBeginPrinting, OnCmdMsg, 
OnDragEnter and OnDraw.  I can however not see any message events in 
this list such as begin with ON_WM_ I can only see events beginning with WM_

All the member functions in the list are "V". But I believe the OnCreate 
  has to be "W" right?

Perhaps something in the Class Info is wrong. My Message filter is set 
to Topmost Frame, and my Foreign class is <None>.

Any hints?

Thanks

Kurt H�usler

Tim Robinson wrote:
> "Kurt H�usler" <usenet@fub-group.de> wrote in message
> news:boqfji$fp9$01$1@news.t-online.com...
> 
>>I am sure though, that I do want a CLeftView::OnCreate.
>>
>>Any ideas why classwizard didnt let me create one?
> 
> 
> It should do. Remember you've got to add a message handler for WM_CREATE to
> have a handler called OnCreate.
> 
> You could try adding ON_WM_CREATE() to CLeftView's message map, and
> implementing int CLeftView::OnCreate(CREATESTRUCT*).
> 

0
usenet13 (13)
11/11/2003 1:23:04 PM
"Kurt H�usler" <usenet@fub-group.de> wrote in message
news:boqnro$pra$02$1@news.t-online.com...
> Thanks for the info Tim,
>
> im still not having any luck.  I can handle the WM_CREATE message with
> the CLeftView::Create but I cant handle the ON_WM_CREATE message. Its
> simply not in the messages list.

OK, but you can still add it manually, like I suggested in my previous post.

> I see some other On function names such as OnBeginPrinting, OnCmdMsg,
> OnDragEnter and OnDraw.  I can however not see any message events in
> this list such as begin with ON_WM_ I can only see events beginning with
WM_
>
> All the member functions in the list are "V". But I believe the OnCreate
>   has to be "W" right?

There's a separate section for messages -- I assume you're using VC++ 6,
since you're talking about the ClassWizard. I haven't got VC++ 6 installed
at the moment, so I can't check (they've removed ClassWizard from later
versions), but it is possible to bring up a separate list containing WM_xxx
entries. WM_CREATE is one of these, and if you add that, ClassWizard gives
you an OnCreate function.

> Perhaps something in the Class Info is wrong. My Message filter is set
> to Topmost Frame, and my Foreign class is <None>.

The message filter setting affects the list of messages you see, but you
should still see WM_CREATE regardless.

-- 
Tim Robinson (MVP, Windows SDK)
http://www.themobius.co.uk/


0
11/11/2003 1:34:09 PM
Ahhh Thankyou so much. You are right.

Yes I am using VC++ 6.

Heh, I saw the WM_CREATE and thought that that went with the Create 
function, and I was looking for a ON_WM_CREATE event to go with the 
OnCreate function.

Little did I know, that double clicking on WM_CREATE makes my OnCreate 
function.

I now have icons in roughly the right place.

Stay tuned for more newbie questions.

Thanks

Kurt

Tim Robinson wrote:
> "Kurt H�usler" <usenet@fub-group.de> wrote in message
> news:boqnro$pra$02$1@news.t-online.com...
> 
>>Thanks for the info Tim,
>>
>>im still not having any luck.  I can handle the WM_CREATE message with
>>the CLeftView::Create but I cant handle the ON_WM_CREATE message. Its
>>simply not in the messages list.
> 
> 
> OK, but you can still add it manually, like I suggested in my previous post.
> 
> 
>>I see some other On function names such as OnBeginPrinting, OnCmdMsg,
>>OnDragEnter and OnDraw.  I can however not see any message events in
>>this list such as begin with ON_WM_ I can only see events beginning with
> 
> WM_
> 
>>All the member functions in the list are "V". But I believe the OnCreate
>>  has to be "W" right?
> 
> 
> There's a separate section for messages -- I assume you're using VC++ 6,
> since you're talking about the ClassWizard. I haven't got VC++ 6 installed
> at the moment, so I can't check (they've removed ClassWizard from later
> versions), but it is possible to bring up a separate list containing WM_xxx
> entries. WM_CREATE is one of these, and if you add that, ClassWizard gives
> you an OnCreate function.
> 
> 
>>Perhaps something in the Class Info is wrong. My Message filter is set
>>to Topmost Frame, and my Foreign class is <None>.
> 
> 
> The message filter setting affects the list of messages you see, but you
> should still see WM_CREATE regardless.
> 

0
usenet13 (13)
11/11/2003 1:43:37 PM
It might not be what you are looking for, but I just wanted to let you know
that there are some very nice 'Outlook-GUI' activex controls for purchase.
(These include the gui components for the grid, calendar, notes etc)

Might save you some time.
McPPC

"Kurt H�usler" <usenet@fub-group.de> schreef in bericht
news:boqfji$fp9$01$1@news.t-online.com...
> Hi All.
>
> I am an experienced unix programmer who sometimes has to do something
> in the windows world, and always has newbie-questions.
>
> Basically I want to write an application program that looks like outlook
> in that it has nice icons down the left hand side that choose the
> content of the main area in the right hand side.
>
> So I started the MFC App wizard, and got me a SDI program with a
> CLeftFrame (CTreeView) and a CMainFrame (CFrameWnd).
>
> Then I prepared the following snippet of code to draw the buttons:
>
> // Create a pushbutton
>
>          CBitmapButton* pmyButton;
>
>          pmyButton = new CBitmapButton;
>
>          if(!(pmyButton->Create(_T("My button"),
> WS_CHILD|WS_VISIBLE|BS_OWNERDRAW,
>     CRect(10,30,100,30), this, 1)))
>                  AfxMessageBox("Button Creation Error");
> pmyButton->LoadBitmaps(IDB_BITMAP1);
>
> At first I thought this code belongs in CLeftView::OnCreate, but the
> classwizard didnt let me create a handler in this class for the ON
> CREATE message.
>
> I tried declaring and defining my own, but it was never called.
>
> The classwizard did however let me create a OnCreate in the MainFrm
> class. And if I put the code in there, I do get my button being drawn in
> the wrong place.
>
> By playing with the CRect, I can get the button appearing over the icon
> bar buttons. But if I try to put it in the left panel area, i cant see
> it, presumably it is hidden underneath the LeftView.
>
> I also dont seem to have access to the LeftViews window handle from
> MainFrm either. So I cant pass it instead of this.
>
> I am sure though, that I do want a CLeftView::OnCreate.
>
> Any ideas why classwizard didnt let me create one?
>
> Am I totally on the wrong track for developing a outlook-style gui?
>
> Any hints?
>
> Thanks a lot
>
> Kurt H�usler
>


0
McPPC
11/11/2003 2:07:15 PM
Reply:

Similar Artilces:

How to share ALL AD Users calendars as Read Only? Please help!
Hi All, I'm Hoping an MVP will come to my rescue! This'll probably sound stupid but how can I globally share all user calendars from the server so that all others in the company can view it? This is a decision handed down so please don't complicate this by saying "well that's not best practices..." We are a small Electric Cooperative and access to calendars are needed by everyone. Please advise! Thanks REM7600 I don't think it's against best practices at all actually. The answer, is a little more tricky. Most people today are using PFDAVAdmin to...

configuring 2007 office for older Outlook slows mail download
Dear Someone, I recently purchased and loaded Student Office 2007. Now when I download email (outlook was not in the suite) using my 2003 outlook, it reconfigures 2007 every mail entry. It is maddening! What can I do? Patrick try detect and repair in outlook. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook 2007: http://www.slipstick.com/outlook/ol2007/ Outlook Tips by email: dailytips-subscribe-request@lists.outlooktips.net Outlook Tips: http://www.outlook-tips.net/ Outlook &a...

Simple graph
I have a chart with zip codes and a population rate. ZIP RATE 80001 2.34 80002 1.23 80003 1.23 I want to make a chart that has the rate on the x axis and the number of times that rate occurs on the y axis. | | | * | | * |_________________________________ | | 1.23 2.34 Thank you. I will assume the ZIP and RATE stuff is in A1:B200 (labels in row 1) Label in G1 to read RATE (but leave it empty for now), label in H2 to read COUNT Make a list of rates in G2:G20 (say) In H2 =COUNTIF($B$2:$B$200,G2) Copy down the row Select H1:G20 and make a...

Windows Installer starts each time in Outlook 2003
Every time I enter send / recieve or change to "Outlook Today" Windows Installer starts up. How do I fix this issue?? Michael E. Barry ...

Loop help
Hello all, I created (recorded) a macro to sort and subtotal raw data with the following: Sub SubtotalBalSheet() ' ' SubtotalBalSheet Macro ' Macro recorded 10/15/2004 by A24479 ' ' Rows("1:1").Select Selection.Insert Shift:=xlDown Range("A1").Select ActiveCell.FormulaR1C1 = "G/L" Range("B1").Select ActiveCell.FormulaR1C1 = "Branch" Range("C1").Select ActiveCell.FormulaR1C1 = "Description" Range("D1").Select ActiveCell.FormulaR1C1 = "Current Month&...

Help with MM_MCINOTIFY notification message
Hi to all, I am using Visual C++ 6.0. I need to detect the MM_MCINOTIFY notification message. How can I do it? As taken from the MSDN Library: "The MM_MCINOTIFY message notifies an application that an MCI device has completed an operation." Thanks in advance. Geo See if the following link helps you http://msdn.microsoft.com/library/EN-US/multimed/mci_34kl.asp -- Cheers Check Abdoul [ VC++ MVP ] ----------------------------------- "Geo" <ckarakiro@hotmail.com> wrote in message news:07de01c35d06$d76abf30$a001280a@phx.gbl... > Hi to all, > > I am ...

Disabling flags in Microsoft outlook
Hi, I wonder if anyone could please assist me. When one of the users in the office sends an email to the director, it keeps on adding reminders even though none was specified in the mail. The boss dont appreciate having to cancel the reminders the whole time. Have tried to remove the flags as the mail is received, but sometimes it still pops up. Please advice Regards Fritz Delport ...

Outlook cannot connect to Exchange
Hello I am trying to add an account on Outlook for Exchange Server. In the process of adding the user, it asks for server name and user name. I put the server and put the user name and clicked on "Check Name" next to it, it is displaying the message "The name could not be resolved. The name could not be matched to a name in the address list" The user is an active directory user but that name is not found on Global Address List. It is happening just for this user, everyone else is fine. I do not know if this can be done. Can we back up the mail box of that particular user...

Need help fitting toolbars on a Frame "row"
Hello, I have several toolbars that I'd like to display on as few "frame rows" as possible. Since the User may change display resolution I can't hardcode which toolbars should be displayed on a row and I therefore need to calculate how many will fit at runtime. To do this I get the size in screen units of the Frame that holds the toobars and then, for each toolbar, I get the size (again in screen units) of the toolbar and use that to calculate how much "space is remaining" on the row. If there's enough room left I add the toolbar to the row and if not I star...

Help #7
I can't seem to import names and addresses correctly from excel to outlook's contact list. I've followed the directions but it makes each entry its own contact. Please help me. ...

custom stationary margins help
Hello I dont think I've posted to Microsoft before. I've searched for hours for the answer to this question, and can't find it anywhere. I'm using Windows XP, Microsoft Outlook 2003. I've downloaded some custom email stationary from places like www.stationary. org, www.thundercloud.com, etc. I love it except for two things ... I don't particularly care for the scrolling; is there any way to make it not scroll? And, margins. When I click "New" and get a blank email, the message ends up starting at the left side, as it normally would, but with t...

Outlook will not quit properly
Hopefully someone can help me with this. Outlook will not quit properly. When I exit out if it, an error comes up for me to send an error report to Microsoft. After sending this error report many times, nothing has solved it. I can not install XP (which is what was recommended) due to a program I have to use. Hopefully someone might have a solution to this problem. Thanks, Ellen Any details on that error? More information? ModName? What version of Outlook? What Operating system? "Ellen" <truluckoffice@knology.net> wrote in message news:140101c3522a$5e7250c0$a00128...

Simple Simple Simple
Just started Excel (again) and need to make an easy speadsheet fo calculating square inches. Column A: Height Column B: Legnth Column C: Total Tags per 16 x 24 Column D: Cost per tag Figures I know: each sheet cost me $9.98. each sheet is 16 x 24 inches What I want to do is enter the Height, enter the Length and have th total (sum) be entered into columns C and D. I can't believe I forgot how to enter formulas. Any help will b appreciated. Thank you, Crai -- Message posted from http://www.ExcelForum.com Hi Craig, One Way, might be better ways but this'll work: List the colou...

hyperlinks in outlook and word
I am setting up a remote application server with Citrix. I want to publish all the basic Office Applications and want to use Rich Text. As a security precaution I do not want to give remote users the ability to browse my network. I removed all the easy ways of doing this (removed My Network Neighbourhood for example) but I have found that a user can gain the same access by simply putting a url to a network share into a Word document and CTRL + CLICK will pop up a Explorer window with the network there to be browsed. I have tried about ten different ways to remove this ability bu...

Simple help with implementing Outlook-like GUI
Hi All. I am an experienced unix programmer who sometimes has to do something in the windows world, and always has newbie-questions. Basically I want to write an application program that looks like outlook in that it has nice icons down the left hand side that choose the content of the main area in the right hand side. So I started the MFC App wizard, and got me a SDI program with a CLeftFrame (CTreeView) and a CMainFrame (CFrameWnd). Then I prepared the following snippet of code to draw the buttons: // Create a pushbutton CBitmapButton* pmyButton; pmyButton = new CB...

Help on a design
I have a form called "software info". In this form is a subform with the license number for the software. I have also created a "check out/in" form for the software. In the software form I have a button that I can click on that will open the "check out/in" form in order for me to put in the info when someone borrows the software. Here is what I would like to happen after I have inserted the info into the "check out/in": When it is checked out I would like, maybe a red button or something, that says that the software has been checked out. Also w...

Outlook Express #60
I don't even know if this is the correct newsgroup to post, but I can't find any group under the name Outlook Express, so I'm trying my luck here. I'm due to upgrade to a new computer, and I'm wondering if I have to save my old mails into diskette or CD. I certainly don't want to lose all my old mails collected in Outlook Express. The big problem is - I'm not able to find anything in Outlook Express that looks like the data files for my old mails. So what do people do when they want to keep their old mails in the course of changing their computer? "p...

All logins are disabled
I'm working on a friend's computer and he has managed to disable all user accounts, including "administrator". How do I get control again so I can enable administrator? Thanks, Don Don wrote: > I'm working on a friend's computer and he has managed to disable all > user accounts, including "administrator". How do I get control again > so I can enable administrator? Login to Safe-Mode with the built-in Administrator account. John "Don" <no@adr.com> wrote in message news:dv4h26950t6fhnp14nde60fukc2u0qb52d@4ax.com......

Hotbar removal
I got a colourful message from a friend and a link at the bottom which took me to Hotbar.com At no cost (suspicious) the visitor can download and install of an extension to MS Outlook, adding colours, stationeries etc. It was supposed to be compatible with MS Outlook and I had (na�ve) an impression that it had to be somehow endorsed by Microsoft. Immediately after the installation I saw that I got more than I bargained for. For one, it seems to be a spyware. It has also embedded itself quite deep and there is no uninstall option. What bugs me the most is that it has replaced my Copernic S...

Outlook Signiture
Hi, Outlook 2002 I'm setting up signatures in Outlook for company standard. The signature is in HTML format. It has a "PIC" of our company logo. Here is my problem: Whenever I send out an email. The signature works but the "PIC" comes as an attachment and not in the body of the email? Any Ideas? K.J.B. An alternative may be to set up stationery with a picture embedded. >-----Original Message----- >Hi, > >Outlook 2002 >I'm setting up signatures in Outlook for company standard. >The signature is in HTML format. It has a "PIC" o...

Help manipulating external data??
In work I pull through a list of data externally using Microsoft Query and a thing called relativity. It pulls through a list of job numbers and for each job number there is a timestamp and an event for each time. Basically the info looks like this Job Number Time Event 31555 13:10 1 31555 13:15 3 31555 13:25 11 31666 18:10 5 31666 18:30 6 31666 18:33 12 31667 21:22 ...

Drag and Drop: Implementing a Drop Target
Hi, I have a CSplitter with multiple windows. I am trying to implement a Drop Target in one of them. In the View Class .h file I declare a variable of type COleDropTarget COleDropTarget m_dropTarget; In the OnCreate() member function I try to register. BOOL b = m_dropTarget.Register(this); While stepping through, It fails in oledrop2.cpp at the following function. BOOL COleDropTarget::Register(CWnd* pWnd) { (...) //the object must be locked externally to keep LRPC connections alive if (CoLockObjectExternal(lpUnknown, TRUE, FALSE) != S_OK) return FALSE; (...) } I don'...

Simple hack to get $500 to your home. 06-05-10
Simple hack to get $500 to your home at http://uknews.tk Due to high security risks,i have hidden the cheque link in an image. in that website on left side below search box, click on image and enter your name and address where you want to receive your cheque.please dont tell to anyone. ...

Help! Selecting data according to date range
I'm attempting to setup a worksheet for reminding employees to rene their licenses. I have input the data where the data range is from ro 3 - 84 (this could increase or decrease with hiring/firing, etc.). Th columns range from A - K with column H being *date*. I would like to start a new sheet (sheet2) in this workbook with th range of months in a year. In each monthly section it would search th data range in sheet 1 and return the records with the correspondin dates for that month. For example: If a employee's license expires i January, the entire record for that employee would...

Chart Help -How ?
Hi, I'm a newbie with Excel & I am struggling to make this work. It's work related. I'm simply trying to show sales figures in a Pie-chart based upon the following information: Alex Frankie w/c 13/3/06 Calls made 45 70 No. not interested 10 10 No. interested 1 8 No. of call backs 34 52 Appointments made 0 1 But I can't work out how I'm going to show the legends but also including the 2 staff members. I'm sure somebody out there will have a better resolution. Thanks -- conks ----------------------------------------------------------------------...