|
Check the input date's time, if it is 00:00:00 strange things happen.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks, I changed it and it works now 
|
|
|
|
|
You are welcome.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hello,
I am working on an mfc application in which there is a colour code being fetched from the server stored in a CString. The colour code is in Hexadecimal for eg #3333FF
Now I want to set the backgroung of my control based on this color. For that I want to change the color in RGB.
I am using the following code but it is not working properly.
Please tell whats the problem.
LPTSTR pStop;
int b1,b2,b3;
CString str("#3333FF");
LPCTSTR input= str;
int num = _tcstol(input + 1, &pStop, 16);
b1 = (num & 0xFF0000) >> 16;
b2 = (num & 0xFF00) >> 8;
b3 = num & 0xFF;
COLORREF crBkgnd = RGB(b1 ,b2 ,b3 );
But the above code is making the value of b1,b2 and b3 to 0.
As a result my control background is always colured in white.
Please help me.
Thanks In Advance.
Dhiraj
|
|
|
|
|
Actually your code is working fine on my system.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Can you tell me what can be the possible reason that its not working on my system.
|
|
|
|
|
I suppose your debugger can tell it far better than me.
Debug it, step by step and see at what line the toy starts to break, then, optionally ask our help about.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
Dhiraj kumar Saini wrote: b1 = (num & 0xFF0000) >> 16;
b2 = (num & 0xFF00) >> 8;
b3 = num & 0xFF;
Why are you not using GetRValue() , GetGValue() , GetBValue() ?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Possibly beacuse they go in the opposite order?
I man, he should do
COLORREF cr = RGB(GetBValue(num), GetGValue(num), GetRValue(num));
It is still an option, but personally I don't like it very much.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
See the definition of RGB:
#define RGB(r,g,b) ((COLORREF)(((BYTE)(r)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(b))<<16)))
What RGB does is it gives you a hexadecimal number.
COLORREF cr = 0x000000ff;
COLORREF cr = RGB(255, 0, 0); are equivalent.
You can replace
int num = _tcstol(input + 1, &pStop, 16);
b1 = (num & 0xFF0000) >> 16;
b2 = (num & 0xFF00) >> 8;
b3 = num & 0xFF;
COLORREF crBkgnd = RGB(b1 ,b2 ,b3 );
with
COLORREF crBkgnd = _tcstol(input + 1, &pStop, 16);
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Hi everybody,
i like to draw a loading rect on a view and overlay a "shadow" on the entire view.
I made the shadow this way :
for(int x=0; x<rect.width();{
for(int y=0; y<rect.height();{
pDC->SetPixel(x,y,RGB(0,0,0));
}
}
But the shadow isn't drawn over the controls.
Rather the controls are drawn over the shadow
Is there a possibility to do that?
Big thanks for help
modified on Friday, November 7, 2008 4:37 AM
|
|
|
|
|
Well... What about creating a popup dialog without caption and borders and drawing whatever you want...?
Hint: Have a try to WS_EX_TRANSPARENT style too...
|
|
|
|
|
Yepp, thats the easiest solution
But in my MDI Application it's possible to continue the work in other views.
These other views, which aren't loading huge data, are still editable.
WS_EX_TRANSPARENT
Ok, i'll google after this
Thanks
If you have further ideas how to resolve this problem, i would be very happy 
|
|
|
|
|
baerten wrote: But in my MDI Application it's possible to continue the work in other views.
These other views, which aren't loading huge data, are still editable.
Ofcourse, you can continue the work, if you create the dialog as modeless...
|
|
|
|
|
Okay, i see ...
If the working view gets the focus, i show up the modeless dialog.
Because if i don't do it, the user couldn't see to which view has a "waiting dialog"
Thanks for the idea 
|
|
|
|
|
I have create a MFC single document application. But now i need to open another window to open and access its view class against a button on toolbar. can it possible in MFC SDI?
|
|
|
|
|
So you need to communicate to another application... make the use of window messages and WM_COPYDATA can help you a lot.
|
|
|
|
|
Hello all,
I am building Win32 application. My requirement is to expire this application on a particular date let say for e.g. on 31 december, 2008. If i use system's local time then user will be able to run it by changing its date/time.
So is there any way to get global time in my VC application. Please help me out in this situation.
Any help would be greatly appreciated.
Thanks
|
|
|
|
|
If client PC is connected to internet then you can ask one of the many time servers for the current time. Otherwise as far as I know there is no way to find the correct time locally. May I ask why you need to do so. Are you trying to build a demo application which expires after a number of days. In that case you should store the time of the installation somewhere in the user PC and check against it.
Saurabh
|
|
|
|
|
Thanks for your reply. I also thought about the suggestion for getting global time from server till PC is connected to Internet that you have mentioned. But that's not my requirement. what could be the other way to do so?? As I told you that i need to expire it on particular date. Your suggestion would work if i need to expire it after number of days from its installation.
Please help me out if you still have some suggestions. by the way thanks again for you reply.
Thanks
|
|
|
|
|
As far as I know there is no way to determine the correct time irrespective of the time user has set in the machine. Actually if you think about it there is no such thing as correct time. In Singapore the current time is 15:15 07-11-08, in India it is 12:45 07-11-08 but in Los Angeles it is 11:15 PM on 06-11-08. So which one will you choose?
-Saurabh
|
|
|
|
|
yaa... I think you are right. Let me think over hoe to accomplish it. Thank you very much for your replies.
Thanks
|
|
|
|
|
I think you should be asking why do I need to do that? What actually am I trying to accomplish?
-Saurabh
|
|
|
|
|
I didn't get you in your previous reply. If you are asking what i am trying to accomplish is clear. I want to expire my application on particular date. but i can't use local time/date to check it as user may change its local time/date. That's why i am thinking of some other way.
Please help me if u have some suggestions for me.
Thanks
|
|
|
|