MDI document template
Tae-Yong Kim -- taeyong@graphics.usc.edu
Sunday, December 08, 1996
Environment : MSVC++ 4.0 , Win 95
Hi~ all.
I want to use 3 differenet document types with different file extensions.
My reference book says that MDI document template class automatically detects the right document object based on the file extension.
But,I can't find any way to specify the file extension for each document.
Is there any function? or should I edit the resources?
Can anybody show me how to do this?
I want to create a new child frame window with a new document in MDI framework as a response to user input(i,e pushing menu button..etc). The problem is that document should be provided to user as filled(with some predefined data). Is there any way to handle this?
Thanks.
--
=============================================================================
Tae-Yong Kim(taeyong@graphics.usc.edu) Office:213-740-4776
Computer Science Pager:213-719-2165
University of Southern California Http://www-scf.usc.edu/~taeyongk
+---------------------------------------------------------------+
| o | -_-;;
| |\|\ o |
| __ / | ` ______|\\_ |Like to
| . \/ < \ \/ >\ |Play
| \ \ / \_ |Racketball?
==============================================================================
Daniel Munoz -- dmunoz@socabim.fr
Wednesday, December 11, 1996
[Mini-digest: 9 responses]
Environment: VC++ 4.2, Win 95, NT 3.51, NT 4.00
Hi,=20
You shoulld have more than one string like this one in your string table
(one by Document type)
IDR_SHEETTYPE "\nSheet\nWorksheet\nWorksheets (*.myc)\n.myc\n
MyCalcSheet\nMyCalc Worksheet"
and add more than one call to AddDocTemplate in your InitInstance (you
should execute a "new CEvaDocTemplate" per Document type)=20
See the CDocTemplate::CDoctemplate online help for a description of this
string.
Then, you can fill the new child frame in it's own constructor or
OnInitialUpdate () mapped function.
Daniel Munoz
SOCABIM, France.
-----From: "Kenneth A. Argo"
When you register your document template you should be creating an =3D
instance of a CMultiDocTemplate. The second parameter to the =3D
constructor is an ID of a string resource. This string resource =3D
provides a number of pieces of information to the document including the =
=3D
file extention, titlebar ...
Ken
----------
From: Tae-Yong Kim[SMTP:taeyong@graphics.usc.edu]
Sent: Sunday, December 08, 1996 8:14 PM
To: mfc-l@netcom.com
Subject: MDI document template
Environment : MSVC++ 4.0 , Win 95
Hi~ all.
I want to use 3 differenet document types with different file =3D
extensions.
My reference book says that MDI document template class automatically =3D
detects the right document object based on the file extension.
But,I can't find any way to specify the file extension for each =3D
document.
Is there any function? or should I edit the resources?
Can anybody show me how to do this?
I want to create a new child frame window with a new document in MDI =3D
framework as a response to user input(i,e pushing menu button..etc). The =
=3D
problem is that document should be provided to user as filled(with some =3D
predefined data). Is there any way to handle this?
Thanks.
--=3D20
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D=
3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D=
3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D=
3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D
=3D3D=3D3D
Tae-Yong Kim(taeyong@graphics.usc.edu) Office:213-740-4776
Computer Science Pager:213-719-2165
University of Southern California =3D
Http://www-scf.usc.edu/~taeyongk
+---------------------------------------------------------------+
| o | =3D
-_-;; =3D20
| |\|\ o |
| __ / | ` ______|\\_ |Like to =
=3D
=3D20
| . \/ < \ \/ >\ |Play
| \ \ / \_ |Racketball?
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D=
3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D=
3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D=
3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D
=3D3D=3D3D=3D3D
-----From: Mike Marshall
You need to specify the extension in the string resource associated =3D
with
your document. When you create the doc template, you specify a resource
ID that is used for the menu, icon, accelerator table and string =3D
resource
for your document. =3D20
For example:
---
CMultiDocTemplate* pDocTemplate;
pDocTemplate =3D3D new CMultiDocTemplate(
IDR_TESTTYPE,
RUNTIME_CLASS(CTestDocument),
RUNTIME_CLASS(CChildFrame),=3D20
RUNTIME_CLASS(CTestView));
AddDocTemplate(pDocTemplate);
----
In this case, IDR_TESTTYPE would be the resource identifier=3D20
associated with your new document type.
So now you go to the string table entry for IDR_TESTTYPE,
it will look something like this:
\nTest\nTest\n\n\nTest.Document\nTest Document
If you look at the documentation for GetDocString,
it explains each entry between the newline characters.
The fifth entry is the extension for the document type,
so if I added the extension .tst to my string, it would
look like this:
\nTest\nTest\n\n.xls\nTest.Document\nTest Document
Your should add additional information to the string to
allow your document type to appear in the File New
dialog and to be registered properly with Explorer.
Read the documentation for GetDocString for full details.
Incidently, you can also change these settings for your
initial document type in step 4 of the AppWizard by
clicking the "Advanced" button.
For your second question, initialize your document data in
your derived documnents class' OnNewDocument handler.
hope this helps,
Mike
----------
From: Tae-Yong Kim[SMTP:taeyong@graphics.usc.edu]
Sent: Sunday, December 08, 1996 11:14 AM
To: mfc-l@netcom.com
Subject: MDI document template
Environment : MSVC++ 4.0 , Win 95
Hi~ all.
I want to use 3 differenet document types with different file =3D
extensions.
My reference book says that MDI document template class automatically =3D
detects the right document object based on the file extension.
But,I can't find any way to specify the file extension for each =3D
document.
Is there any function? or should I edit the resources?
Can anybody show me how to do this?
I want to create a new child frame window with a new document in MDI =3D
framework as a response to user input(i,e pushing menu button..etc). The =
=3D
problem is that document should be provided to user as filled(with some =3D
predefined data). Is there any way to handle this?
Thanks.
--=3D20
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D=
3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D=
3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D=
3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D
=3D3D=3D3D
Tae-Yong Kim(taeyong@graphics.usc.edu) Office:213-740-4776
Computer Science Pager:213-719-2165
University of Southern California =3D
Http://www-scf.usc.edu/~taeyongk
+---------------------------------------------------------------+
| o | =3D
-_-;; =3D20
| |\|\ o |
| __ / | ` ______|\\_ |Like to =
=3D
=3D20
| . \/ < \ \/ >\ |Play
| \ \ / \_ |Racketball?
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D=
3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D=
3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D=
3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D
=3D3D=3D3D=3D3D
-----From: "Doug Brubacher"
Tae-Yong Kim
=20
Yes you should edit the string resource for your document templates.
From the MFC documentation:
=20
CMultiDocTemplate::CMultiDocTemplate
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
CMultiDocTemplate( UINT nIDResource, CRuntimeClass* pDocClass,=20
CRuntimeClass* pFrameClass, CRuntimeClass* pViewClass );
=20
Parameters
nIDResource Specifies the ID of the resources used with the docume=
nt=20
type. This may include menu, icon, accelerator table, and string=20
resources.=20
The string resource consists of up to seven substrings separated by=20
the `\n' character (the `\n' character is needed as a place holder i=
f=20
a substring is not included; however, trailing `\n' characters are n=
ot=20
necessary); these substrings describe the document type. For=20
information on the substrings, see CDocTemplate::GetDocString. This=20
string resource is found in the application's resource file. For=20
example:
=20
// MYCALC.RC
STRINGTABLE PRELOAD DISCARDABLE
BEGIN
IDR_SHEETTYPE "\nSheet\nWorksheet\nWorksheets (*.myc)\n.myc\n=20
MyCalcSheet\nMyCalc Worksheet"
END
=20
CDocTemplate::GetDocString
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
virtual BOOL GetDocString( CString& rString, enum DocStringIndex ind=
ex=20
) const;
=20
Return Value
Nonzero if the specified substring was found; otherwise 0.
Parameters
rString A reference to a CString object that will contain the stri=
ng=20
when the function returns.
index An index of the substring being retrieved from the string th=
at=20
describes the document type. This parameter can have one of the=20
following values:
z CDocTemplate::windowTitle Name that appears in the application=20
window's title bar (for example, "Microsoft Excel"). Present only in=
=20
the document template for SDI applications.
z CDocTemplate::docName Root for the default document name (for=20
example, "Sheet"). This root, plus a number, is used for the default=
=20
name of a new document of this type whenever the user chooses the Ne=
w=20
command from the File menu (for example, "Sheet1" or "Sheet2"). If n=
ot=20
specified, "Untitled" is used as the default.
z CDocTemplate::fileNewName Name of this document type. If the=20
application supports more than one type of document, this string is=20
displayed in the File New dialog box (for example, "Worksheet"). If=20
not specified, the document type is inaccessible using the File New=20
command.
z CDocTemplate::filterName Description of the document type and a=
=20
wildcard filter matching documents of this type. This string is=20
displayed in the List Files Of Type drop-down list in the File Open=20
dialog box (for example, "Worksheets (*.xls)"). If not specified, th=
e=20
document type is inaccessible using the File Open command.=20
z CDocTemplate::filterExt Extension for documents of this type (f=
or=20
example, ".xls"). If not specified, the document type is inaccessibl=
e=20
using the File Open command.=20
z CDocTemplate::regFileTypeId Identifier for the document type to=
=20
be stored in the registration database maintained by Windows. This=20
string is for internal use only (for example, "ExcelWorksheet"). If=20
not specified, the document type cannot be registered with the Windo=
ws=20
File Manager.
z CDocTemplate::regFileTypeName Name of the document type to be=20
stored in the registration database. This string may be displayed in=
=20
dialog boxes of applications that access the registration database=20
(for example, "Microsoft Excel Worksheet").
=20
Regards,
=20
Doug Brubacher
DouglasB@msn.com
-----From: mathias.olausson@lig.linnedata.se (Mathias Olausson)
>I want to use 3 differenet document types with different file extension=3D
s.
>My reference book says that MDI document template class automatically d=3D
etects the right >document object based on the file extension.
>But,I can=3D27t find any way to specify the file extension for each docu=
m=3D
ent.
>Is there any function? or should I edit the resources?
>Can anybody show me how to do this?
See the help section on constructing a CMultiDocTemplate. For each docum=3D
ent type
you would typically create a different resource string which contains in=3D
fo on what file-
type is associated with this particular document type.
Something like this would do the trick:
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D=
3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D=
3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D
=3D3D=3D3D=3D3D=3D3D
=3D5Bin .rc file/string table=3D5D
IDR=3D5FMYDOCTYPE1 =3D22=3D5CnSheet=3D5CnWorksheet=3D5CnWorksheets (=3D2A=
.myc)=3D5Cn.m=3D
yc=3D5Cn MyCalcSheet=3D5Cn
=3D09MyCalc Worksheet=3D22
IDR=3D5FMYDOCTYPE2 =3D22=3D5CnSheet=3D5CnWorksheet=3D5CnWorksheets (=3D2A=
.aaa)=3D5Cn.a=3D
aa=3D5Cn MyCalcSheet=3D5Cn
=3D09MyOtherCalc Worksheet=3D22
=3D5Bin sourcefile, when constructing doctemplates=3D5D
m=3D5FpDocTemplate1 =3D3D new CMultiDocTemplate(
=3D09IDR=3D5FMYDOCTYPE1,
=3D09RUNTIME=3D5FCLASS(CMyDoc),
=3D09RUNTIME=3D5FCLASS(CMDIChild), =20
=3D09RUNTIME=3D5FCLASS(CMyView))=3D3B
=3D09AddDocTemplate(m=3D5FpDocTemplate1)=3D3B
m=3D5FpDocTemplate2 =3D3D new CMultiDocTemplate(
=3D09IDR=3D5FMYDOCTYPE2,
=3D09RUNTIME=3D5FCLASS(CMyOtherDoc),
=3D09RUNTIME=3D5FCLASS(CMDIChild), =20
=3D09RUNTIME=3D5FCLASS(CMyOtherView))=3D3B
=3D09AddDocTemplate(m=3D5FpDocTemplate2)=3D3B
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D=
3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D=
3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D
=3D3D=3D3D=3D3D=3D3D
// Mathias Olausson
mathias.olausson=3D40lig.linnedata.se
-----From: Mao Zhihong
Hi, taeyong,
>Environment : MSVC++ 4.0 , Win 95
> Hi~ all.
> I want to use 3 differenet document types with different file exten=
sions.
> My reference book says that MDI document template class automatical=
ly detects the >right document object based on the file extension.
> But,I can't find any way to specify the file extension for each doc=
ument.
> Is there any function? or should I edit the resources?
> Can anybody show me how to do this?
It seemed that you didn't read your document carefully before you ask
this question. It is ver simple to specify the file extension for each
document. Just place the extesion in your resource's string table. The
string with id "IDR_???" is your document's description string. if u
want to know the format of string, look through on-line help for
GetDocumentString().
hope this will helpful.
Yours
Mao
--=20
"M!cr@$@ft'$ D@vbl $p cE is tHe s=E0fteSt h=E0Rd di k c mPre so@#!"
-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D=
-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D
Mao Zhihong ( Robert Mao ) DreamyRainbow Software Studio
Voc/Fax : 86-25-5408086
E-Mail : maozhihong@hotmail.com mao@seu.edu.cn
URL : http://seic3.seu.edu.cn/~mao
-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D=
-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D
-----From: Dean Grimm
You need to create a unique document string for each doc template. A =3D
document string consists of 7 fields separated by \n chars (see =3D
CDocTemplate::GetDocString for details on fields). The 4th & 5th fields =
=3D
specify the extension:
\n\n\nTxt Files (*.txt)\n.txt\n\n
\n\n\nBin Files (*.bin)\n.bin\n\n
Just create the strings with the same resource ID as the one you specify =
=3D
in the doc template constructor. The rest is automatically handled by =3D
the framework.
Dean Grimm Software Engineer / Cortron Corp.
----------
From: Tae-Yong Kim
Sent: Sunday, December 08, 1996 5:14 PM
To: mfc-l@netcom.com
Subject: MDI document template
Environment : MSVC++ 4.0 , Win 95
Hi~ all.
I want to use 3 differenet document types with different file =3D
extensions.
My reference book says that MDI document template class automatically =3D
detects the right document object based on the file extension.
But,I can't find any way to specify the file extension for each =3D
document.
Is there any function? or should I edit the resources?
Can anybody show me how to do this?
I want to create a new child frame window with a new document in MDI =3D
framework as a response to user input(i,e pushing menu button..etc). The =
=3D
problem is that document should be provided to user as filled(with some =3D
predefined data). Is there any way to handle this?
Thanks.
--=3D20
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D=
3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D=
3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D=
3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D
=3D3D=3D3D
Tae-Yong Kim(taeyong@graphics.usc.edu) Office:213-740-4776
Computer Science Pager:213-719-2165
University of Southern California =3D
Http://www-scf.usc.edu/~taeyongk
+---------------------------------------------------------------+
| o | =3D
-_-;; =3D20
| |\|\ o |
| __ / | ` ______|\\_ |Like to =
=3D
=3D20
| . \/ < \ \/ >\ |Play
| \ \ / \_ |Racketball?
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D=
3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D=
3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D
=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D=
3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D
=3D3D=3D3D=3D3D
-----From: "=3D?ISO-8859-1?Q?Guillermo_G=3DF3mez_Valc=3DE1rcel?=3D"
Hi Tae-Yong:
You must to specify this into the string resources for the ID of the
Document template. For example:
pDocTemplate =3D new CMultiDocTemplate(
IDR_PRUEBATYPE3,
RUNTIME_CLASS(CDocktestDoc),
RUNTIME_CLASS(CAbChildWnd), // standard MDI child
RUNTIME_CLASS(CResumen));
AddDocTemplate(pDocTemplate);
The string resource for IDR_PRUEBATYPE3 is :
Book\nchecks\nCheck Book\nCheck Book File
(*.chb)\n.chb\nChkBookFileType\nCheck Book File Type\nCHBK\nCheck Book
Files
Guillermo G=F3mez Valc=E1rcel.=20
Baratz, Servicios de Teledocumentaci=F3n S.A.
<http://www.baratz.es>
----------
> De: Tae-Yong Kim
> A: mfc-l@netcom.com
> Asunto: MDI document template
> Fecha: lunes 9 de diciembre de 1996 2:14
>=20
> Environment : MSVC++ 4.0 , Win 95
> Hi~ all.
> I want to use 3 differenet document types with different file extension=
s.
> My reference book says that MDI document template class automatically
detects the right document object based on the file extension.
> But,I can't find any way to specify the file extension for each documen=
t.
> Is there any function? or should I edit the resources?
> Can anybody show me how to do this?
>=20
>=20
> I want to create a new child frame window with a new document in MDI
framework as a response to user input(i,e pushing menu button..etc). The
problem is that document should be provided to user as filled(with some
predefined data). Is there any way to handle this?
>=20
> Thanks.
>=20
> --=20
>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
=3D
> Tae-Yong Kim(taeyong@graphics.usc.edu) Office:213-740-4776
> Computer Science Pager:213-719-2165
> University of Southern California Http://www-scf.usc.edu/~taeyon=
gk
> +---------------------------------------------------------------+
> | o | -_-=
;;
=20
> | |\|\ o |
> | __ / | ` ______|\\_ |Like to =
=20
=20
> | . \/ < \ \/ >\ |Play
> | \ \ / \_ |Racketball?
>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
=3D=3D
-----From: kevin@earth.pln.com.tw (Kevin Tarn)
Try these steps :
1. To specify different resource ID to your CMultiDocTemplate's=20
constructors.
m_pDocTemplate1 =3D new CMultiDocTemplate(
IDR_TYPE1,
RUNTIME_CLASS(CMyDoc1),
RUNTIME_CLASS(CMDIChildWnd),
RUNTIME_CLASS(CMyForm1));
AddDocTemplate(m_pDocTemplate1);
m_pDocTemplate2 =3D new CMultiDocTemplate(
IDR_TYPE2,
RUNTIME_CLASS(CMyDoc2),
RUNTIME_CLASS(CMDIChildWnd),
RUNTIME_CLASS(CMyForm2));
AddDocTemplate(m_pDocTemplate2);
2. To specify different icons and menus for IDR_TYPE1 and IDR_TYPE2 in y=
our=20
RC file.
3. To specify different strings for IDR_TYPE1 and IDR_TYPE2 in your stri=
ng=20
table of RC file.
Kevin Tarn
kevin@pln.com.tw
----------
=B1H=A5=F3=AA=CC: Tae-Yong Kim[SMTP:taeyong@graphics.usc.edu]
=B6=C7=B0e=A4=E9=B4=C1: 1996=A6~12=A4=EB9=A4=E9 AM 9:14
=A6=AC=A5=F3=AA=CC: mfc-l@netcom.com
=A5D=A6=AE: MDI document template
Environment : MSVC++ 4.0 , Win 95
Hi~ all.
I want to use 3 differenet document types with different file extensions.
My reference book says that MDI document template class automatically=20
detects the right document object based on the file extension.
But,I can't find any way to specify the file extension for each document.
Is there any function? or should I edit the resources?
Can anybody show me how to do this?
I want to create a new child frame window with a new document in MDI=20
framework as a response to user input(i,e pushing menu button..etc). The=20
problem is that document should be provided to user as filled(with some=20
predefined data). Is there any way to handle this?
Thanks.
--
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D =20
=3D
Tae-Yong Kim(taeyong@graphics.usc.edu) Office:213-740-4776
Computer Science Pager:213-719-2165
University of Southern California Http://www-scf.usc.edu/~taeyongk
+---------------------------------------------------------------+
| o | -_-;;=
=20
| |\|\ o |
| __ / | ` ______|\\_ |Like to=20
| . \/ < \ \/ >\ |Play
| \ \ / \_ |Racketball?
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D =20
=3D=3D
| Вернуться в корень Архива
|