|
Hi All!!!
hehe.. you know what, i found out the problem of my HWND being invalid... it turns out Im looking into a different CMainFrame pointer that holds the control bar that holds the CEdit.. I have implemented 2 Doc/View architectures in my program.. So I have 2 frames, 1 Mainframe and 1 Framewnd(inside another control bar)... It turns out i cast the Framewnd which has no CEdit variable, to CMainFrame.. So im looking in the framewnd which has no CEdit at all, not created.. So that solves my problem, I just got the pointer to the actual CMainframe which has the CEdit...
tnx for the replies!!
Maverick
"you can be my wingman anytime.."
|
|
|
|
|
I have deeply in search about Nikolai Teofilov's article called <<2D Graph ActiveX Control>> and codes here,but I can't use it because it is based on vc6.0.
I wanna know if some possess this kind of code of vc++.net!
And also I am glad that u can give me some advice on dynamic curve display!
thanks,sorry about my pool English!!!
|
|
|
|
|
I have read that article which I believe comes with the ActiveX control precompiled which you can use as is (ActiveX is supposed to be programming language independent). If you want to compile it your self, then you may need to modify the code (for your compiler).
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
looking to use a date time object like COleDateTime in a win32 dll.
What can i use?
Intellisense seems to work fine when i use COleDateTime and i have access to all the methods but when i compile, i get an error:
(33): error C2065: 'COleDateTime' : undeclared identifier
Any guidnce is appreciated...
Thanks
|
|
|
|
|
what i would like to do is get the current system date and time, time including the milliseconds
|
|
|
|
|
|
you have to included ATLComTime.h for using COleDateTime.
you can also try GetSystemTime() to obtain systme time.
Saurabh
|
|
|
|
|
saurgarg wrote:
you have to included ATLComTime.h for using COleDateTime.
afxdisp.h is needed for this MFC class.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Looking for the correct syntax to do the following.
I have a C++ dialog based application.
I would like to code a button to have the following functionality when pressed.
1. Launch a video player , like quicktime or mediaplayer
2. Play a video clip that i will supply.
Anyone know the syntax for this in C++ ?
|
|
|
|
|
Try here.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Does anyone know of a reliable formula that returns a text color that appropriately contrasts a background color? Even something as coarse as black or white will suffice - a la:
COLORREF getTextColor
(COLORREF rgbBkgColor)
{
if (...)
return (RGB (0, 0, 0));
return (RGB (255, 255, 255));
} Unfortunately the standard brightness formula doesn't appear to be accurate for all colors.
int nBrightness = (GetRValue (rgbBkg) * 299 +
GetGValue (rgbBkg) * 587 +
GetBValue (rgbBkg) * 114) / 1000;
Thanks,
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
well try this :
// r = red
// g = green
// b = blue
int i = 0;
if((r > b)&&(r > g))i = 1; // red is primary
if((g > r)&&(g > b))i = 2; // green is primary
if((b > r)&&(b > g))i = 3; // blue is primary
switch(i)
{
case 1:
SetColor(0,255,255);
break;
// and so on
}
// ofcourse there is other combinations, just think of them and define their contrast
CRPG, FRPG, Oblivion Fan
Hater of Counter Strike ( i hate it soo much damn it );
|
|
|
|
|
Unfortunately this doesn't work too well. I ended up using a modified version of the brightness algorithm (see my later post).
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Have you tried this: rgbBkgColor = ~rgbBkgColor;
You may not like the results, but it should work. Your only other (reasonable) choice would be to let the user decide (better), but that is not always possible.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Unfortunately this doesn't work too well. I ended up using a modified version of the brightness algorithm (see my later post).
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
I ended up using a modified version of the brightness algorithm.
COLORREF CDlgWeatherMate::getTextColor
(COLORREF rgbBkgColor)
{
COLORREF rgbText = RGB (255, 255, 255);
int nRed = GetRValue (rgbBkgColor);
int nGreen = GetGValue (rgbBkgColor);
int nBlue = GetBValue (rgbBkgColor);
int nBrightness = (nRed*299 + nGreen*587 + nBlue*114) / 1000;
if (nBrightness > 150)
rgbText = RGB (0, 0, 0);
if (rgbText == RGB (255, 255, 255)) {
if ((nRed == 0) && (nBlue == 0) && (nGreen > 153))
rgbText = RGB (0, 0, 0);
}
return (rgbText);
} /ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
I don't know if this will work any better, but this is what I have in one of my libraries: (I think the luminosity algo came from a Paul D. MSDN article)
int AfxGetLuminosity(COLORREF color)
{
const int HLSMAX = 240;
const int RGBMAX = 255;
int nRed = GetRValue(color);
int nGreen = GetGValue(color);
int nBlue = GetBValue(color);
int nRGBMax = max(max(nRed, nGreen), nBlue);
int nRGBMin = min(min(nRed, nGreen), nBlue);
return (((nRGBMax + nRGBMin) * HLSMAX) + RGBMAX) / (2 * RGBMAX);
}
...
COLORREF colorText = ((AfxGetLuminosity(colorBackground) > 120) ? RGB(0,0,0) : RGB(255,255,255));
In Italy for thirty years under the Borgias they had warfare, terror, murder, bloodshed - but they produced Michelangelo, Leonardo da Vinci and the Renaissance. In Switzerland they had brotherly love, five hundred years of democracy and what did that produce - the cuckoo clock!
-- Harry Lime
|
|
|
|
|
Thanks, Jack! I'll try it out. I'm a big fan of PDL and have faith in his code.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Tried it out - unfortunately it gives the same results as the brightess algorithm. But it works equally well if I add the green hack.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
I use Visual C++ 2003 .NET, and i have a problem with task list. The thing is that sometimes it simply don't works. When i click on the Task List Tab it wont jump out. So i have to exit from IDE and run it again to see errors in Task List. Although task list worked for many years on many diffrent systems for me, Is there any option to set Task List not to work.
Task List works after i first run IDE and compile a few projects. And then simply like it doesn't exists.
CRPG, FRPG, Oblivion Fan
Hater of Counter Strike ( i hate it soo much damn it );
|
|
|
|
|
It does not realy matter what IDE (or languange) you're using.
It sounds like you're stepping on some toes, some where in your program. There is some thing still running, that probably should not be (it shuts down when the IDE shuts down, usually [good design]). I know that this should not affect the task manager, but then there is what is logical and what is reality.
I would probably place system calls to execute the task manager at specific points in my code. Consider it a type of single stepping, if the call successeds then exit the task manager (manualy). You should also place TRACE() commands in your code to tell you if a call to the task manager succeded or not.
Have fun!
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Hey John, the OP was talking about the task list inside the Visual Studio IDE
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I've encountered the same problem, it happens occasionally and just as you said, closing and reopening the IDE seems to get rid of it. Don't know why it happens though
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
hi
i'm trying to make my app to sit in the Physical Memory ?
i read an article from microsoft and it said that i can get PhysicalMemory by using VirtualAlloc which returns my a range of adresses of memory
how can i put in this range an object?
how can i make my application to sit in this range?
or by any other way?
(may be somthing with working set ?? )
|
|
|
|
|
You need to do some more reading: VirtualAlloc() is essentialy used to reserve (a number of virtual memory pages [range of memory]) memory for your applications use. Then you can use VirtualAlloc() to commit individual pages, without consuming physical storage until it is needed.
In other words, it does not allocate physical memory directly!
As for your app sitting in physical memory: it probably does (while running), unless it is rediculously large. The only time the whole of your program is not in physical memory is when it is to large or some other program is active and it needs the physical memory space.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|