15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Replacing the DDX_Text error message

Amir Shoval -- amirs@ncc.co.il
Tuesday, January 21, 1997

Environment: MSVC 4.2b, Win 95

Hello,

I'm using DDX_Text for getting text the user entered in an edit box (not
necessarily in DoDataExchange).
If the text entered is not in the right format, DDX_Text displays an
error
message. I traced MFC's code a little and found the following #defines
in afxres.h:
// DDV parse errors
#define AFX_IDP_PARSE_INT               0xF110
#define AFX_IDP_PARSE_REAL              0xF111
#define AFX_IDP_PARSE_INT_RANGE         0xF112
#define AFX_IDP_PARSE_REAL_RANGE        0xF113
#define AFX_IDP_PARSE_STRING_SIZE       0xF114
#define AFX_IDP_PARSE_RADIO_BUTTON      0xF115
#define AFX_IDP_PARSE_BYTE              0xF116
#define AFX_IDP_PARSE_UINT              0xF117
#define AFX_IDP_PARSE_DATETIME          0xF118
#define AFX_IDP_PARSE_CURRENCY          0xF119

but couldn't find the string resources themselves.
How can I display another message (my own)? Do I have to write my own
DDX_Text method?

	10x
		Amir
--------------------------------------
Amir Shoval          N.C.C. 
amirs@ncc.co.il
--------------------------------------



SCS.010@mch.scn.de
Thursday, January 23, 1997

[Mini-digest: 6 responses]

Hi,

You can find the resources in the file afxres.rc. Just put the resources in 
your resource file and rename the strings to whatever you want. You need 
not write your own DDX methods.

Tarun Mehta.
-------------
Original Text
>From Amir Shoval , on 1/23/97 3:40 PM:
Environment: MSVC 4.2b, Win 95

Hello,

I'm using DDX_Text for getting text the user entered in an edit box (not
necessarily in DoDataExchange).
If the text entered is not in the right format, DDX_Text displays an
error
message. I traced MFC's code a little and found the following #defines
in afxres.h:
// DDV parse errors
#define AFX_IDP_PARSE_INT               0xF110
#define AFX_IDP_PARSE_REAL              0xF111
#define AFX_IDP_PARSE_INT_RANGE         0xF112
#define AFX_IDP_PARSE_REAL_RANGE        0xF113
#define AFX_IDP_PARSE_STRING_SIZE       0xF114
#define AFX_IDP_PARSE_RADIO_BUTTON      0xF115
#define AFX_IDP_PARSE_BYTE              0xF116
#define AFX_IDP_PARSE_UINT              0xF117
#define AFX_IDP_PARSE_DATETIME          0xF118
#define AFX_IDP_PARSE_CURRENCY          0xF119

but couldn't find the string resources themselves.
How can I display another message (my own)? Do I have to write my own
DDX_Text method?

	10x
		Amir
--------------------------------------
Amir Shoval          N.C.C. 
amirs@ncc.co.il
--------------------------------------
-----From: "Dmitry A. Dulepov" 

        [Mailer: "Groupware E-Mail". Version 1.03.000]

>        [From: Amir Shoval

>I'm using DDX_Text for getting text the user entered in an edit box (not
>necessarily in DoDataExchange).
>If the text entered is not in the right format, DDX_Text displays an
>error
>message. I traced MFC's code a little and found the following #defines
>in afxres.h:
>// DDV parse errors
>#define AFX_IDP_PARSE_INT               0xF110
    ...
>#define AFX_IDP_PARSE_CURRENCY          0xF119
>
>but couldn't find the string resources themselves.

See afxres.rc in MFCs INCLUDE directory.

>How can I display another message (my own)? Do I have to write my own
>DDX_Text method?

Yes. This is described in details in online help.


Dmitry A. Dulepov
Samsung Electronics Co., Ltd.
Russian Research Center
Phone: +7 (095) 213-9207
Fax: +7 (095) 213-9196
E-mail: dima@src.samsung.ru
====================================

-----From: David Little 

Most, if not all, the AFX strings are in your projects .RC file....Just =
open your resources.  Anyway, whats was wrong with =
GetDlgItemText(IDC_MYEDITBOX, someCString); ?



----------
From: 	Amir Shoval[SMTP:amirs@ncc.co.il]
Sent: 	Tuesday, January 21, 1997 5:49 AM
To: 	'MFC list'
Subject: 	Replacing the DDX_Text error message

Environment: MSVC 4.2b, Win 95

Hello,

I'm using DDX_Text for getting text the user entered in an edit box (not
necessarily in DoDataExchange).
If the text entered is not in the right format, DDX_Text displays an
error
message. I traced MFC's code a little and found the following #defines
in afxres.h:
// DDV parse errors
#define AFX_IDP_PARSE_INT               0xF110
#define AFX_IDP_PARSE_REAL              0xF111
#define AFX_IDP_PARSE_INT_RANGE         0xF112
#define AFX_IDP_PARSE_REAL_RANGE        0xF113
#define AFX_IDP_PARSE_STRING_SIZE       0xF114
#define AFX_IDP_PARSE_RADIO_BUTTON      0xF115
#define AFX_IDP_PARSE_BYTE              0xF116
#define AFX_IDP_PARSE_UINT              0xF117
#define AFX_IDP_PARSE_DATETIME          0xF118
#define AFX_IDP_PARSE_CURRENCY          0xF119

but couldn't find the string resources themselves.
How can I display another message (my own)? Do I have to write my own
DDX_Text method?

	10x
		Amir
--------------------------------------
Amir Shoval          N.C.C.=20
amirs@ncc.co.il
--------------------------------------
-----From: Mario Contestabile

>but couldn't find the string resources themselves.
>How can I display another message (my own)? Do I have to write my own
>DDX_Text method?

That's what I do. The messages are called by DDV_xxx. So write
your own DDV_MyMaxWhatever(). In it, you can even call
::DDV_MaxChars(..) for example so under the new shell it'll beep
when the maximum is reached. And if the string is invalid call
pdx->Fail()

mcontest@universal.com

-----From: "Kenneth A. Argo" 

The string is in "MFC\INCLUDE\AFXRES.RC"

Ken



----------
From:  Amir Shoval[SMTP:amirs@ncc.co.il]
Sent:  Tuesday, January 21, 1997 6:50 AM
To:  'MFC list'
Subject:  Replacing the DDX_Text error message

Environment: MSVC 4.2b, Win 95

Hello,

I'm using DDX_Text for getting text the user entered in an edit box (not
necessarily in DoDataExchange).
If the text entered is not in the right format, DDX_Text displays an
error
message. I traced MFC's code a little and found the following #defines
in afxres.h:
// DDV parse errors
#define AFX_IDP_PARSE_INT               0xF110
#define AFX_IDP_PARSE_REAL              0xF111
#define AFX_IDP_PARSE_INT_RANGE         0xF112
#define AFX_IDP_PARSE_REAL_RANGE        0xF113
#define AFX_IDP_PARSE_STRING_SIZE       0xF114
#define AFX_IDP_PARSE_RADIO_BUTTON      0xF115
#define AFX_IDP_PARSE_BYTE              0xF116
#define AFX_IDP_PARSE_UINT              0xF117
#define AFX_IDP_PARSE_DATETIME          0xF118
#define AFX_IDP_PARSE_CURRENCY          0xF119

but couldn't find the string resources themselves.
How can I display another message (my own)? Do I have to write my own
DDX_Text method?

	10x
		Amir
--------------------------------------
Amir Shoval          N.C.C. 
amirs@ncc.co.il
--------------------------------------

-----From: Jim Lawson Williams 

At 01:49 PM 21/01/97 +0200, Amir Shoval  wrote:
>Environment: MSVC 4.2b, Win 95
>
>Hello,
>
>I'm using DDX_Text for getting text the user entered in an edit box (not
>necessarily in DoDataExchange).
>If the text entered is not in the right format, DDX_Text displays an
>error
>message. I traced MFC's code a little and found the following #defines
>in afxres.h:
>// DDV parse errors
>#define AFX_IDP_PARSE_INT               0xF110

     

>but couldn't find the string resources themselves.
>How can I display another message (my own)? Do I have to write my own
>DDX_Text method?
>
G'day!
See "TN026: DDX and DDV Routines".  The default text is part of the language subsystem to enable "internationalization":  to all intents and purposes, unreachable.

Regards,
Jim LW



>From the BBC's "Barchester Chronicles":

    "I know that ultimately we are not supposed to understand.
    But I also know that we must try."

       -- the Reverend Septimus Harding, crypt-analyst, clog-dancer, C++ programmer



Amir Shoval -- amirs@ncc.co.il
Saturday, January 25, 1997

Hello Katy,

First, thanks for your help. Second, I'm developing in Hebrew (not
Italian...).
Meanwhile, I found out how to do it. Yes, you should change afxres.rc,
but=20
there's no need writing your own routines. As TN057 specifies, you
should
include the changed afxres.rc (the localized one) into your project and
- by
specifying compiler directives - tell MFC to use it. No source changes
are
needed, it's only a matter of resources.

	Amir
--------------------------------------------------
Amir Shoval          N.C.C. ISRAEL
                amirs@ncc.co.il
--------------------------------------------------

>----------
>From: 	ktm@ormec.com[SMTP:ktm@ormec.com]
>Sent: 	=E9=E5=ED =E7=EE=E9=F9=E9 23 =E9=F0=E5=E0=F8 1997 16:32
>To: 	Amir Shoval
>Subject: 	Re: Replacing the DDX_Text error message
>
><>
>
>




| Вернуться в корень Архива |