Re: Font Stock Property Persistance
From: greekgoddj (greekgoddj_at_discussions.microsoft.com)
Date: 03/23/05
- Next message: F C: "atl services security"
- Previous message: asid: "COM questions"
- In reply to: greekgoddj: "Re: Font Stock Property Persistance"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 23 Mar 2005 09:01:02 -0800
Nobody else??
"greekgoddj" wrote:
> thats ok Dennis..thanks a lot for your help so far though!
>
> Anybody else with VS .NET 2003? =)
>
> Aristotel
>
> "Dennis" wrote:
>
> > Yep, I'm using VS6, and we don't have 2003 yet.. So I guess you are on
> > you're own.. Sorry..
> >
> >
> >
> > "greekgoddj" <greekgoddj@discussions.microsoft.com> wrote in message
> > news:B8CB37D4-BC23-4891-BC42-31D77DA4FE75@microsoft.com...
> > > Oh I see... Perhaps I should have mentioned I am using VS .NET 2003 =) I
> > > am
> > > going to assume you are on VS 6? We also have VS6 here at work, infact the
> > > same control when it was a 100% MFC ActiveX control was written in VS6 and
> > > the Font property worked just fine. Its only when moving to VS.NET 2003
> > > and
> > > making the ActiveX as ATl with MFC support, that I have this problem.
> > >
> > > Thanks,
> > >
> > > Aristotel
> > >
> > >
> > > "Dennis" wrote:
> > >
> > >> Aristotel,
> > >>
> > >> Although we have great weather at the moment, and yes, it gives me the
> > >> summer spirit, it is still to cold to spend my time outdoors (11 degrees
> > >> Celsius)....
> > >>
> > >> But it looks like you're working with a different version of Visual
> > >> Studio
> > >> since I have different dialogs :-(
> > >>
> > >> Dennis
> > >>
> > >>
> > >>
> > >>
> > >>
> > >> "greekgoddj" <greekgoddj@discussions.microsoft.com> wrote in message
> > >> news:84AB5042-3036-4912-BDDB-F251DFA33DA1@microsoft.com...
> > >> > Hello Dennis!
> > >> >
> > >> > Spent most of the weekend on the balcony getting into the summer
> > >> > spirit!
> > >> > Thanks for the mind cracker link, i had not found that link before. I
> > >> > tried
> > >> > what it said but unfortunately did not work.
> > >> >
> > >> > Bellow are the steps I take to create my control, since you seem to be
> > >> > not
> > >> > getting the OnFontChanged() function that I get. Perhaps I am doing
> > >> > something
> > >> > wrong in the project setup.
> > >> >
> > >> > Thanks!
> > >> > Aristotel
> > >> >
> > >> >
> > >> > 1) New Project, "ATL Project"
> > >> > 2) In the wizzard that pops up, go into Application Settings, Untick
> > >> > "Attributed" and tick "Support MFC", followed by "Finish"
> > >> > 3)Under Class view, right click on the project/Add Class/ATL Control
> > >> > 4) Select "Windowed Only" under the appearance options, and select Font
> > >> > under the Stock Properties options, followed by "Finish"
> > >> >
> > >> > This adds the following member variable:
> > >> > CComPtr<IFontDisp> m_pFont;
> > >> >
> > >> > As well as the following funtion:
> > >> > void OnFontChanged()
> > >> > {
> > >> > ATLTRACE(_T("OnFontChanged\n"));
> > >> > }
> > >> >
> > >> >
> > >> >
> > >> > "Dennis" wrote:
> > >> >
> > >> >> Hi Aristotel ,
> > >> >>
> > >> >> I hope you had a nice weekend, I know I had :)
> > >> >>
> > >> >> I have tried looking into your problem further, but it is all working
> > >> >> fine
> > >> >> with my test project. Although I don't have an OnFontChanged, so we
> > >> >> are
> > >> >> doing something completely different. Maybe you can tell me a bit more
> > >> >> about
> > >> >> how you created your project.. Which Visual Studio, and the steps used
> > >> >> with
> > >> >> the wizard..
> > >> >>
> > >> >> I found this article however, maybe this will help you?
> > >> >> http://www.mindcracker.com/mindcracker/c_cafe/faq/stock.asp
> > >> >>
> > >> >> Greetings
> > >> >>
> > >> >> Dennis
> > >> >>
> > >> >>
> > >> >>
> > >> >> "greekgoddj" <greekgoddj@discussions.microsoft.com> wrote in message
> > >> >> news:A66D2937-176B-4595-A717-183F4B38A884@microsoft.com...
> > >> >> > Hello Dennis!
> > >> >> >
> > >> >> > Wow...thanks for going out of your way to give my problem a deeper
> > >> >> > look.
> > >> >> > While your suggestion makes sense, I do not think that is it,
> > >> >> > because
> > >> >> > actually it turns out I never was releasing the handle to begin with
> > >> >> > (bad
> > >> >> > coding practices of mine...tsk tsk)..
> > >> >> >
> > >> >> > I have some further information...
> > >> >> >
> > >> >> > Is using an ActiveX control in the ActiveX container considered to
> > >> >> > be
> > >> >> > run
> > >> >> > time or design time? When using the font stock property in the
> > >> >> > ActiveX
> > >> >> > cotnainer the font actually changes and I can see the change in the
> > >> >> > control's
> > >> >> > drawing. When in a MFC dialog, it doesn't crash for me, but the font
> > >> >> > does
> > >> >> > not
> > >> >> > change, neither in the control's drawing or in the property window
> > >> >> > of
> > >> >> > the
> > >> >> > control.
> > >> >> >
> > >> >> > I wanted to check wether the OnFontChanged() function actually gets
> > >> >> > called
> > >> >> > when I am designing/placing the control in a MFC dialog. So, I set
> > >> >> > the
> > >> >> > control's Visual Studio project settings to launch Visual Studio for
> > >> >> > debugging. I debug the control project which in turn launches
> > >> >> > another
> > >> >> > instance of Visual Studio in which I create a new MFC dialog simple
> > >> >> > program,
> > >> >> > and insert my control in there.
> > >> >> >
> > >> >> > I had breakpoints set in the OnBackColorChanged,
> > >> >> > OnForeColorChanged(),
> > >> >> > and
> > >> >> > OnFontChanged() functions. The debugger stopped at all of them when
> > >> >> > inserting
> > >> >> > the control in the MFC dialog. However it never goes back into
> > >> >> > OnFontChanged() after that initial time, while it does go into the
> > >> >> > OnBackColorChanged() and OnForeColorChanged() as many times as I set
> > >> >> > new
> > >> >> > properties for them.
> > >> >> >
> > >> >> > Another observation is that while each of ForeColor and BackColor
> > >> >> > properties
> > >> >> > have a propput and propget entry in the .idl file, the font property
> > >> >> > has
> > >> >> > three (propput, propget, and "propputref"). Could this be in anyway
> > >> >> > related?
> > >> >> > It is the only difference I can spot between this property and the
> > >> >> > others
> > >> >> > which do work.
> > >> >> >
> > >> >> > Well, sorry for the long post and once again thanks a lot for your
> > >> >> > help
> > >> >> > so
> > >> >> > far!
> > >> >> >
> > >> >> > If I do not hear from you within a few hours then have a nice
> > >> >> > weekend
> > >> >> > =)
> > >> >> >
> > >> >> > Aristotel
> > >> >> >
> > >> >> > "Dennis" wrote:
> > >> >> >
> > >> >> >> Take a look at PROP_DATA_ENTRY in msdn...
> > >> >> >>
> > >> >> >> Succes,
> > >> >> >> Dennis
> > >> >> >>
> > >> >> >> "greekgoddj" <greekgoddj@discussions.microsoft.com> wrote in
> > >> >> >> message
> > >> >> >> news:4B88FA74-AF49-4B9A-9864-531C3B63E921@microsoft.com...
> > >> >> >> > Goodmorning!
> > >> >> >> >
> > >> >> >> > As the subject line suggests I am having a hard time with the
> > >> >> >> > persistance
> > >> >> >> > of
> > >> >> >> > my ATL ActiveX control's Font Stock Property and the selection
> > >> >> >> > being
> > >> >> >> > remembered once its made. I thought I was doing it all wrong but
> > >> >> >> > then
> > >> >> >> > to
> > >> >> >> > make sure I had the code right, I made a brand new project with a
> > >> >> >> > brande
> > >> >> >> > new
> > >> >> >> > control that had the Font stock property as a feature from the
> > >> >> >> > very
> > >> >> >> > beginning. I also told the wizard to add the background colour
> > >> >> >> > property
> > >> >> >> > for
> > >> >> >> > testing sake.
> > >> >> >> >
> > >> >> >> > So i compile it and then try to use it in another project....I
> > >> >> >> > insert
> > >> >> >> > it
> > >> >> >> > into the dialog and then right click to get the properties. I can
> > >> >> >> > select
> > >> >> >> > the
> > >> >> >> > background colour, and the setting remains. I click on the font
> > >> >> >> > property,
> > >> >> >> > the
> > >> >> >> > font window comes up with the collection of fonts..i make the
> > >> >> >> > selection...hit
> > >> >> >> > OK/apply but the font field in the properties shows up as
> > >> >> >> > empty...it
> > >> >> >> > does
> > >> >> >> > not
> > >> >> >> > actually remember the font I chose.
> > >> >> >> >
> > >> >> >> > Like I said, I thought i might be doing something wrong and
> > >> >> >> > therefore
> > >> >> >> > tried
> > >> >> >> > it out on a brand new control where the font property was added
> > >> >> >> > by
> > >> >> >> > Visual
> > >> >> >> > Studio's wizard. Is this a little "bug"? and if so...how does one
> > >> >> >> > exterminate/wack it.
> > >> >> >> >
> > >> >> >> > Thanks!
> > >> >> >> > Aristotel
> > >> >> >>
> > >> >> >>
> > >> >> >>
> > >> >>
> > >> >>
> > >> >>
> > >>
> > >>
> > >>
> >
> >
> >
- Next message: F C: "atl services security"
- Previous message: asid: "COM questions"
- In reply to: greekgoddj: "Re: Font Stock Property Persistance"
- Messages sorted by: [ date ] [ thread ]