|
Try
FILE * file = fopen(file_name, "rb");
The key issue is the "b" flag.
|
|
|
|
|
hi friends,
i dnot any thing of logger thread. i want capture diff. type exceptions and logger file cacth exceptions and put into one files.
pls Guide
satya
|
|
|
|
|
bujji_bec wrote: i want capture diff. type exceptions and logger file cacth exceptions and put into one files.
create a Out process logger exe and insert your loggig message there!@
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
can i know how to store a date format dd-mm-yyyy as in mfc in to
mysql table in the format yyyy-mm-dd send code plz
hi
|
|
|
|
|
<br />
CString m_cdate;<br />
SYSTEMTIME sysTime;<br />
GetSystemTime (&sysTime);<br />
<br />
m_cdate.Format("%04d-%02d-%02d", sysTime.wYear, sysTime.wMonth, sysTime.wDay);
Now write it to the table
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
-- modified at 9:42 Tuesday 6th June, 2006
|
|
|
|
|
yar this will give problem that GetYear(),GetMonth(), GetDay() are not member of SYSTEMTIME if ucan find solution mail me at gourav_d1983@indiatimes.com
hi
|
|
|
|
|
Use this code //
<br />
<br />
SYSTEMTIME sysTime;<br />
GetSystemTime(&sysTime);<br />
CString s;<br />
s.Format("%04d/%02d/%02d",sysTime.wYear ,sysTime.wMonth,sysTime.wDay);<br />
AfxMessageBox (s);<br />
<br />
Does this work ........
It will................
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
-- modified at 9:37 Tuesday 6th June, 2006
|
|
|
|
|
I tried and tested the code on my machine and it runs well producing the desired output.
Any ways you can try using CTime as Laxman suggested or use COleDateTime
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
sorry to disturb u again ur query give correct ans
but my problem is that i want to display not only current date but also other dates whiich i specify on form and that are stored in mysqltable
how other dates r stored in table
gourav dogra jfjunf
|
|
|
|
|
When you are retreiving those dates from the table they would be in string format as I guess. So you just have to format the strings using the
CString::Format() , to get the date in the desired manner and display it then . Post some code so that the problem can be traced out
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
As i use date time picker in vc++ form so now set a date on it and i want that this date is stored in mysql table but always it store current date.
i uses the code as u tel me code is:
SYSTEMTIME sysTime;
GetSystemTime(&sysTime);
CString s;
s.Format("%04d/%02d/%02d",sysTime.wYear ,sysTime.wMonth,sysTime.wDay);
now i want to srore other than systemdate in mysql table that is to store "1999-09-03" but when i set this date on date time flicker it will store today date as 2006-06-07
gourav dogra jfjunf
|
|
|
|
|
I think that you are having a problem in the way you are thinking and asking.
Soln:
m_datetime is the datetime control.
Now when the user modifies the date in the control you can use the following code to get the date that the user had selected in the control
m_datetime .UpdateData();
char *str=new char[100];
m_datetime.GetWindowText (str,10);
AfxMessageBox(str);
// str has the date.
//Extract the date from str and now continue.
Now are you able to get the soluction or some other problem
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
-- modified at 2:11 Wednesday 7th June, 2006
|
|
|
|
|
sur my problem is i enter date in date time picker and code read this value through the :
GetDlgItemText(IDC_DATE,jdate)
where IDC_DATE is id of date time picker and jdate store this value
and i declare this jdate as CString.
now i want that value from GetDlgItemText(IDC_DATE,jdate) is stored into mysql table which i specify
i try this code what as i tel u i use jdate instead of m_datetime then it give errors
m_datetime .UpdateData();
char *str=new char[100];
m_datetime.GetWindowText (str,10);
AfxMessageBox(str);
gourav dogra jfjunf
|
|
|
|
|
Please quote the errors. Try to get the values using GetWindowText. I have already tested the code above that i provided you in this thread earlier.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
when i declare
CString jdate;
GetWindowText(IDC_DATE,jdate);
jdate .UpdateData();
char *str=new char[100];
jdate.GetWindowText (str,10);
AfxMessageBox(str);
F:\gourav\DOGRAPROJECT\AgainDialog.cpp(196) : error C2664: 'int __thiscall CWnd::GetWindowTextA(char *,int) const' : cannot convert parameter 1 from 'const int' to 'char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
F:\gourav\DOGRAPROJECT\AgainDialog.cpp(197) : error C2039: 'UpdateData' : is not a member of 'CString'
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString'
F:\gourav\DOGRAPROJECT\AgainDialog.cpp(199) : error C2039: 'GetWindowTextA' : is not a member of 'CString'
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString'
F:\gourav\DOGRAPROJECT\AgainDialog.cpp(205) : error C2065: 's' : undeclared identifier
F:\gourav\DOGRAPROJECT\AgainDialog.cpp(205) : error C2666: '+' : 4 overloads have similar conversions
Error executing cl.exe.
DOGRAPROJECT.exe - 5 error(s), 0 warning(s)
no plz hwlp me i am very confused with this and cannot undestand wat to do
gourav dogra jfjunf
|
|
|
|
|
First of all jDate should not be a string . It should be a control variable for the date time control. Create it using the class wizard and don't take it as a value take it as a control
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Have a look at my previous post carefully. You will find that the variable m_datetime should be a control variable and not a string type variable and then use the code provided in the previous post
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
///////////plz do reply///////////////
thanks this will works but how itwill be converted into mysql format
m_datetime .UpdateData();
char *str=new char[100];
m_datetime.GetWindowText (str,10);
AfxMessageBox(str);
now how can i convert str into string so that iw will store in mysql table;
can i convert it wuth this but as str is not redefined so wat can i do now
SYSTEMTIME m_jdate;
GetSystemTime(&m_jdate);
CString s;
s.Format("%04d/%02d/%02d",m_jdate.wYear ,m_jdate.wMonth,m_jdate.wD
hi
-- modified at 4:11 Wednesday 7th June, 2006
|
|
|
|
|
paras_s12 wrote: can i know how to store a date format dd-mm-yyyy as in mfc in to
mysql table in the format yyyy-mm-dd send code plz
Format the date as
CTime t;
CString strdate=t.Format("%Y-%m-%d");
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
See here.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
it works thanku for this but it will not display other date
it display only current date
is it possible if then tel me how
hi
|
|
|
|
|
Your original question was about formatting a date to store in a database table. I showed you how to format the date. I assumed you already knew how to store data in the table. What about "displaying" are you wanting to know?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I have two objects: CBitmap bmp1, CBitmap bmp2. There is a sample picture in the bmp1 and the same picture in the bmp2.
Now, I get a copy of the part bmp1 and put it to the CBitmap bmp3. But I don't want to create another CBitmap object. I want release bmp2 interior and put there the new part of the picture wchich is in the bmp3. How can I do it. I can't do bmp2 = bmp3, there is no function like: bmp2.Assign(bmp3).
What can I do?
Regards
mwgomez
Poland
|
|
|
|
|
if you want to copy bmp3 to bmp2 you can use :
bmp2->Canvas->Draw(0,0,bmp3);
bye
|
|
|
|
|
V_shr wrote: bmp2->Canvas->Draw(0,0,bmp3);
Where is Canvas variable Situated?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|