Since all those fields are integers you can add, subtract or replace any of them. You should check that the values are valid in terms of the calendar, although the mktime, _mktime32, _mktime64[^] functions will attempt to normalise a tm structure into a valid time. There are many other useful functions, and you should study the documentation to see which ones will help you.
Yes, all these are integers, so I can perform addition or subtraction, but it is not handled well in below cases-
if hours are added
Like 4.5 then 13 hours should become 18:30
Or more than 24 then date should modify
In above cases I will need to add additional code depending on hours value, which is bad, isn't there any system method which will modify entire structure depending on the value assigned
If you want to add partial hours, days etc. Then use mktime (as I advised in my previous comment) to convert your tm structure into a time_t value. you can then just add or subtract the number of seconds in your time increment.
//Temporarily init time to local
struct tm *initStruct = localtime(&tempTime);//initialize it with local time
//now modify it to user defined date
initStruct ->tm_year = 2016;
initStruct->tm_mon = 9;
initStruct->tm_hour = 13;
int hoursToAdd = 4.5;
initStruct->tm_hour = initStruct->tm_hour + hoursToAdd;
time_t myTime = mktime(initStruct);//this return -1
printf( "%s", ctime( &myTime));//this prints null..
You really (and I mean really) need to go and study the documentation which explains what each field represents. If you have some number of hours and some number of minutes then you need to add them separately to each field. You should also step through your code with the debugger so you can see at each step what are the values of the various fields.
I have a MFC SDI application created and added CDialogBar to set as main toolbar as you look in the screenshot I attached. It works well on every windows os(Xp, 7, 8, 8.1, 10) of windows tablet devices except only Microsoft Surface.
Please look at this screenshot. the CDialogBar menu is cut off. I don't know reason why this happens. The drawing issue always only occurs on Microsoft Surface 3 which has high resolution and high DPI screen and it works good on any other tablet. This is very strange issue so I dragged toolbar(CDialogBar) and dropped down on any place then the toolbar was re-painted clearly. So.. through this issue, I am sure that this is re-drawing issue. Is there any drawing function to redraw that area?
I am attaching my minimized source code to represent drawing issue.
Operating System: Windows 10
Tablet: Microsoft Surface 3
Tool: Visual Studio 2015 Update 3
DPI rate: 150%
To resolve this issue, I have been trying to set DPI Awareness property to None, but the graphics Interface was not good and they were all stretched. I really don't like this solution, I have to find other solution without setting DPI Awareness to "None".
hmm, beg to differ in my interpretation of the purpose of this area. I marked it as Type: 'News' and this is listed as the Managed C++/CLI discussion area. That may explain a general lack of actual discussion however. I may post there too. Thanks
interior_ptr<T> is useful if you need pointer arithmetic in managed code or a pointer that can reference a managed or native object. It doesn't pin the referenced object and instead gets updated by the CLR when the object moves just like a handle. Can be useful for some functions that can operate on managed and native objects as a native pointer can be passed to an interior_ptr<T> argument.
pin_ptr<T> is useful if you want a managed object that can be referenced by native code. It stops the GC from moving the object so the object's address can be safely assigned to a native pointer as long as the pin_ptr<T> is alive. You see this used a lot when people manually marshal System::String to a char*.
I'm just conducting a research. Is it possible to create a round shape on screen that can be invisible or not seen by human eye,which can be seen by software that perform something like bio-metric reading/face detector. Its can not be only a shape even if its some sort of light/image that is impossible for a human to see but possible to software doing similar as face detection?
If this is possible how could one go about doing this and what this form is called and also if any knows samples, documentation about this.
I know this maybe a complex question but as I've said I'm conducting a research on this.
Hi, thanks. but what I mean is that if it can be something that will not block a user from seeing from the screen. Something like water mark. even if its visible but a user must be able to see through it clearly.
Thanks and this looks as if its exactly what I'm looking for, but what how can I make this be sort of transparent? I mean the whole form with one picture to be sort of transparent so that I can see through it while the picture is not 100% invisible but be a see through?
I want my form to be OnTop always and it must not block me from using a computer, I must be able to see through it with the picture or make it show lets say after 20 seconds and be 100% transparent and after 20 seconds be maybe 99.8% or 99.9% transparent. The transparent must be something which I can also detect by maybe a face detector technique.
I have the following program and I am trying to do the conactenation of two strings using overloading operator "+", but I am getting error in function "String operator+ (String box)" and line "box4 = box1 + box2".
Why doesn't show my string concatenated ?