|
cavemen wrote: VC++08 doesn't do that?
Yes, you compile a file/project and it will list the compilation errors in the output window, there, you can double-click on the error in the list and it will open the appropriate file and and go to the line in question.
it's been like that since a long time in Visual Studio ...
Watched code never compiles.
|
|
|
|
|
VC++ 2010 Express has a feature similar to this. The issues is, to some extent, between interpreted and compile languages.
It's time for a new signature.
|
|
|
|
|
It's probably got more to do with C++ being a real bitch to parse - the VC++ development team ended up embedding the EGC C++ compiler front end in the IDE to detect errors as you type. There's a lot of compilation going on in there... shame they can't use their own compiler so that when you finish typing the new object file is ready to link.
Cheers,
Ash
|
|
|
|
|
Aescleal wrote: so that when you finish typing the new object file is ready to link.
I suspect the overhead would be somewhat expensive. Personally I have no problem typing (some of) the source, running a compilation, then fixing all the syntax errors, before moving to the next piece of code.
It's time for a new signature.
|
|
|
|
|
I have written a code which takes the data out of the Matrix for an image and converts from RGB to Y component. My next step would be to split this matrix into 4x4 blocks and perform some calculations. After this, I want to take the resultant matrices and do some computations with the original Matrix. I am confused with the loops and how to go about creating the loops. I will be very glad if someone can help me with a code snippet. Thanks a lot.
Sharp
|
|
|
|
|
could you please elaborate your problem, and present it clearly with an example?
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
Here is what I want to do. I have an image which I converted from RGB to Y component. Now I want to group the pixels into a 4x4 block. And then take an average for each block. And then subtract this with the original 4x4 block.
|
|
|
|
|
still not clear about your question.
what is your original matrix size, that you want to sub matricize to 4X4 blocks?
i require an example to help you out.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
you just re-wrote the original question ... not explain.
Watched code never compiles.
|
|
|
|
|
Ok ... I will try again.
I have a matrix of size 128x128. I want to divide this matrix into groups of 4x4 that means the resultant is a matrix of 32x32.
The next step is to take an average of this 4x4 matrix, and have the same value for all matrix elements.
The resultant will be something like this
a b c d
e f g h
M1=i j k l
m n o p
M1 is the given matrix. The new matrix M2 is given with the element value q is given by
q = a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p/16
q q q q
q q q q
M2=q q q q
q q q q
And in the next step I want to subtract M2-M1.
Would be great if you can help me with a code snippet.
Thanks
|
|
|
|
|
1.if your original matrix of size 128/128 is say "M",
2.write a function as follows
ComputeSubMatrix(int row,int col)
{
int avg=0;
for(int i=row;i'<'row+4;i++)
{
for(int j=col;j'<'col+4;j++)
{
avg+=M[j][i];
}
}
for(i=row;i'<'row+4;i++)
{
for(int j=col;j'<'col+4;j++)
{
M[j][i]=avg-m[j][i];
}
}
}
3.now, you call this function in nested loops, by passing the start row and column of each sub matrix.
4.and this should solve your problem.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
In the main program how do I make the nested loop. For examaple I assign Trow=128 and Tcol=128. Here Trow and Tcol are the total row and column.
1. I need to here scan through Trow * Tcol.
2. And take each block and perform the above function.
3. What will be the values for row and col in the above code?
4. does m[j][i] represent the original matrix?
Thanks
|
|
|
|
|
sorry my friend, i ve got to leave for the day now.
if i give any short answer, you may again get confused.
i have put a mail to your id.
keep in touch and we will solve it tomorrow.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
you need to do something like this.
for(int row=0;row<128;row+=3)
{
for(int col=0;col<128;col+=3)
{
ComputeSubMatrix(row,col);
}
} let me know if you have any doubts.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
Hi all
i am using RedrawWindow for ListControl on OnEraseBkgnd.
BOOL CTestDlg::OnEraseBkgnd(CDC* pDC)
{
GetDlgItem(IDC_LIST)->RedrawWindow();
CRect rect;
GetClientRect(&rect);
pDC->FillSolidRect(rect,RGB(250,273,354));
return TRUE;
}
Then i am getting Listcontrol boarder disappear.
Am i right or not?
There is any different way to use RedrawWindow() function?
Please help me.
Thanks in advance
|
|
|
|
|
Looks like you're trying to paint the control, and then immediately draw a solid rectangle over it.
RedrawWindow invalidates the client region of your window. The borders are not part of that region. Then the FillSolidRect code kicks in and fills the dialog background. Now the WM_PAINT from your RedrawWindow call comes to your list controls message pump, and it redraws the invalidated region, the client area, but not the border.
What behavior are you looking for?
|
|
|
|
|
What are you trying do? Looks like you are trying to change the background color. If that is the case handle WM_CTLCOLOR message.
|
|
|
|
|
Hi sir,
Thanks for all your help.I have found the solution.
I am reading all the character from combo and storing it in map.
then i am reading the character from combo and Find() in given whole map.
I am tryig this code
CString strValue;
CString strTemp;
m_CtrlComboID.GetWindowText(strValue);
std::map<CString,CString>::iterator it=m_mapId.begin();
m_CtrlComboID.ResetContent();
for(; it!=m_mapId.end(); it++)
{
strTemp = it->first;
strValue.MakeUpper();
if(strTemp.Find(strValue)==0)
m_PatientID.AddString(strTemp);
}
m_CtrlComboID.SetWindowText(strValue);
m_CtrlComboID.ShowDropDown()
the problem i am facing is,
1)The first string is getting set in the ComboBox.
2)when i type the first character in combo,it is getting the strings
related to the first character.
but i am not able to type in the second character,as the cursor is going in the first position.
The character which i have typed later is going first.
For Ex: First i will type the character as "P",
Second if i type "A" character in combo,its going before "P"
i.e "AP",but i need as "PA".
I am bit confused,
any suggestions
Thanks
Raj
|
|
|
|
|
You need to set the cursor position manually. If you are using MFC use CCoboBox::SetEditSel()[^] API, otherwise send the control the CB_SETEDITSEL[^] message. Set start and end char to be the length of your string.
|
|
|
|
|
Hi sir,
Its working fine,thanks for your help
Thanks
Raj
modified on Tuesday, June 29, 2010 12:32 AM
|
|
|
|
|
Hello,
Doe's anyone know how can I make a FullScrean listbox.
I need to have the option that the list box will be somtimes at fullscrean and somtimes at regular mode.
thanks in advence
|
|
|
|
|
Resize the ListBox using MoveWindow API while changing from full screen to regular mode and vice versa.
|
|
|
|
|
but how can I get the screan size?
|
|
|
|
|
Adding to the Niklas Lindquist suggestions in the below post
GetClientRect API helps to obtain the client area of the Window. Get the parent window's client area and resize listbox according to it or the way you want.
|
|
|
|
|
All you have to do is SetWindowPos[^] and use some kind of accelerator key combination to switch back and forth.
You might have to handle WM_MINMAXINFO[^] to allow the control to be larger than the actual screen if you want to hide borders. Alternatively, you could modify the window style to achieve the same.
The GetSystemMetrics[^] API will give you the size of the screen using the SM_CXFULLSCREEN and SM_CYFULLSCREEN parameters.
Disclaimer: there might be another way get the screen size to support multiple monitor systems.
|
|
|
|