|
|
Hi
No, I didn't do
#include "resource.h"
but none of the other dialog classes do, and they work fine.
I think that bit is taken care of by
#include "MyApp.h"
and MyApp has the resource header included in its header.
I did edit the dialog ID in the resource editor, so that I can find the ID in Resource.h. In fact, if I search for the ID, I get 4 hits, twice in MyApp.rc, once in Resource.h and once in MyDialog.h.
I hope you can figure out the problem
|
|
|
|
|
Kiriko wrote: No, I didn't do
#include "resource.h"
but none of the other dialog classes do, and they work fine.
because it might be included by stdafx.h , isn't it ...?
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
-- modified at 6:40 Friday 10th February, 2006
|
|
|
|
|
try by including resource.h in your dialog header file
"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
|
|
|
|
|
Wow...?
It works...? (But this time I added the private variable before adding any controls.)
So, it was the resource.h.
But why?
How come it never has been a problem before?
Thanks for your help.
|
|
|
|
|
Kiriko wrote: So, it was the resource.h.
But why?
Because the header file for the application class includes resource.h.
This is standard behaviour with the appwizard for dialog applications.
Usually the only reason to include the application class header file is to have all resource IDs declared.
Unless you are doing something specific to the application class, it is sufficient to include resource.h in your dialog class header file.
--
Roger
It's supposed to be hard, otherwise anybody could do it!
|
|
|
|
|
OK, possibly a badly worded question.
My question was this:
all my dialog classes have
#include "MyApp.h"
at the top of the CPP files.
None of them have
#include "resource.h"
anywhere except for CMyApp.
However, the only one that didn't work was this latest attempt at making a dialog class. So I wanted to know what could I have possibly done to cause a problem in just my latest attempt.
Thanks in advance for explanations!
|
|
|
|
|
Kiriko wrote: The compiler reports and error on the line in the CDialog class header that says
enum { IDD = IDD_MYDIALOG };
Which usually means that the actual problem is further upstream from this enum statement.
Start at the top of the dialog's .cpp file and go through each included .h file to see what has been defined and what has not been defined.
Another alternative would be to start the project over and, assuming it does not crash during the build, compare the two projects to see what the differences are.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
I usually use messagebox to check intermediate values in a MFC application.
I have a CHAR[6] containing a hex value how do I make it to string and pass to messagebox..
Or is there another way to check the value of an integer other than messagebox during the execution of the MFC application.
- KK
|
|
|
|
|
|
works.. but
I get some charecters in the beginning
my code is
------
unsigned char baSlots[6];
m_1E2.GetLine(0,temp,12);
sscanf(temp,"%x",baSlots);
MessageBox(CString(baSlots));
----------
when I enter "123456789abc" in edit box,
I get "iiiiiiiiiiiiiiiiiii123456789abc"
- KK
|
|
|
|
|
|
Interesting, but why send temp through nData just to get to baSlots ?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Yes my mistake, sorry.
Regards
Anil
|
|
|
|
|
kk_vp wrote: unsigned char baSlots[6];
m_1E2.GetLine(0,temp,12);
sscanf(temp,"%x",baSlots);
MessageBox(CString(baSlots));
----------
when I enter "123456789abc" in edit box,
I get "iiiiiiiiiiiiiiiiiii123456789abc"
What you have here is not going to work. Not only will baSlots need to be a numeric variable, it will not come close to holding the value 0x123456789abc (roughly 20 trillion).
|
|
|
|
|
give a example of what you have and what you want?
Regards
Anil
|
|
|
|
|
kk_vp wrote: CHAR[6]
It itself is string1, exactly what problem are u facing.. are you want to convert HEX to DEC and then show on Messagebox
"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
|
|
|
|
|
|
toxcct wrote: not exactly... it will display correctly only if it is null-terminated...
Offcourse but he didn't mention that!, is he
"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
|
|
|
|
|
kk_vp wrote: Or is there another way to check the value of an integer other than messagebox during the execution of the MFC application.
Yes there is another way much more simple: use your debugger (press F5 and then you can set breakpoints with F9).
Or at least if this is used to debug your program.
|
|
|
|
|
I had tried debugger, but it was stopping somewhere and could not get it to working; but after reading your message, pressed F5 and everythingz fine. Thanks!
but when I enter 123456789abc, I get
[0x0] 0x90 ''
[0x1] 0x78 'x'
[0x2] 0x56 'V'
[0x3] 0x34 '4'
[0x4] 0xcc 'Ì'
[0x5] 0xcc 'Ì'
could be something simple.. but not finding it..
code is:
unsigned char baSlots[6];
m_1E2.GetLine(0,temp,12);
sscanf(temp,"%x",&baSlots);
- KK
|
|
|
|
|
The problem is probably here:
m_1E2.GetLine(0,temp,12);
What are you trying to do exactly ? And what is m_1E2 ? I suppose it is an edit control ?
Why do you specify 12 for the limit of the string ? It is 6 and not 12 !
|
|
|
|
|
That I had changed to check something else.
changed it back.
but still, I get
[0x0] 0x56 'V'
[0x1] 0x34 '4'
[0x2] 0x12 ''
[0x3] 0x00 ''
[0x4] 0xcc 'Ì'
[0x5] 0xcc 'Ì'
code is::
unsigned char baSlots[6];
m_1E2.GetLine(0,temp,6);
sscanf(temp,"%x",&baSlots);
- KK
|
|
|
|
|
I think I have given you tha answer in the last mail.
any way If I have done any mistake them plz let me know.
I don't thing that scanf %x in allowed for string.
%x for interger
%s for string
you have problem there only and I rectify that in the last reply.
Regards
Anil
|
|
|
|
|
i don't know what you're trying to do, but if you're assigning 123456789abc into your char[3] variable, firstly, there's not enough characters to store it, and secondly, a C-style string must be null terminated.
now, please specify what format is supposed to be the char[3] because we are blind and so cannot help you much.
if you want some help, you have to give us the minimum informations for us to understand exactly what you're doing wrong.
so start it again, ,and please answer these questions :
1. how is defined m_1E2
2. how is defined temp
3. how is initialized baSlots ?
4. what is m_1E2.GetLine() supposed to do ?
5. is your 123456789abc value an integer or a string.
6. not a question but an important point : if your writing the 123456789abc integer into the temp string, temp must be at least 13 characters wide, so that the 13st character can be '\0' (null termination)...
hope you understand now.
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
|
|
|
|