Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Opposite of CString::Format ?

Posted on 1998-06-06
1
Medium Priority
?
333 Views
Last Modified: 2013-12-03
CString oTime;
SYSTEMTIME st;
oTime.Format("%02d/%02d/%04d %02d:%02d PM",st.wDay, st.wMonth, st.wYear,st.wHour-12, st.wMinute);      

Is there any simple way to "Un"Format a CString and get back all values to a SYSTEMTIME structure? I need
this structure to do sorting. I don't think I want to manually extracts the value from the CString one by one and
make comparison between the years...then months..... it's extremely tedious.. I believe there is a simpler way to
do that, could anyone please enlighten me?
0
Comment
Question by:zhenteng
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 2

Accepted Solution

by:
Slarti earned 40 total points
ID: 1407072
Use sscanf:
sscanf((const char*)oTime, "%d %d etc.", &st.wDay, &st.wMonth ...);
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question