|
As noted by others for drivers and embedded systems. It is a mature language that works well with hardware with less interpretation.
One reason many people left C++ was they hate pointers, but as those other languages mature, they too employ pointers, so in the end we are now seeing a revival of C++.
p.s.
Some people love pointers.
|
|
|
|
|
Does anyone have experience using Electric Cloud build accelerator with C++/CLI code?
I'm primarily interested to know if C++/CLI projects are supported. The Electric Cloud support/helpcenter returns no results for my related searches.
John
|
|
|
|
|
Almost every build automation tool supports the toolchains, or they provide tools to setup your own build tasks and set up your own binaries.
Do they allow that? I don't have an account, so I cannot test that.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
I have a complicated xml that i need to read into variables it looks like below example. I need to put each of those into attributes into a database then recreate the same xml with change attribute values from my database.
sample:
<wmi>
<wmifileheader fileid="123456.20060410.001714.909268" filetype="FOR" version="4.0.0">
<fh_to id="123456" name="Vendor name">
<fh_from id="2677" name="Walmart.com">
<fh_contact name="Walmart.com Operations Support" email="webops@walmart.com" phone="6508375465" phoneext="">
<wmiorderrequest>
<or_order requestnumber="66851611" ordernumber="2677127827645">
<or_dateplaced day="10" month="04" year="2006">
<or_shipping methodcode="MP" carriermethodcode="22" storenumber="" togethercode="SC">
<or_phone primary="6503555323" primaryext="" second="" secondext="">
<or_postal name="Steve Kelley" address1="112 Dry Creek Road" address2="" address3="" address4="" city="Pacifica" state="CA" postalcode="94044" country="USA">
<or_deliverydate day="14" month="04" year="2006">
<or_email>
<or_billing orderprice="45.38">
<or_payment method="MC-3951">
<or_phone primary="2096011006" primaryext="" second="" secondext="">
<or_postal name="John Furey" address1="1234 Main St" address2="" address3="" address4="" city="Stockton" state="CA" postalcode="95207" country="USA">
<or_email>john@email.com
<or_returns tcnumber="95675952991021084742" methodcode="RC">
<or_postal name=" " address1="" address2="" address3="" address4="" city="" state="" postalcode="" country="">
<or_permit number="" city="" state="" postalcode="">
<or_orderline linenumber="1" lineprice="45.38">
<or_item itemnumber="3866121" upc="2345678902376" sku="376" description="Yellow Phalaenopsis Orchid in Blue Ceramic Pot" quantity="1">
<or_price retail="29.97" tax="2.47" shipping="12.94">
<or_cost amount="21.00">
<or_lastdeliverymsg line1="0" line2="0" line3="0" line4="0">
<or_marketingmsg line1="0" line2="0" line3="0" line4="0">
<or_returnsmsg line1="0" line2="0" line3="0" line4="0">
|
|
|
|
|
Why have you posted this under Managed C++?
|
|
|
|
|
I am receiving a date structure in "24-9-2016 13:30" format. Now I want to convert time value to specific timezone, I am doing calculations and have number of hours to add or substract.
So I don't know: how can I initialize tm struct with the date value I have? how to add or substract hours in tc struct variable to get required date?
my intention is
Date received "24-9-2016 13:30" and 5 Hours to add so final Date: "24-9-2016 18:30"
time_t tempTime
time(&tempTime);
struct tm *initStruct = localtime(&tempTime);initStruct ->tm_year = 2016;
initStruct->tm_mon = 9;
initStruct->tm_hour = 13;
.
.
.
please provide inputs.
modified 24-Sep-16 4:55am.
|
|
|
|
|
I am not sure what this has to do with Managed C++. However, the time, _time32, _time64[^] function describes the content of a time_t value, which you can easily initialise with a user defined time. I have not come across a date_t type, where is it defined?
|
|
|
|
|
Sorry, if I used wrong group to post. I have updated post with some of the steps I tried, please check and let me know if is there any solution available.
|
|
|
|
|
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.
|
|
|
|
|
ok, so here is what I did now-
time_t tempTime
time(&tempTime);
struct tm *initStruct = localtime(&tempTime);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);
printf( "%s", ctime( &myTime));
any idea whats going wrong here?
|
|
|
|
|
int hoursToAdd = 4.5;
That is not a valid statement so it will not even compile. You cannot assign a floating point number to an integer variable.
|
|
|
|
|
Yes, my bad. well in that case my original question reopens how can I assign partial hour to tm struct to enable it to give valid date value.
|
|
|
|
|
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.
|
|
|
|
|
Thank you very much Richard for your kind help. I really appreciate your time and effort.
|
|
|
|
|
Please I am new to c++ as I have been learning it on my own for months now, and I will like to know how to add the gtkmm lib to visual studio 2015. Any help will be much appreciated.thanks
|
|
|
|
|
|
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.
Drawing Issue Screenschot
Minimal Source code to represent drawing issue
Please help me. Thanks
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".
|
|
|
|
|
From the comments in this Visual Studio blog post: Visual Studio “15” Preview 4
Eric Battalio [MSFT] would like to hear from C++/CLI devs if there are issues we are having.
"We would like to learn more about issues developers have with C++/CLI. Please email me ebattali@microsoft.com"
I added another plea for a fix to the std::unique_ptr bug (can't pass it by value in /clr code). You may wish to add more. Please do so that he hears from us C++/CLI devs the minority that we are....
John
|
|
|
|
|
This isn't really the right forum for your message, since it's not a question.
You should probably post it in The Insider News[^] instead.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
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
|
|
|
|
|
Yes, but there's a reason the big red button at the top of this forum says "Ask a Question", rather than "New Discussion".
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I've used pin_ptr<> for years now but just came across interior_ptr<>. I supposed I may have been sheltered not needing it but can anyone illustrate why I'd prefer interior_ptr over pin_ptr?
John
|
|
|
|
|
A wee bit late but if you're still curious:
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* .
Cheers!
|
|
|
|