|
I want to display a value from the file and display it on the editbox. for example
in the file the time format is something like this
11:06:16:254
now i need to put 11 in one editbox, 06 in the next editbox and so on... that means i will have 4 edit boxes to display the time.
the file format that i have is of .dat extension. i am using mfc for this
please give me some leads.
|
|
|
|
|
You have a problem reading from the file or displaying it on the screen?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
i am able to read the data from a file but i am can display only the last value of the file. i want to display all the values in that file. i have created a timer for that which fires every one sec. what needs to be done to show all the values in the editbox.
|
|
|
|
|
Chandrasekharanp wrote: please give me some leads.
1) research the MFC library documentation for File I/O. This will provide you with the ability to open the file and read data from it.
2) research the MFC documentation for the class CString. This will provide you with solutions for separating the different parts of the time data.
3) Research the MFC CEdit control. This will lead you solutions for displaying the edit controls and setting the data into them.
4) Thank your instructor for giving you such a simple assignment.
led mike
|
|
|
|
|
Priceless[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
Wow
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Yeah hahaha, he's got a tight grip on that whole critical thinking thing eh?
led mike
|
|
|
|
|
Logic? We don't need no steenking logic!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hey what happened to CPhog?
Never mind - I restarted FF and all is well
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: Hey what happened to CPhog?
I'm using it to post this?
Damn! Missed the opportunity to say "It works on my machine!"
Last modified: 12mins after originally posted --
led mike
|
|
|
|
|
hehe see my modified post
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
You need to CFile class and CString then you can use of SetWindowText for show values on the editbox.
|
|
|
|
|
Hamid. wrote: you can use of SetWindowText for show values on the editbox
Don't you like the idea of having a member variable? Do you really need SetWindowText to set text of an edit box in MFC?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Yeah I agree with you.
|
|
|
|
|
Rajesh R Subramanian wrote: Don't you like the idea of having a member variable?
Sure, as long as it's a CEdit variable.
Rajesh R Subramanian wrote: Do you really need SetWindowText to set text of an edit box in MFC?
No, but the other alternative can, and often does, cause problems that are easily avoidable.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: Sure, as long as it's a CEdit variable.
I meant that, of course.
DavidCrow wrote: No, but the other alternative can, and often does, cause problems that are easily avoidable.
But there are circumstances when it comes very handy. And as I kept doing it, I learned my way to do it correctly. I'd agree that it may create problems though.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hello everyone,
In the Bjarne's book, there is a line of code like this,
typedef typename A::template rebind <Link>::other Link_alloc;
It means if A is allocator, we can use use to allocate arbitrary type of object instance, said by Bjarne.
I understand this statement, my question is about the grammar. Do we need the template keyword? Why?
I have tested without temlpate keyword, the code still works. Any ideas?
template <class T1> class Foo {
public:
template <class T2> class Goo {
public:
typedef T2 GooValueType;
};
};
int main()
{
Foo <int>::Goo<char>::GooValueType a1;
Foo <int>::template Goo<char>::GooValueType a2;
return 0;
}
thanks in advance,
George
|
|
|
|
|
George_George wrote: In the Bjarne's book, there is a line of code like this,
typedef typename A::template rebind ::other Link_alloc;
Whats the context? or the page number?
|
|
|
|
|
Section 19.4.1 The Standard Allocator. Any ideas?
regards,
George
|
|
|
|
|
I want to add my application in windows firewall exception list on Windows Vista.
Amar
|
|
|
|
|
|
dear all
how to do the following code, i spent much time, however i couldn't complete it, thanks a lot.
for (int iY=0,iX=0;iY<iheight,ix><iwidth;iy++,ix+ mode="hold"> {
if (iY==0)
ucImgdata[iX]=ucImgdata[iX]*mask[1]+ucImgdata[iX+1]*mask[2];
else if (iY==iHeight-1)
ucImgdata[iX]=ucImgdata[iX]*mask[0]+ucImgdata[iX+1]*mask[1];
else
ucImgdata[iX]=ucImgdata[iX]*mask[0]+ucImgdata[iX+1]*mask[1]+ucImgdata[iX+2]*mask[2];
}
ucImgdata+=iBuffwidth;
actually my goal is i have two arrays, one is 1x3, the other is iWidth x iHeight,first i want to multiply every point of iWidth x iHeight by center point of 1x3, when first point or last point of 1x3 array is out of iWidth x iHeight, just don't evaluate.that means i multiply each point of iWidth x iHeight by center point of 1x3 from beginning to end. however i tried to do this, but couldn't, the code above is no problem when i compiled, but when i processed the image via invoking this function, it aborted, thanks a lot
Li Zhiyuan
|
|
|
|
|
Hi,
if i get what you're saying, you are trying to a convolution on the image. You have a convolution kernel of [3x1] ( width is 3, height is 1) and an image of [height x width].
I'll assume your image is an 8-bit per pixel image (Grayscale).
You can achieve convolution by;
<br />
unsigned char kernel[3] = {1,3,1};
unsigned char *pImage = XXX;
<br />
for(int y = 0; y < height; y++)<br />
for(int x = 1; x < width-1; x++)
{<br />
pImage[x+y*width] = pImage[(x-1)+y*width]*kernel[0] + pImage[x+y*width]*kernel[1] + pImage[(x+1)+y*width]*kernel[2];<br />
}<br />
Also note, the result might be bigger than the capacity of unsigned char (in this example), so it is advisable to divide the convolution result by the kernel total size, that is (1+3+1) = 5 in this case. (Not shown above).
If you want to maintain the result without dividing, the output image size must be bigger, like 'int' etc.
Hope this helps.
Before i forget, the kernel i used is [3x1], you can also do [1x3] vertical kernel, just change the x,y operation above.
Cheers
|
|
|
|
|
thanks friend, my kernel is also 3x1, i made a mistake. thanks a lot, first let me try to do, if any problem, hope you can continue helping me.thanks
freind, i need to do twice convolution, first time is 1x3, sencond is 3x1, by i have to multiply each point of image, i read your code, you started from second pixel of image, my boss asked me to start from first pixel. how to carry out twice convolution? first 1x3, and then 3x1, thanks a lot
Li Zhiyuan
modified on Tuesday, March 4, 2008 1:56 AM
|
|
|
|