|
yogendra kaushik wrote: i want to fetch date from mysql table into mfc dialog box date time picker control
wat problem is that date stored in mysql in format yyyy-mm-dd
and mfc store in the format dd-mm-yyyy
so it does not fetch the date only
can u tel me the code how to fetch date from mysql format yyyy-mm-dd
into mfc format dd-mm-yyyy
Here is the code ... which converts the date extracted from the mysql and put it into DTPicker control.
CString strTestDate("2006-05-05");
SYSTEMTIME currTime;
GetSystemTime(&currTime);
sscanf(strTestDate.GetBuffer(0),"%u-%u-%u",&currTime.wYear,&currTime.wMonth,&currTime.wDay);
strTestDate.ReleaseBuffer();
m_DateTime=CTime(currTime);;
UpdateData(0); Where strTestDate is fetched date from mysql. and m_DateTime is the control variable of the DTPicker control of type CTime.
here GetSystemTime is required to get the correct format result of the date picked from the mysql table.
Hope you are looking for same.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
the problem:
=============
i use a flash object in VC6 dialoge MFC (on winxpsp2), try to subclass this object by all methods never, try to use SetWindowLong with him dosn't work, try to catch any messages from him callback don't work , any thing don't know why
what i want :
=============
is to prevent the right popup menu of macromedia Inc and replace it with
a menu from our dialoge ,i reinsatall windows 3 times and vc6 3 times and replace 3 pc's with win98 win2000 and nothing happen the same result .
Could you :
=============
send me an Example of how to subclass or even recive the WM_RBUTTONDOWN
from the flash object (ocx)
feel free to contact
haitham_hamed@yahoo.com
|
|
|
|
|
|
CString s;
LPCTSTR st;
s += CString(st);
in fact, I thought s += st would work.
Christian Graus - Microsoft MVP - C++
-- modified at 4:25 Friday 9th June, 2006
|
|
|
|
|
NoName II wrote: How can I append LPTSTR to CStirng
Here is another way how we can append the LPTSTR to CString
CString strTest("Hello");
LPTSTR lpStr=" World";
strTest.Insert(strTest.GetLength(),lpStr); We can directly add the strings using += operator as it overloaded in CString class
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
See
<br />
LPTSTR lpt;<br />
lpt=(LPTSTR)LocalAlloc(LPTR,256);<br />
strcat(lpt,"test");<br />
CString str;<br />
str=str+lpt;<br />
str.Insert(0,lpt);<br />
str.Append(lpt);<br />
LocalFree(lpt);<br />
whitesky
|
|
|
|
|
have you ever tried the simplest way (with + or += operators) ?
CString str = "hello ";
str += "world !!";
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
NoName II wrote: How can I append LPTSTR to CStirng
LPTSTR pSz="ALOK loves";
LPTSTR pSz2="CP"
CString Combined Str=CString(pSz)+CString(pSz2);
"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
|
|
|
|
|
Does anyone know how to do streaming video feeds with MFC or any other programming style? I'm working on a senior design project for school and we'd like this to be a part of the application I'm designing, the only problem is that I've never done anything like streaming video before. Any help would be greatly appreciated.
-Ben
-- modified at 3:29 Friday 9th June, 2006
|
|
|
|
|
|
I'm making a WTL style DLL with an opening dialog, but i also need to be able to browse files from that DLL. I've triedto use both CFileDialog and OPENFILENAME structure, but neither is working, even though they are working fine in the executeable
OPENFILENAME:
CFileDialog:
CFileDialog dlg(TRUE);<br />
if(dlg.DoModal() == IDOK)<br />
SetDlgItemText(IDC_EDIT1, dlg.m_szFileName);
|
|
|
|
|
hugo_fra_tv2 wrote: I've triedto use both CFileDialog and OPENFILENAME structure, but neither is working
What does 'not working' mean ? You get a crash, it doesn't compile, it does not do what you expected (and explain what you expected and what you get instead), ...
We cannot guess what's happening.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
Yes, the windows file browsing dialog never appears, focus turns to nothing and the whole application is locking.
|
|
|
|
|
Since your application seems to be a non-MFC one, I suppose that CFileDialog does not work because of some missing initialization stuff, required by MFC. Maybe you should call AfxMainInit once in your DLL?
The variant without MFC, based on GetOpenFileName , probably requires a previous call of InitCommonControlsEx initialization function.
See also a related comment here[^].
|
|
|
|
|
Basicly what i've done:
Use the WTL Project Wizard to create a DoModal Dialog based application, replaced _tWinMain with DllMain, and set the file output type to DLL
|
|
|
|
|
Can you be more specific Do you get error?
whitesky
|
|
|
|
|
GetOpenFileName actually returns a BOOL value, not a code which can be compared with IDOK . I think you should use a simple if . If it returns FALSE , you can see what is the problem using CommDlgExtendedError :
if(GetOpenFileName(&ofn))
{
SetDlgItemText(IDC_EDIT1, ofn.lpstrFile);
}
else
{
DWORD error = CommDlgExtendedError();
}
Then investigate the error code, or tell us.
|
|
|
|
|
hugo_fra_tv2 wrote: ofn.lpstrFilter = "All\0*.*\0Text\0*.TXT\0";
This might be the problem normally we specify the filter as follows (seperated with "|" and ends with "||"
e.g
char* pszeFilter = "*.*|*.*|text|*.txt|Music|*.mp3||";
SaRath.
"Don't Do Different things... Do Things Differently..."
Understanding State Pattern in C++
|
|
|
|
|
The separator depends on approach used. If the filter is set in OPENFILENAME structure directly, then '\0' must be used. If the filter is set in the constructor of CFileDialog object, then '|' is used. CFileDialog will convert it to '\0' .
|
|
|
|
|
Is there a possibility to create a datetimepicker in a dialog without days (only with month and year)?
Thanks, Gerhard
|
|
|
|
|
Not without Owner/Custom draw.
You know you're obsessed with computer graphics when you're outside and you look up at the trees and think, "Wow! That's spectacular resolution!"
|
|
|
|
|
Sounds complicated, so I will look for another way to enter month and year.
Thank you for your fast answer, Gerhard
|
|
|
|
|
If you are interested try a custom control, using COleDateTime class.
- NS -
|
|
|
|
|
m_datetimepicker.SetFormat ("yy-MM");<br />
can help you. <br />
<br />
Somethings seem HARD to do, until we know how to do them.<br />
;-)<br />
_AnShUmAn_<br />
<br />
<br />
-- modified at 4:47 Friday 9th June, 2006
|
|
|
|
|
Hallo,
But some things are HARD, even you got an answer that seems to be the solution.
I made my dialog with the wizzard and got a diaolg.cpp with a DoDataExchange-function like this:
DDX_DateTimeCtrl(pDX, IDC_DATETIMEPICKER1, m_begin);
m_begin is a COleDateTime-variable. But where and how do I have to place your Set.Format-code? I tried it with IDC-DATETIMEPICKER1 in an OnInital-function , in a PRECREATE-function, I tried it with the m_begin-variable, nothing works.
Thanks in advance, Gerhard
|
|
|
|