|
It sounds like you need to use CEdit::ReplaceSel() instead, or use a listbox instead of an edit control.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Get the current text from the edit box (GetDlgItemText) to a buffer, append a newline to the end of the buffer, append your new message to the end of that and then send the whole lot back to the edit box (SetDlgItemText). Of course, you could just keep your buffer between messages and then you wouldn't need to get the current text each time.
If you want a better solution then use EM_SETHANDLE to set the handle of the buffer the control is displaying and then manage the buffer yourself.
Hope that helps, good luck.
|
|
|
|
|
|
Hi there,
Is anybody here dealt with coding of integer image processing algorithms using SSE2 intrinsics on a P-4. If yes, please respond. I am stuck with a problem. wanted to know if there is a round way about it.
ARK
|
|
|
|
|
|
Hi Chris,
Thank you for responding. I am currently using SSE2 intrinsics to optimize my image processing algo. Let us say we have four different non contiguous addresses inside one single XMM register:
XMM 0 = |ADD1 | Add2 | Add3 | Add4 |
If I want to get the data at those addresses what is the best way possible. The only way I could think of writing it back to memory/cache and then read them with pointer indexing like
XMM1 = |*ADD1 | *ADD2 |*ADD3 |*ADD4 |
This would give a huge hit in performance since there is memory read and write back which is a lot of cycles per 4 indexed values. ....Is there any way round it to get hold of those values from those addresses. Normal vector processing machines support Gather,Scatter which is the equivalent of getting data from non contiguous addresses. However, these kind of support seems to be absent in SSE2...
Please respond if you have any thoughts about it. Anything is helpful.
Thank you for the help.
Best regards,
Anand
|
|
|
|
|
Thank you chris for the response. Appreciate it... I wll see whther this can help the speed...Will keep you posted for sure...
best regards,
Anand
|
|
|
|
|
As far as I know there's no method of dereferencing the contents of an XMM register so you're only solution will be to 'manually' extract the addresses, dereference them, and then 'manually' build your new XMM register - this is effectively what you're suggesting. Of course you can keep the addresses in registers to avoid the memory read/write hit you mention but it's still not a great solution. For example:
movd eax, xmm0 //eax is now the address in the lowest 32 bits of xmm0
mov ebx, [eax] //ebx is whatever eax was pointing at
movd xmm1, ebx //low dword of xmm1 = *(low dword of xmm0)
repeating this with some packed rotations to get/set all the data in the xmm registers. (Sorry for the assembler - I don't actually use intrinsics)
Perhaps you need to look at the overall algorithm to see whether there's a method which avoids ending up with your addresses in an XMM register...
Not sure I've been much help really - if you find an elegant solution I'd be interested!
Cheers,
Chris.
|
|
|
|
|
Here is the problem.
I have to Customise Open File Dialog to preview bmp. jpeg and avi files. I have an active X that takes the file name and displays it frame by frame. Want to use this active X in the dialog.
I am using MFC.
Have created a Dialog resource Template with a hole(Group box Control with ID stc32).
(Followed the example from "Programming Microsoft VC++ by David J Kruglinski and others.)
The problem occurs when I try to add the active X to the Dialog. "Dialog box couldn't be created " is the error that I am getting.
Could anyone please help me include an activeX control on the same dailog.
Thanks in Advance
M
|
|
|
|
|
Hi,
I try to open .pdf file in my program but i do not know how can i open excutable file?
Another problem i do not know how can i access to temporary directory and use it for my program ?
thanks for your attention.
|
|
|
|
|
ShellExecute()
and
GetTempPath()
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I have make a test to compare a function "inline" with a macro "#define"
I compile a such code with VC 6.0 :
#define SQ(A) ((A)*(A))<br />
inline unsigned iSq(unsigned a){return a*a;}<br />
unsigned _Sq(unsigned a){return a*a;}<br />
<br />
unsigned x,y,k(0);<br />
unsigned long init = GetTickCount();<br />
for(x = 10000; x--;)<br />
for(y = 10000; y--;)<br />
k=iSq(y);
<br />
cout << Comment :" << GetTickCount()-init << " ms" << endl;<br />
//-------------------------------------
And I find :
inline (iSq) : 3264 ms
macro (SQ) : 391 ms
simple fct (_Sq) : 3305 ms
nothing (y*y) : 401 ms
Why inline function is so slow ?
|
|
|
|
|
If you really want to you could check the assembly that is generated for each variation and calculate the time to execute based on the asm instructions called (i.e. clock cycles).
You will probably find differences between DEBUG and RELEASE due to compiler optimization anyhow.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fuity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Are you for sure that iSq() was indeed inlined? By using the inline specifier, you are simply telling the compiler that inline expansion is preferred. Here are several reasons why standard linkage might be used instead.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I used DEBUG configuration
With RELEASE conf, it's better.
Thanks
Tonight, ciao Greece ...
|
|
|
|
|
Two rules of performance measuring:
1. Never mesure DEBUG code.
2. Never mesure dumb code (it will be optimized out).
I've modified your test and came out with the following results:
Inline :24437 ms
Macro :24531 ms
Function:40594 ms
In place:24391 ms
As you see, function calls add a little overhead, all other cases are practically identical (as they should be).
Also, if you'd look at generated code, you'd see that "inline" works just fine - there is no "call", it inserts "imul" instruction.
-----------------------------
Get trial copy of comment generating tool CommentMakerPro, std::string and std::string containers viewer FeinEvaluatorPro and windows manager for Microsoft Visual Studio .NET FeinWindows at www.FeinSoftware.com
|
|
|
|
|
Right, optimizations are off by default in DEBUG mode.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Here i found a problem in my project, We're a TCP communication peers, the remote peer needs the RST flag to reset it internal buffers, when one transaction is completed between us. but now i solved the problem by closing the socket and opening the socket again and start a new transaction, because while closing the connection the client will send an RST flag, to the peer clearing the buffers at the peer side, but i need to send the RST flag by setting the RST flag in the TCP header but without closing the socket connection.
thanks in advance for the solution given by message board members, plz it's very urgent.
s.s.s.eswaran
|
|
|
|
|
Hi,
Does anybody knows how to prevent Visual C++ 6 to crash when
linking variables to Dialogs in Classwizard on Windows XP Pro?
Symptoms: the "Main_Dlg.cpp" file cannot be updated and disapears.
(I know the trick with the .tmp file, but I want to know if there is a
patch from Microsoft)
Thank you
Kassad
|
|
|
|
|
Which service pack are you using? Right now visual studio is at service pack 6. I would not recommend using visual studio without at least sp4 installed. Most of the GUI problems with the initial version of vc6 are fixed but there are still bugs with the class view in sp6. If you reorganize your code in the classview by using folders, vc6 can and will forget this whenever it wants... Good thing there are some tools here that allow you to back this up for each project. I find myself restoring a backup of this info at least once a day...
John
|
|
|
|
|
Hi,
I was using the SP5 and I'm downloading the SP6
I'm interrested by the "tools" for "backuping".
Thank you.
B->
Kassad
|
|
|
|
|
I use CDialogBars in my SDI app and I need to manage the availability of some buttons I've placed over that.
So I've written this code i CMainFrame:
MyDialogBar.GetDlgItem(MY_BUTTON).EnableWindow(FALSE);
but it doesn't work ! buttons availability doesn't change !
Can someone help me ?
|
|
|
|
|
Hi,
I've got a major problem in my little program. I use a self made class which contains an integer array. In the classes constructor I initialite this array with the following statement:
ar = new int[number];
where "ar" is a int* and "number" is a passed parameter.
In debug configuration everything works fine but in release config the program crashes at this line when "number" is greater than 4.
I can't find an explanation or solution. Can anybody help, please?
|
|
|
|
|
Something else is at play here as I "see" nothing wrong with what you've described so far. I put the following together:
class dc
{
int *ar;
public:
dc(const int n)
{
ar = new int[n];
}
~dc()
{
delete [] ar;
}
};
void main( void )
{
dc d(760);
} It works fine. How does yours differ?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
That's exactly what I did. With debug configuration settings it forks fine with all array sizes I apply but when I change to release config settings the program terminates without any message when I apply parameters greater than 4. Strange isn't it?
I use:
Win XP Home
Visual C++ 6 Author Edition
Allegro
|
|
|
|