Getting time strange problem 
Author Message
 Getting time strange problem

Hi

The problem is probably simple as usual.
Basicly I need to getactual time (hour, minute, second)
as separate int.
I've added this code in a proper place in working VC++6.0
project:
#include <afx.h>
CTime Time;
int Second = Time.GetSecond();
All compiles with no error but when I try to bild and
execute program I recive following error:
Linking...
nafxcw.lib(thrdcore.obj) : error LNK2001: unresolved
external symbol __endthreadex
nafxcw.lib(thrdcore.obj) : error LNK2001: unresolved
external symbol __beginthreadex
Release/lesson4.exe : fatal error LNK1120: 2 unresolved
externals
Error executing link.exe.
What's wrong??????



Sat, 26 Mar 2005 20:49:19 GMT  
 Getting time strange problem

Quote:

> Hi

> The problem is probably simple as usual.
> Basicly I need to getactual time (hour, minute, second)
> as separate int.
> I've added this code in a proper place in working VC++6.0
> project:
> #include <afx.h>
> CTime Time;
> int Second = Time.GetSecond();
> All compiles with no error but when I try to bild and
> execute program I recive following error:
> Linking...
> nafxcw.lib(thrdcore.obj) : error LNK2001: unresolved
> external symbol __endthreadex
> nafxcw.lib(thrdcore.obj) : error LNK2001: unresolved
> external symbol __beginthreadex
> Release/lesson4.exe : fatal error LNK1120: 2 unresolved
> externals
> Error executing link.exe.
> What's wrong??????

By including afx.h you are including the MFC library.  The MFC library
code requires that you use one of the multithreaded versions of the C
runtime library - even if you are not going to use multithreading.  So
you have to change your project settings for 'Use runtime library' to
the appropriate multithreaded choice, not the single threaded choice.

--
Scott McPhillips [VC++ MVP]



Sun, 27 Mar 2005 09:57:30 GMT  
 Getting time strange problem


Fri, 19 Jun 1992 00:00:00 GMT  
 Getting time strange problem
Big thanks!!
Simple but for unexpirenced one unsolved problem.
Big thanks for help.


Sun, 27 Mar 2005 16:38:01 GMT  
 Getting time strange problem


Fri, 19 Jun 1992 00:00:00 GMT  
 Getting time strange problem

Quote:

>Hi

>The problem is probably simple as usual.
>Basicly I need to getactual time (hour, minute, second)
>as separate int.
>I've added this code in a proper place in working VC++6.0
>project:
>#include <afx.h>
>CTime Time;
>int Second = Time.GetSecond();

Maybe a typo, but anyway ...

You need to initialize Time before using .GetSecond() The GetSecond
member function will only return the second part of the time stored in
a CTime object.

To get the current time do:

CTime time = CTime::GetCurrentTime();
int second = time.GetSecond();

// Mike
--
English isn't my first or second language,
so errors or anything that you find offending is not there on
purpose it's just due to the translation.



Tue, 29 Mar 2005 16:44:52 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. VERY strange problem using the function gets()

2. VERY strange problem using the function gets()

3. A very strange timing problem

4. Problem with getting time

5. Strange, strange, strange

6. getting strange characters when I print

7. Re : Strange run-time check failure

8. Strange run-time check failure

9. Just-In-Time-Debugging - Very strange message!

10. NEWBIEISH: strange time

11. newbie time problem (time.h)

 

 
Powered by phpBB® Forum Software