|
ykutanoor wrote:
Pls Explain what are network patches?
I've never heard the term network patches before. In the general sense, a patch is a piece of code added to software in order to fix a bug (between two releases). You've no doubt heard of an OS patch, which could include, among other things, fixes for network-related components.
ykutanoor wrote:
AND 3 WORKER THREADS.PLS LET ME HOW TO EXCHANGE THE DATA BETWEEN THESE 3 WORKER THREADS.
FOR EX:THE FIRST THREAD WILL GIVE THE SECOND THREAD THE 2 NUMBERS AS ARGUEMENTS.the second thread should return the first thread the sum.
So what does the third thread do? In any case, I would be inclined to use PostMessage() for communication between them.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I have a dialog with about 15 edit controls.
The controls are a subclass I've made of CEdit , CMyEdit for the matter.
2 out of the 15 CMyEdit controls don't have their OnNcPaint override called, for no apparent reason. all edit-boxes are declared the same way in the resource-editor, no special handling of any of them not in resources nor in code.
I've tried overriding OnCreate , OnNcCreate (added ON_WM_XXX ofcourse) and Create itself but none of them are ever called.
What am I missing out ?
p.s. - what I need is a 'point of intervention' during the creation/post-creation of the edit-control during which the control is already sized and positioned correctly.
|
|
|
|
|
ohadp wrote:
2 out of the 15 CMyEdit controls don't have their OnNcPaint override called, for no
You have most probably made some silly error. Check and recheck! You will want to make sure they are attached to the correct kind of variable in the h-file, and that the resource IDs don't clash.
ohadp wrote:
p.s. - what I need is a 'point of intervention' during the creation/post-creation of the edit-control during which the control is already sized and positioned correctly.
Perhaps PreSubclassWindow ?
|
|
|
|
|
I've checked all the resource-ids/etc, all looks ok.
PreSubclassWindow is interesting but problematic. The reason is that if I do my things inside
PreSubclassWindow<code> my control isn't subclassed yet, and so it's message-handlers aren't called when messages arrive :-)<br />
<br />
So I'll a little condition to the situation I was persuing earlier. What I need is an intervention-point during which the control is sized, and subclassed. Something like <code>PostSubclass , or PostCreate , or anything of that kind
|
|
|
|
|
ohadp wrote:
I've checked all the resource-ids/etc, all looks ok.
Then, you might want to tear down the project, perhaps by removing all the controls that works. Set a breakpoint in some function you know will be called in the class of the offending controls (such as PreSubclassWindow ) and verify that the controls are really subclassed.
ohadp wrote:
PreSubclassWindow is interesting but problematic. The reason is that if I do my things inside PreSubclassWindow my control isn't subclassed yet, and so it's message-handlers aren't called when messages arrive
To be sure I've not gone completely crazy (which I still won't outrule, however), I tested with a subclassed CEdit , instantiated from a resource template, mapped to a control variable of my class.
As expected, PreSubclassWindow is called after the control is created, and so you do have access to the control size and position. Of course, the handlers of the subclass aren't called before or during this call, thus the name PreSubclassWindow
Now, as PreSubclassWindow is a member of your class, you have full access to all other class members of the instance at this time of the execution, so I'm slightly baffled as to why you would need to know that the subclassing is finished - for all practical purposes, it is at this stage.
|
|
|
|
|
The deal is that during initialization, I want to trigger my version of OnWindowPosChanging .
I can fake a direct call to it from PreSubclassWindow , yes, but it's a little unorthodox so I was looking for a cleaner way to do it.
I guess that's just what I'll do then, thanks for the tips.
|
|
|
|
|
If you want a slightly cleaner architecture, put the code in a separate function and call it from both OnWindowPosChanging and PreSubclassWindow .
|
|
|
|
|
Hello Guy's,
I have in great trouble, i'm working for a image procssing project and i want to increase a pixel intensity if a perticular condition satisfies..
I have to copies of a same image only the RGB values as an BYTE array and the BITMAPINFO structure corresponding to that image. Then take each pixel of both image and compare the blue component and if the difference of the blue component is > some constant say 25 i have to increase the intensity of the new image: ... problem is i have only RGB values ... 3-BYTE for represent the pixel...
Any idea to do this.
pls help me
Thanks in advance.
Anurag Velekkattu
|
|
|
|
|
BYTE GetBValue(
DWORD rgb // RGB value
);
Hope this will help you.
|
|
|
|
|
read the iamge processing for dummis in code project about HSL color space;)
Kamyar Souri
Booria CAD/CAM Systems
www.booria.com
|
|
|
|
|
Here are one my solution about it. If you wont to get lighter color put white color otherwise black.
white -> RGB(255, 255, 255) // full light
black -> RGB(0, 0, 0) // light off
1) Make function like this:
a) For increase intensity:
int FindMax(int a, int b, int c)
{
if((double)a > (a+b+c)/3) return a;
if((double)b > (a+b+c)/3) return b;
if((double)c > (a+b+c)/3) return c;
if((double)a == (a+b+c)/3) return a; // for same color
return 255;
}
b) For decrease intensity:
int FindMin(int a, int b, int c)
{
if((double)a < (a+b+c)/3) return a;
if((double)b < (a+b+c)/3) return b;
if((double)c < (a+b+c)/3) return c;
if((double)a == (a+b+c)/3) return a;
return 0;
}
2) Make some variable int intensity = 0; // plus or minus
3) In your function put this code:
int dif;
if(intensity < 0)
{
dif = FindMin(myRGB[j][i].R, myRGB[j][i].G, myRGB[j][i].B);
if(dif > -intensity)
dif = intensity;
else
dif = -dif;
}
else
{
dif = FindMax(myRGB[j][i].R, myRGB[j][i].G, myRGB[j][i].B);
dif -= 255;
if(dif > intensity)
dif = intensity;
}
SetPixel(dc, x+j, y+i, RGB(myRGB[j][i].R+dif, myRGB[j][i].G+dif, myRGB[j][i].B+dif));
|
|
|
|
|
Hi,All. How to get Windows system Service Pack information using VC++? Thanks!
|
|
|
|
|
GetVersionEx()
OSVERSIONINFO structure will contain member szCSDVersion that indicates the latest Service Pack installed on the system.
SimasT.
|
|
|
|
|
Hi,
I am having more than one Network adapter in my machine, thru MFC Program how could i select the best adapter (highest Bandwidth) to bind?
Thanks in Advance
Rams
|
|
|
|
|
Does GetBestInterface() help? If not, there are other IP Helper functions available that may.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I do some drawing on client area of main window, but some controls on main window covered the drawing. I have tried to use non-clipchildren style, but it doesn't work. Does anyone know how to solve the problem?
Thanks
|
|
|
|
|
I don't think this is possible in any dependable way. If you want parts of the controls transparent, you might want to investigate SetWindowRgn . Hiding the controls under some circumstances might perhaps be another alternative?
|
|
|
|
|
Hello
I write an application (MFC Dialog), when i call GetTitleBarInfo, the compiler alway error: undeclare identifier
i know this function declare in winuser.h, and i already check,
i use VC6++, SP5, instal Platform SDK
Any one can help me.
Thanks alot
|
|
|
|
|
|
#define WINVER 0x0500 (Before including any windows headers)
And i tried this in Win 2000.
|
|
|
|
|
Hi
Could someone tell me how I can accomplish string case conversion using STL string, something like MakeUpper() and MakeLower() in CString?
Thanks!
|
|
|
|
|
Use foreach with a funtion that calls toupper on each character in the string.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Christian almost had it, but at least under my version of VC (.NET 7.0) toupper isn't passed the parameter by reference so you need to use std::transform
std::string str = "hello world";
std::transform(str.begin(),str.end(),str.begin(),::toupper);
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Hello..
i've got a problem with threads and modeless dialogs.
With modal dialogs i had no problems. This is a mfc app(VC++6.0), in the main view, i created a button, and when i clicked on it i created a thread (which opened a dialog), then waited for the user to close the dialog, and delete the thread:
<br />
void CHilosView::OnButton1() <br />
{<br />
<br />
hilo = new CThread(); <br />
delete hilo;<br />
}
when i did the new CThread, it would create the dialog, when the user clicked on the cancel button of the dialog, the dialog would close, then it would get to the delete hilo line and it would be ok.
But now with modeless dialogs my function has become:
<br />
void CHilosView::OnButton1() <br />
{<br />
<br />
hilo = new CAccionarHilo();<br />
hilo->dlg->CThread(130); (dlg is a dialog, 130 it's id)<br />
hilo->dlg->ShowWindow(1);<br />
//delete hilo;<br />
}<br />
and i can't delete the thread there, because i would never be able to see the dialog!!.
So i'd love to be able to call the delete from the new dialog (that is created everytime i press button1 in the main window) 'cancel' button.
i can close the dialog, but i never get to delete the hilo (or thread (it's spanish))
I can't call the delete method as :'hilo' : undeclared identifier, and i can't include the hilosView header in the dialog class, because i include the Cthread file in the hilosView class, and it includes the dialog class.
hope you can help me!!
thanks!!
|
|
|
|
|
It's usually not a good idea to put a window/dialog in a secondary thread. You should post a user-defined message back to the main GUI thread to perform this service for you. If you really, really need to have GUI objects operating from a thread, you must not use a worker thread. You must use a user-interface thread, which has a message pump.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|