|
Document/View....not a dialog. I can't use the same code as shown above...because the second window I want to call is a document/view. Am I missing something? Last I checked Dlg is not CView? Should I change Dlg to CView?
|
|
|
|
|
Creating an SDI or MDI project and adding a dialog to it is way easier than creating a dialog project and adding doc/view to it. Have you considered switching?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
It would be a last resort. I can use the code posted previously to open the dialog (main application) from the doc/view (secondary app), but what happens when the user closes the doc/view window and wants to re-open it? I try not to force a design around a handicap if I don't have to, so for now, lets just say that I'd still like to learn how to open Doc/View from Dialog. I appreciate your suggestions so far.
|
|
|
|
|
Mark Gilson wrote: ...but what happens when the user closes the doc/view window and wants to re-open it?
Isn't that how apps work already?
Mark Gilson wrote: I try not to force a design around a handicap...
What handicap?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Alright, so your suggestion is to use the doc/view to open the dialog. I then stated that this is not what I would like to do (as suggested by the subject). If you have an answer to my question "how do you open a doc/view window from a dialog", I'm all ears.
|
|
|
|
|
|
This is why MFC is disappointing. I guess I'll call the dialog from the doc/view.
|
|
|
|
|
Hi all,
I m using a DateTimePicker, and use CDateTimeCtrl and COleDateTime type varible for this.
i want to increase a date by one day,is it possible.
If yes please tell me .
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
"_$h@nky_" wrote: i want to increase a date by one day,is it possible.
If yes please tell me .
Yes. Use a COleDateTimeSpan object.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Here onle addition,subtraction or other rational operator are persent .
there is no increment type operator.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
"_$h@nky_" wrote: Here onle addition,subtraction or other rational operator are persent .
Which is all you need when operating on dates and times.
"_$h@nky_" wrote: there is no increment type operator.
Last time I checked, adding 1 is also known as incrementing.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
"_$h@nky_" wrote: there is no increment type operator.
"_$h@nky_" wrote: Here onle addition
"_$h@nky_" wrote: operator are persent
Do you mean increment is not addition
I hope it helps.
Regards,
Sandip.
|
|
|
|
|
SandipG  wrote: Do you mean increment is not addition
thx sir, plz, if they r same why 2 namez, plz?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Regards,
Sandip.
|
|
|
|
|
I guess David meant something like this:
COleDateTimeSpan dtSpan(1, 0, 0, 0);
dt += dtSpan;
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Thanks Sir.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
You may:
(1) use CDateTimeCtrl::GetTime method to initialize a COleDateTime object.
(2) use COleDateTime::+= operator to add a day, for instance
myDateTime += COleDateTimeSpan(1,0,0,0);
(3) pass the updated COleDateTime object to CDateTimeCtrl::SetTime method.
(4) cross you fingers.
[added]
I missed 'OleDate' on the Span temporary...
[/added]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
modified on Monday, October 20, 2008 9:11 AM
|
|
|
|
|
Hi,
why two snmp agent processes can not be run on same machine ?
rgds,
Sakthi
Nice things do nice works
|
|
|
|
|
|
Which part of developing this application do you need help with? How are you connecting to the DB?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
anna mathew wrote: on authentication i must get connected to access database...how do i do it?
One such way is via ODBC. Have you created a DSN? If so, just derive a class from CRecordset . You can also have a DSN-less connection.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hi guys,
I hope my question will be peace of cake for you. Here it is:
CmyClass cl;
<br />
How to define it, so I can create it in a function Init() and destroy it in function FreeAll()?
If I declare it in a function it will be created and destroyed within it.
If I declare it as a global variable, it will create it in the declaration (wherever this take place in the program).
Well, I can use 'CmyClass *cl', but in the code I will have to use '->' instead of '.', which ... makes me angry.
Is there another approach?
|
|
|
|
|
Technically (AFAIK) you can't.
You may however use
- a wrapper of the class providing access to (something similar to lazy initialization or singleton patterns)
or
- use, whenever needed, a reference as alias to the dereferenced pointer to avoid pointer syntax.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
use, whenever needed, a reference as alias to the dereferenced pointer to avoid pointer syntax.
Could you give me an example?
Sorry I'm new in C++ but I'm learning very fast when I see a piece of code.
|
|
|
|
|
for instance, suppose your class having 2 methods DoSomething , JustDoAnotherThing :
CmyClass & myObj = *_pcl;
myObj.DoSomething();
myObj.JustDoAnotherThing()
...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|