|
I don't have a Windows platform around to verify this, but I *believe* that the first document template you add to the app in InitInstance() method will be the default document type. Change that order if it is not the document type of your choice.
Best,
Jun
|
|
|
|
|
i change order but nothing happen!
i try to search to how order for handling messages!
for MDI:
1)active view object
2)the document object for the active document
3)the document template object for active document!!!
4)the frame window object of active view
5) main frame window object
6)the application object
// Thanks Ivor Horton's book!
for sdi because have one active frame it is obviously what order is!
in my code i have Dockable window that create dynamically .
in my code with CCreateContext & CFrameWnd::Create... create Frame & related view & attach them to document dynamically!
it is seems that when i create new Frame can not be active frame because after i create pane i
get active view for MDI code such that:
<br />
CMDIFrameWnd *pFrame1 = <br />
(CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;<br />
<br />
CMDIChildWnd *pChild = <br />
(CMDIChildWnd *) pFrame1->GetActiveFrame();<br />
<br />
<br />
CView * pView = pChild->GetActiveView();<br />
after debug i see pView is kind of another view that i create for pane!!!!
i try to active new frame with pFrame->GetParentFrame()->ActiveFrame(SW_RESTORE);
but nothing happen.
i have tree view class & two Document class & three template.
|
|
|
|
|
You have not specified whether the application is SDI or MDI and you have not specified what each document is for.
Is this a MDI application and is each child window a separate image? If so, then perhaps an article I wrote would help. Otherwise explain a bit more what the application is doing, especially about how the document is used.
|
|
|
|
|
File-Open is usually handled by the main frame. If you have multiple document types then the statndard behaviour is present to the user a dialog where they can choose which document type to open. The same applies for File-New.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
after some try i found , error is from my view class !!!
default CView class work properly !!! but own class that
i derived have problem when i try to OpenDocument from another
template , other CView do not work properly!
|
|
|
|
|
OK guys I received a project from a buddy, needs some work on it; however it's a sln project file in 2005 and I use 2003. I really do not want to have to install 2005, as I have no need to upgrade right now. I have seen other converters, but none to go from 2005 to 2003. Is there any other solution? Thanks.
|
|
|
|
|
I don't know of a converter, but my past experience with similar converted has been that it's better to recreate the base project with the previous IDE and then bring the files in.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
how to write a code to control the surround volumn for each?
please give me some idea and example
|
|
|
|
|
Hi!
I'm making an extension for a program (MMF2) and have run in to some problems...
The user can load a DLL, set the arguments and the call a function. All of theese at runtime. I push my values on to the stack and call the function.. That works fine.. the problem occurs when I try to pop the arguments of the stack (Need this if anyhing has changed, for instance when calling GetWindowText())...
I know the cause of this.. In MMF2 all function calls are __stdcall (or WINAPI)... Is there any workaround for this??
This is how a function looks in the SDK
long WINAPI DLLExport Function(LPRDATA rdPtr,long param1) {<br />
return 0;<br />
}
I call my function from within this function (my function is not __stcall, it's __cdecl)
Does anyone have a solution??
EDIT: I use asm for the function calling btw!
-- modified at 10:53 Thursday 14th September, 2006
|
|
|
|
|
use EXTERN "C"
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Thanks for your answer... Unfortunately this did'nt work!
|
|
|
|
|
I'm not very sure how to code this one. I have a base class and 3 derived classes. All of the derived classes need use of a timer, which I think is best to place in the base class. Is it possible for the baseclass to call derived class functions?
|
|
|
|
|
Yes, if you declare the function virtual, then if the function is redefined in the derived classes, this one will be called.
|
|
|
|
|
|
Hey, what Cedric said is called "polymorphism", which works only when you use pointers to reference objects. So this would call the overridden method:
YourBaseClass *p = new YourDerivedClass();
p->SomeFunction();
But this wouldn't:
YourBaseClass obj;
obj.SomeFunction();
Best,
Jun
|
|
|
|
|
waldermort wrote: All of the derived classes need use of a timer, which I think is best to place in the base class. Is it possible for the baseclass to call derived class functions?
Beware Active Derived Class member will receive the call!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
waldermort wrote: All of the derived classes need use of a timer, which I think is best to place in the base class. Is it possible for the baseclass to call derived class functions?
Beware Active Derived Class member will receive the call only
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi
Can anyone give me any guide lines as web searches have been unsucessful
I want to be able to save input from a console application to a text file.
eg: if a user inputs their "name" via cin on the console, how do you save the name to a text file.
I have just started learning if/ofstream classes and have a basic understanding, so if you could show me some examples of the code to save the input to a text file I would be grateful. Also I wish to append new data to the same file so if you could also advise me if the use of "ios::app" is the correct way of doing this without over writing old data.
Thanks in advance.
The problem with political jokes is they get elected.
|
|
|
|
|
To use ofstream the way you specified:
char name[20] = {0};
ofstream fout;
fout.open("mylog.log", ios::app);
cin >> name;
fout << name;
fout.close();
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Cheers Zac
Thanks for the prompt response.
Worked first time on your advise.
Many thanks.
The problem with political jokes is they get elected.
|
|
|
|
|
how do I, programmatically, get the driver's version (to simulate the device manager data --> driver's properties)?
thanx
|
|
|
|
|
Hello all..
I am very new to MFC. so please suggest me how can i create my simple .cpp file by VC++ without creating any workspace....If it is possible than plz tell me the way...
Egarly waiting for reply...Please reply soon
Thank you for reading this message....
alpa shah
|
|
|
|
|
Haven't you checked Files tab, when used New option from File menu?
|
|
|
|
|
I'm really sorry for that...but i am totally new to MFC....thanks for your help...now i will check it...and send you reply about that...
alpa shah
|
|
|
|
|
I have tried this direct file creation...but dear it didn't work..because it requires to create a workspace..so simple might not be work..that i was asking..
Againg thanks for your suggestion...and thanks for reading my question....
alpa shah
|
|
|
|