|
Sorry I forgot to mention that I use Visual studio 2003. You probably reger to VStudio 6, don't you?
|
|
|
|
|
Arris7 wrote: You probably reger to VStudio 6, don't you?
Yes. Do the two versions differ in this regard? If so, then just add the items at runtime.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
\; ?
otherwise, the only solution is to populate programmaticaly in the OnInitDialog() function
|
|
|
|
|
Thnks,
Unfortunately it doesn't work
|
|
|
|
|
so, go for programmatical initialization
|
|
|
|
|
hi i have to read a file which will be
IP Address: 192.168.168.93
SubnetMask: 255.255.255.0
Default Gateway: 192.168.168.168
GatewayMetric: 1
InterfaceMetric: 0
Statically Configured DNS Servers: 202.144.10.50
202.144.13.50
i have to read only the values ie only 19.168.168.93 not any other strings. how to do this. pls help me
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
algorithm :
while EOF not reached
read line
find the position of the ':' character
extract from the current position, until the end of the line the characters
eventually trim (left and right) the residual white space characters
end while
|
|
|
|
|
Google fstream, it's the header that contains the classes to do all of this. An ifstream is what you need.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Read each line of the file until you find one that begins with "IP Address: ", then take the remainder of that line.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hey guys,
I'm having a problem with a variable within a function. This variable is set to zero at the begging of the block, and used as an index for a few arrays. The ONLY place where it is changed is in the for(...; ...; Channel++) portion of the loop. Somehow this number is being set to -1. The range for this int 0 - 7. Any clues what could be happening?
I win because I have the most fun in life...
|
|
|
|
|
any chance to see a relevant piece of code ?
|
|
|
|
|
<br />
int Channel; <br />
for( Channel = 0; Channel < NumberOfChannels; Channel++ )<br />
{<br />
Dat = (unsigned char*)m_Dither.Dat[Channel];<br />
Out = (unsigned char*)lpDithered->Data[Channel]; <br />
ChannelData = &(lpDthrCtrl->Data[Channel]);<br />
<br />
memset(Out,0x00,OutLen);<br />
<br />
there is a lot more going on under this portion, but this is the only place that Channel is used.
I win because I have the most fun in life...
|
|
|
|
|
you say it then equals -1.
where have you tested this value.
have you tried to set breakpoints and use your debugger to find out exactly where the change occurs ?
|
|
|
|
|
Im using VS2005, and i test the value using break points and checking the locals portion of the debugger. i do a conditional break at the beginning of the block if (Channel = -1). I also break at the the two function calls within this block. None of these functions take Channel as an argument. I also break at the end of the block to check Channel. Now it is impossible to check the value at each break all the time, because this function is called roughly a million times(deals with individual pixels split into various ink channels for images ~150+ Mb).
I win because I have the most fun in life...
|
|
|
|
|
VonHagNDaz wrote: if (Channel = -1).
!!!
man, it should be this :
if (Channel <code>==</code> -1)
by using = instead of == , you're assigning it !
|
|
|
|
|
typo, but thats the statement for the conditional breakpoint, its not in the code. I just found out about those today, i like em
I win because I have the most fun in life...
|
|
|
|
|
toxcct wrote: man, it should be this :
if (Channel == -1)
by using = instead of ==, you're assigning it !
Does the debugger differentiate between == (compare) and = (assign)?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
since this is a conditional break, no assignments are made. this is a feature within the vs2005 debugger. im not sure of all the ins and outs because i just found out about it today
I win because I have the most fun in life...
|
|
|
|
|
VonHagNDaz wrote: this is a feature within the vs2005 debugger.
I suspected such, hence my question to toxcct for clarification.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Actually, it should be written thus:
if (-1 == Channel)
so if you mistakenly use = instead of == the compiler will puke.
If you get in the habit of putting the constant on the left side of the equation it'll save you many headaches.
|
|
|
|
|
yeah, i know this, but I don't like it ! lol
but for beginners, (for which the chance to fall in the trap is approaching the 100%), they should take this habbit...
|
|
|
|
|
VonHagNDaz wrote: for( Channel = 0; Channel < NumberOfChannels; Channel++ )
What is NumberOfChannels ? What is its value?
Would it be possible to comment out everything in the for loop?
VonHagNDaz wrote: memset(Out,0x00,OutLen);
What is Out ? What is the value of OutLen ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
number of channels represents the differnt ink cartridges inside of the E*s*n printers we are modifying. 1 - 8 for dual CMYK printing.
I cant comment these out because they access the arrays(one for each channel) which the pixel information for each ink channel is stored.
Out is the pixel data for that channel, and OutLen is the length of the data that is expected. say 16 pixel wide image, four ink channels, you would end up with four arrays each containing the color data for that specific channel for each pixel.
I win because I have the most fun in life...
|
|
|
|
|
VonHagNDaz wrote: number of channels represents the differnt ink cartridges inside of the E*s*n printers we are modifying. 1 - 8 for dual CMYK printing...Out is the pixel data for that channel, and OutLen is the length of the data that is expected. say 16 pixel wide image, four ink channels, you would end up with four arrays each containing the color data for that specific channel for each pixel.
That's all well and good, but it did nothing to answer my questions. When I asked about NumberOfChannels , is it an int , short , char , etc? What value does it have (not what it should have) at the start of the for loop?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
sorry about that, Channel is an int and is set to zero at the start of the loop, out is an unsigned char*, and Outlen is and unsigned int.
I win because I have the most fun in life...
|
|
|
|