Click here to Skip to main content
15,894,343 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Return From DoModal with RadioButton Pin
Victor Nijegorodov30-Jun-19 6:43
Victor Nijegorodov30-Jun-19 6:43 
AnswerRe: Return From DoModal with RadioButton Pin
Randor 30-Jun-19 7:13
professional Randor 30-Jun-19 7:13 
GeneralRe: Return From DoModal with RadioButton Pin
ForNow30-Jun-19 7:53
ForNow30-Jun-19 7:53 
GeneralRe: Return From DoModal with RadioButton Pin
Randor 30-Jun-19 8:08
professional Randor 30-Jun-19 8:08 
GeneralRe: Return From DoModal with RadioButton Pin
ForNow30-Jun-19 9:43
ForNow30-Jun-19 9:43 
PraiseRe: Return From DoModal with RadioButton Pin
Randor 30-Jun-19 14:22
professional Randor 30-Jun-19 14:22 
GeneralRe: Return From DoModal with RadioButton Pin
ForNow30-Jun-19 16:24
ForNow30-Jun-19 16:24 
AnswerRe: Return From DoModal with RadioButton Pin
Randor 30-Jun-19 17:34
professional Randor 30-Jun-19 17:34 
ForNow wrote:
only one Issue UpdateData seems to always return TRUE

That means UpdateData() succeeded. Can you explain to me why you need UpdateData to fail?

ForNow wrote:
even if I call pDX->fail

With my experience I am going to make a strong inference that your pDX variable is a pointer to a CDataExchange object. Can you explain to me why you need this to fail? If this fails a runtime error will be thrown... I can't even think of a valid reason you would want this.

The source for UpdateData() is inside wincore.cpp and you will find that the UpdateData() function constructs a new CDataExchange object and attaches it to your Cwnd object and performs DDX through there.

In other words... your line of code inside your class:
C++
pDX->Fail(); // This fails because it's a pointer to another CDataExchange object.

You should to open [Your Visual Studio Path]\VC\atlmfc\src\mfc\wincore.cpp and scroll down to the Updatedata() implementation where you will immediately understand why UpdateData() always returns TRUE; It creates a new CDataExchange object inside the function. You cannot force UpdateData() to fail by manipulating an external object.

Best Wishes,
-David Delaune
GeneralRe: Return From DoModal with RadioButton Pin
Victor Nijegorodov30-Jun-19 21:37
Victor Nijegorodov30-Jun-19 21:37 
GeneralRe: Return From DoModal with RadioButton Pin
Randor 30-Jun-19 22:38
professional Randor 30-Jun-19 22:38 
QuestionHRESULT variable returning negative value Pin
Member 1449956328-Jun-19 5:58
Member 1449956328-Jun-19 5:58 
AnswerRe: HRESULT variable returning negative value Pin
jeron128-Jun-19 6:15
jeron128-Jun-19 6:15 
GeneralRe: HRESULT variable returning negative value Pin
Member 1449956328-Jun-19 6:57
Member 1449956328-Jun-19 6:57 
AnswerRe: HRESULT variable returning negative value Pin
Victor Nijegorodov28-Jun-19 7:42
Victor Nijegorodov28-Jun-19 7:42 
GeneralRe: HRESULT variable returning negative value Pin
Member 1449956328-Jun-19 8:48
Member 1449956328-Jun-19 8:48 
GeneralRe: HRESULT variable returning negative value Pin
Richard MacCutchan29-Jun-19 7:23
mveRichard MacCutchan29-Jun-19 7:23 
GeneralRe: HRESULT variable returning negative value Pin
jschell30-Jun-19 7:14
jschell30-Jun-19 7:14 
GeneralRe: HRESULT variable returning negative value Pin
Richard MacCutchan30-Jun-19 10:14
mveRichard MacCutchan30-Jun-19 10:14 
AnswerRe: HRESULT variable returning negative value Pin
Stefan_Lang30-Jun-19 22:09
Stefan_Lang30-Jun-19 22:09 
PraiseRe: HRESULT variable returning negative value Pin
Member 144995631-Jul-19 4:05
Member 144995631-Jul-19 4:05 
GeneralRe: HRESULT variable returning negative value Pin
Stefan_Lang1-Jul-19 21:31
Stefan_Lang1-Jul-19 21:31 
GeneralRe: HRESULT variable returning negative value Pin
Member 144995632-Jul-19 6:29
Member 144995632-Jul-19 6:29 
QuestionHook stops application Pin
Mark_G0027-Jun-19 5:34
Mark_G0027-Jun-19 5:34 
AnswerRe: Hook stops application Pin
leon de boer27-Jun-19 7:13
leon de boer27-Jun-19 7:13 
GeneralRe: Hook stops application Pin
Mark_G0028-Jun-19 3:23
Mark_G0028-Jun-19 3:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.