Click here to Skip to main content
15,896,269 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: GetKeyState() question Pin
Chris Richardson2-Oct-02 10:06
Chris Richardson2-Oct-02 10:06 
GeneralClistctrl and sorting in report view Pin
ns2-Oct-02 4:13
ns2-Oct-02 4:13 
GeneralRe: Clistctrl and sorting in report view Pin
Michael P Butler2-Oct-02 4:28
Michael P Butler2-Oct-02 4:28 
GeneralCString and 'type' question Pin
ns2-Oct-02 3:40
ns2-Oct-02 3:40 
GeneralRe: CString and 'type' question Pin
Tomasz Sowinski2-Oct-02 3:50
Tomasz Sowinski2-Oct-02 3:50 
GeneralRe: CString and 'type' question Pin
ns2-Oct-02 4:09
ns2-Oct-02 4:09 
GeneralRe: CString and 'type' question Pin
Tomasz Sowinski2-Oct-02 4:35
Tomasz Sowinski2-Oct-02 4:35 
GeneralRe: CString and 'type' question Pin
RedZenBird2-Oct-02 4:40
RedZenBird2-Oct-02 4:40 
well, I think you oughta consider a different class than CString for storing your data....for example a variant type class that can can be a string, number or date with a 'marker' in the class to state what the data is. For ex:


class X
{
private:
time_t m_xTheTime;
string m_oTheString;
long m_lTheNumber;
int m_iType;

public:
enum
{
eIsTime;
eIsNumber;
eIsString;
}

X( string s )
{
m_iType = eIsString;
m_oTheStrign = s;
}

X( long l )
{
m_iType = eIsNumber;
m_lTheNumber = l;
}

X( time_t t )
{
m_iTheType = eIsTime;
m_xTheTime = t;
}

string AsString();
long AsNumber();
time_t AsTime();

int GetType();
}
etc etc

but if you don't wanna do that then to answer your other question:

for each char in your string call isdigit which will check if the character
is '0'..'9'





Just trying to keep the forces of entropy at bay
GeneralRe: CString and 'type' question Pin
Chris Losinger2-Oct-02 5:25
professionalChris Losinger2-Oct-02 5:25 
GeneralWeird Memory Usage Pin
Chris Hambleton2-Oct-02 2:37
Chris Hambleton2-Oct-02 2:37 
GeneralRe: Weird Memory Usage Pin
Tomasz Sowinski2-Oct-02 2:47
Tomasz Sowinski2-Oct-02 2:47 
GeneralCListCtrl and multiselect question Pin
ns2-Oct-02 1:25
ns2-Oct-02 1:25 
GeneralRe: CListCtrl and multiselect question Pin
Tomasz Sowinski2-Oct-02 1:33
Tomasz Sowinski2-Oct-02 1:33 
Generalan observation Pin
ns2-Oct-02 1:39
ns2-Oct-02 1:39 
Generalmore questions Pin
ns2-Oct-02 1:46
ns2-Oct-02 1:46 
GeneralRe: an observation Pin
Tomasz Sowinski2-Oct-02 1:49
Tomasz Sowinski2-Oct-02 1:49 
GeneralRe: an observation Pin
ns2-Oct-02 1:54
ns2-Oct-02 1:54 
GeneralRe: an observation Pin
Tomasz Sowinski2-Oct-02 2:02
Tomasz Sowinski2-Oct-02 2:02 
Generalrequest Pin
ns2-Oct-02 2:06
ns2-Oct-02 2:06 
GeneralRe: request Pin
Tomasz Sowinski2-Oct-02 2:13
Tomasz Sowinski2-Oct-02 2:13 
Generalokay - doing that - final(?) question Pin
ns2-Oct-02 2:17
ns2-Oct-02 2:17 
GeneralRe: okay - doing that - final(?) question Pin
Tomasz Sowinski2-Oct-02 2:31
Tomasz Sowinski2-Oct-02 2:31 
GeneralRe: request Pin
ns2-Oct-02 2:44
ns2-Oct-02 2:44 
GeneralRe: request Pin
Tomasz Sowinski2-Oct-02 2:56
Tomasz Sowinski2-Oct-02 2:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.