|
Makakuin wrote: It`s a pity that there`s no way to use the returned string directly.
You have to keep in mind that enums and defines are NOT strings. enum's are basically constant integers and defines are preprocessor directives that get changed out before compiling.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
sorry i misstyped getTxtVal() returns char[] not char*
|
|
|
|
|
Makakuin wrote: where CBR_9600 and ONESTOPBIT are defined by c++ like 9600 and 0.
What I want to do is store those settings in config file (doesn`t matter ini or xml) as strings CBR_9600 and ONESTOPBIT and then read them.
So why can't you? Use sprintf() , or equivalent, to format the string and then write that string to the .ini file. Are you looking for atoi() , perhaps?
Otherwise, I'm just not following what you are after. Perhaps you could show what you want the .ini file to look like.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I was doing a lot of cut and paste on several dialogs, but then I look at the resource.h file, some defines have the same value.
Are they any programs to check this file and correct the problems.
See sample below:-
#define IDC_POWER_LABEL 1742<br />
#define IDC_MAIN_RX_SQUELCH_LABEL 1743<br />
#define IDC_MODULATION_LABEL 1744<br />
#define IDC_COMBO1 1745<br />
#define IDC_COMBO_MODULATION 1746<br />
#define IDC_START_IBIT_LABEL 1746<br />
#define IDC_GUARD_RX_LABEL 1747<br />
#define IDC_TEST_TYPE_LABEL 1747<br />
#define IDC_GUARD_RX_BUTTON 1748<br />
#define IDC_IBIT_STATUS 1748<br />
#define IDC_GUARD_FREQ_LABEL 1749<br />
#define IDC_TEST_TYPE_STATUS 1749<br />
#define IDC_COMBO_GUARD_FREQ 1750<br />
#define IDC_WARNINGS_LABEL 1750<br />
#define IDC_MARITINE_SHIP_SHORE_LABEL 1751<br />
#define IDC_WARNINGS_STATUS 1751<br />
#define IDC_SHIP_SHORE_BUTTON 1752<br />
#define IDC_ERRORS_EXIST_LABEL 1752<br />
#define IDC_MARITIME_INT_USA_LABEL 1753<br />
#define IDC_ERRORS_EXIST_STATUS 1753<br />
#define IDC_INT_USA_BUTTON 1754<br />
#define IDC_SRUS_ERRORS_LABEL 1754
Help!
|
|
|
|
|
I had one problem with same IDs like your code so my suggestion use of different values.
|
|
|
|
|
WhiteSky wrote: ...my suggestion use of different values.
No kidding! He already wants unique numbers. His question was about a program to do that for him.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I think ResOrg ( found here on CP ) can do that.
|
|
|
|
|
Maximilien wrote: I think ResOrg...
Yes, I'm already aware of it.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Has this program been updated for VS 2005.
I had problems with it om VS 2003, does most of the things wright but gets IDD for the Aboutbox and Menu wrong.
Andy.
grahamfff
|
|
|
|
|
Grahamfff wrote: Has this program been updated for VS 2005.
Wouldn't know. I don't use it.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Andy202 wrote: some defines have the same value.
it doesn't matter if the relative controls are on different dialogs...
|
|
|
|
|
That's correct, you may have exactly the same control IDs in different dialog boxes.
The simplest example is: IDOK, IDCANCEL.
Regards
|
|
|
|
|
Unless you want to map the control ID to a help file context using MakeHm or something similar, in which case you want ALL controls to have unique ID within the application - at least all of them that will have context-sensitive help.
Maybe that is why he wants them all to be different.
Any sufficiently gross incompetence is nearly indistinguishable from malice.
|
|
|
|
|
Hello Everyone.
I have the following C code snippet:
long TAPEINFO(nparm, parmptr, parmdec)
WORD nparm;
BYTE **parmptr;
FINFO *parmdec;
{
....Code in the function goes here....
}
I'm not an expert by any means in C but I have done a litte C development on Linux and have never seen code like this before. The variables that are defined directly below the function header seem wierd.
The problem is a compile error stating "nparm is undefined" and pointing at nparm in the function header line.
Is the definition after the function header supossed to define nparm?
If someone could provide any feedback I'd appreciate it.
Thanks.
|
|
|
|
|
It is an old Kernighan and Ritchie (K & R) style function equivalent to
long TAPEINFO(WORD nparm, BYTE **parmptr, FINFO *parmdec)
{
.........
}
|
|
|
|
|
Do you think the compile error could be because the compiler doesn't recognize the syntax? Here is the compiler output:
"usrfunct.c", line 91: error #2020: identifier "nparm" is undefined
long TAPEINFO(nparm, parmptr, parmdec)
^
"usrfunct.c", line 91: error #2020: identifier "parmptr" is undefined
long TAPEINFO(nparm, parmptr, parmdec)
^
"usrfunct.c", line 91: error #2020: identifier "parmdec" is undefined
long TAPEINFO(nparm, parmptr, parmdec)
^
"usrfunct.c", line 92: error #2130: expected a "{"
WORD nparm;
I've actually been emailed the source and just asked to see if I can figure out why it won't compile. I think it is an HP UNIX box. By looking at the make log it seems like the compiler is called aCC. Once again never seen this but have never worked with C on HP UNIX before.
Thanks for your help.
|
|
|
|
|
What compiler and version are you using?
CC is usually an environment variable pointing to whatever C-compiler you want to use. Typically, you will see the makefile (or configure script) have something along the lines of:
CC=gcc
...
$(CC) $(CFLAGS) usrfunct.c
Depending on what compiler you are using, you may have to set a flag to allow it to read old-style syntax (K&R C).
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Sounds like a strong possibility which is easily checked.
Three options:
1. Just convert the function over from K&R style parm list to an ANSI style list and give it a try.
2. Do a man on aCC and try and figure out what compiler flag enables K&R.
3. You should be able to do something like is done is this example because I believe all ANSI compilers predefine __STDDC__:
#ifdef __STDC__
void psm_update_cfg_srcs(UINT16 srcs, UINT16 installed, UINT16 present,
UINT16 enabled)
#else
void psm_update_cfg_srcs(srcs, installed, present, enabled)
UINT16 srcs;
UINT16 installed;
UINT16 present;
UINT16 enabled;
#endif
|
|
|
|
|
It's the orginial C syntax before the ANSI C standards. The first edition of The C Programming Language was written in this style. You should be able to get a used copy on Amazon.com. People usually refer it as K&R C.
|
|
|
|
|
How can I set the default WWW page from my C++ programm?
(When I am starting Internet Explorer, there is a Start WWW page).
Regards
mwgomez
Poland
|
|
|
|
|
Hi,
You can set Home Page (formerly Start page) by modifying following registry entry:
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\Start Page
There's also Micro$oft's default value called First Home Page .
Regards
Galatei
Poland
|
|
|
|
|
I want to segment images and select a segmented region using mouse. Thanks million.
|
|
|
|
|
|
I want to open a window in full screen mode.. how can I do that?
|
|
|
|
|