Click here to Skip to main content
15,887,746 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: convert cstring to int Pin
John R. Shaw14-Oct-05 21:18
John R. Shaw14-Oct-05 21:18 
AnswerRe: convert cstring to int Pin
khan++14-Oct-05 21:19
khan++14-Oct-05 21:19 
QuestionFile Handle(very urgent) Pin
swaapu14-Oct-05 20:59
swaapu14-Oct-05 20:59 
AnswerRe: File Handle(very urgent) Pin
khan++14-Oct-05 21:17
khan++14-Oct-05 21:17 
GeneralRe: File Handle(very urgent) Pin
swaapu14-Oct-05 23:16
swaapu14-Oct-05 23:16 
GeneralRe: File Handle(very urgent) Pin
khan++14-Oct-05 23:38
khan++14-Oct-05 23:38 
GeneralRe: File Handle(very urgent) Pin
swaapu15-Oct-05 1:31
swaapu15-Oct-05 1:31 
QuestionADO datetime parameter - datestring or numbers to VARIANT Pin
compoundeye14-Oct-05 20:54
compoundeye14-Oct-05 20:54 
Hello,

i'm working a VC++ class that calls stored procedures using ADO,
and i'd really like to know how to set a VARIANT to a datetime value,
without using COleDateTime class.


so instead of:

_ParameterPtr pParameter = m_pCommand->CreateParameter(
_bstr_t(sParamName.c_str()),
adDBTimeStamp,
adParamInput,
0,
_variant_t(COleDateTime(1998, 10, 1, 0, 0, 0))
);

m_pCommand->Parameters->Append( pParameter);

i'd like to go

VARIANT vMyDate;

...then some how set vMyDate to '1997-10-1 0Blush | :O Blush | :O '
then...

_ParameterPtr pParameter = m_pCommand->CreateParameter(
_bstr_t(sParamName.c_str()),
adDBTimeStamp, adParamInput,
0,
vMyDate
);

m_pCommand->Parameters->Append( pParameter);




why do i want to do this?

I'm working on an existing program, a massive monster of program with about 60 people working on it.

the existing class has functions which add parameters of various datatypes, but theres no function for datatime.

the program uses its own custom class to handle dates and times, from which i can easily extract formatted strings

I tried to use and the COleDateTime class, but the compiler didn't recognise it:

'COleDateTime' : undeclared identifier

I'd assume that means the correct header hasn't been included.
This is a bit of a problem, my workplace is very political and anti-microsoft (even though we use vc++ and mssql!), i'm very junior here, if i add a microsoft header file there's a very good chance someone senior will take it out and back out my changes.
Is there any chance that the header has been included and i need to specify a namespace?

I tried to add what i thought was the correct header:
afxdisp.h

and i get the error:

c:\program files\microsoft visual studio\vc98\mfc\include\afxv_w32.h(14) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>

can anyone offer me any suggestions?

thanks

Mat
AnswerRe: ADO datetime parameter - datestring or numbers to VARIANT Pin
Mircea Puiu14-Oct-05 21:32
Mircea Puiu14-Oct-05 21:32 
GeneralRe: ADO datetime parameter - datestring or numbers to VARIANT Pin
compoundeye14-Oct-05 21:46
compoundeye14-Oct-05 21:46 
QuestionWhy unable to receive all message from connected clients using IOCP Pin
14-Oct-05 20:08
suss14-Oct-05 20:08 
QuestionPlaying an mp3 file from memory Pin
V.G14-Oct-05 20:05
V.G14-Oct-05 20:05 
QuestionHow to find data encoding of received buffer with WSARecv() Pin
Member 168985514-Oct-05 19:49
Member 168985514-Oct-05 19:49 
AnswerRe: How to find data encoding of received buffer with WSARecv() Pin
kakan16-Oct-05 19:42
professionalkakan16-Oct-05 19:42 
GeneralRe: How to find data encoding of received buffer with WSARecv() Pin
Member 168985516-Oct-05 20:47
Member 168985516-Oct-05 20:47 
QuestionVC++6 Dll For use with VB6 Pin
tinman033014-Oct-05 18:45
tinman033014-Oct-05 18:45 
AnswerRe: VC++6 Dll For use with VB6 Pin
John R. Shaw14-Oct-05 22:01
John R. Shaw14-Oct-05 22:01 
GeneralRe: VC++6 Dll For use with VB6 Pin
tinman033015-Oct-05 12:48
tinman033015-Oct-05 12:48 
Questionwhy can't I see my class in the ClassView pane? Pin
ewighell14-Oct-05 18:05
ewighell14-Oct-05 18:05 
AnswerRe: why can't I see my class in the ClassView pane? Pin
Fired Fish14-Oct-05 20:12
Fired Fish14-Oct-05 20:12 
AnswerRe: why can't I see my class in the ClassView pane? Pin
khan++14-Oct-05 21:39
khan++14-Oct-05 21:39 
GeneralRe: why can't I see my class in the ClassView pane? Pin
ewighell15-Oct-05 6:14
ewighell15-Oct-05 6:14 
GeneralRe: why can't I see my class in the ClassView pane? Pin
fuzz_ball18-Oct-05 15:46
fuzz_ball18-Oct-05 15:46 
QuestionRichEdit Control not Drawing Properly Pin
Steve Thresher14-Oct-05 12:22
Steve Thresher14-Oct-05 12:22 
Questiontoolbar Pin
Archer28214-Oct-05 12:11
Archer28214-Oct-05 12:11 

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.