|
You said you're getting an error message. What error? What does GetLastError() return?
--Mike--
http://home.inreach.com/mdunn/
We've secretly replaced the msdn.microsoft.com servers with Atari 800XLs. Let's see if anyone notices....
|
|
|
|
|
Well, I'm not sure exactly how to use GetLastError(), but when I run the debugger I'm take to the lines
TRACE1("Error: no data exchange control with ID 0x%04X.\n", nIDC);
ASSERT(FALSE);
I would assume this means the the control ID I'm using in
DDX_Text(pDX, IDC_EDIT1, integer);
isn't linked to the control yet. I'm thinking that if I use GetDialogItem() to get a pointer to the control and then test to make sure it isn't NULL this ought to fix it, hopefully.
|
|
|
|
|
The trace message is saying there's no control in the dialog with an ID of IDC_EDIT1. Fix the ID in the DDX_Text() line.
--Mike--
http://home.inreach.com/mdunn/
We've secretly replaced the msdn.microsoft.com servers with Atari 800XLs. Let's see if anyone notices....
|
|
|
|
|
Actually, the problem is that the control isn't created until OnInitDialog() is called. DoDataExchange() is called first, before the control has been created.
|
|
|
|
|
In your OnInitDialog() function, first create the controls, then call CDialog::OnInitDialog(). CDialog::OnInitDialog calls DoDataExchange().
---
Multitasking: Screwing up several things at once.
|
|
|
|
|
DoDataExchange is called once before OnInitDialog, to update the controls.
I suppose you have to Create your control in OnCreate, not in OnInitDialog.
Hope it works,
Paolo.
|
|
|
|
|
Just out of curiousity, and to be in no way critical of your design, why are you doing things this way? Are you just experimenting to learn how things work (which is commendable), do you have some philosophical issues with doing things visually (which is debatable), or are you just trying to create controls that you can work with dynamically at runtime? (i.e. something derived from CEdit which has extended functionality). If the later is the case, I could suggest other techniques to you which you might find easier to use, as well as being safer to use within the MFC model.
|
|
|
|
|
I was wondering when someone would ask why I was doing things this way. There are many easier ways to accomplish what I'm doing. I'm just experimenting.
|
|
|
|
|
In an attempt to be cool, I am putting a Slider control into a toolbar. The only problem: registering slider events.
I know that a slider sends its parent a WM_HSCROLL message, but in this case the parent is just a toolbar. Is there a way for my CMainFrame (which owns the toolbar, naturally) to receive the event?
thanks,
Jake
|
|
|
|
|
|
More respect towards VC
Here bad words cannot be said.....
An expression from my country.
It does not give the head you?
Cheers!!!
Carlos Antollini.
|
|
|
|
|
Speaking of VC++ and how much it sucks, I've got some issues with the debugger. Has anyone, in the history of the universe, found it helpful when the debugger points to a line of "disassembly" code to point out your error? The value of that debugging technique is completely lost on me, and I was wondering how it helps anyone. Otherwise, VC++ could be worse.
|
|
|
|
|
It certainly leaves a lot to be desired in many ways. But I would hate to write a large, complex windows app without it! If you had been around pre-1993 trying to put together a large windows app (not a little in-house job that VB is for) you would appreciate it more.
|
|
|
|
|
Yes, this is often extremely helpful. Learning a little asm will be well worth your time.
Oh, and the VC++ debugger is pretty good, for user mode programs at least. What have you used that's any better??
|
|
|
|
|
SoftICE
-Ben
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
it helps sometimes if i'm doing low-level optimizations. but, i could easily get along without it. benchmarking is usually a better way of telling which tricks are faster.
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
Well, perhaps ppl, like experts use it.
|
|
|
|
|
John Robbins excellent book 'Debugging Windows' tells you how to figure what line of code you crashed on using the disassembly window. It also tells you how to write crash handlers and lots of cool stuff. It's not just about how to push F10 and F11 in the debug Window ( like the useless 'Desigining user interfaces' book, has anyone actually *bought* that. No weait, don't tell me. ).
Anyone who doesn't have this book should buy it.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Christian, do you mean "Debugging Applications" by Robbins? That was the only one I saw on Amazon.
|
|
|
|
|
Yes, sorry
Buy it, buy it, buy it !!!!!
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
|
C++ Builder is much better than VC++.
|
|
|
|
|
so go use c++ builder and leave us in peace
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Would you care to elaborate? I have used both and personally feel VC++ to be superior.
|
|
|
|
|
Yeps and there tons of examples and documentation, we also have a MSDN with tons or resources.
Obviously the above statement is a complete lie and thats why I use Visual C++ and not C++ builder.
C++ Builder is for C++ programmers you cant program.
|
|
|
|