|
hi priyank please ask vc.net related question here[^]
"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
|
|
|
|
|
If you have a standard dialog control and you've done some code for it, but then find a custom control that's based on that, is there an easy way to make the control be of that new class, eg I've done something with a listview but if i wanted to try the alternate shaded row control, can I quickly/easily do that, or is it going to get so messy it's best to start with a new custom control?
http://www.codeproject.com/listctrl/coloredlistctrl.asp[^]
|
|
|
|
|
In fact I just changed the class type in the dialog header file in one line and it worked just fine. I suppose that's because in this case, the class is just the base class with an overridden draw/erase method
|
|
|
|
|
I have a timer handle which does some idle checking. Based on the idleness of the user, I want to do certain updates in the GUI. However, I do not wish to do certain GUI updates IF there is a modal loop active (typically a dialog box open).
Is there a good and generic way to detect this condition using MFC?
|
|
|
|
|
hi...
I am using IOCP technology for my project. in some of the sites i have seen, that in windows 98, this wont be work...,If its so,
then which are technology is available for supporting(chat) in win 98
also....
Is any one knows in GOOGLE TALK and YAHOO messanger which technolgy they are using for communication........?
-- modified at 9:32 Monday 11th June, 2007
|
|
|
|
|
If you're referring to IO Completion ports then I can confirm they're only available as part of the Operating System on NT based Windows, NT, 2000, XP, Vista.
This doesn't stop you implementing something similar yourself with a thread pool and synchronisation objects, It won't be as fast or efficient but lets face it, neither is Win98
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
|
How does one convert SYSTEMTIME to char *
Many Thanks
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
Programm3r wrote: How does one convert SYSTEMTIME to char *
Use <code>COleDateTime .
SYSTEMTIME sysTime = { 0 };
GetLocalTime( &sysTime );
COleDateTime odtDtTime( sysTime );
CString csTime = odtDtTime.<code>Format</code>(_T("%A, %B %d, %Y"));
|
|
|
|
|
|
Programm3r wrote: How does one convert SYSTEMTIME to char *
Outside of MFC, sprintf() will work just fine.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
|
Programm3r wrote: if (CompareFileTime((FILETIME*)dateCreated, &ftCreate)==0)
The first argument should be a pointer to a FILETIME structure. You have a char that has been cast to such.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
This will work:
wsprintf(lpszString, "%02d/%02d/%d %02d:%02d:%02d",stCreate.wYear, stCreate.wMonth,
stCreate.wDay,stCreate.wHour, stCreate.wMinute, stCreate.wSecond);
if (strcmp(dateCreated, lpszString)==0)
{
...
}
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
If you are simply wanting to know if two SYSTEMTIME structures are equal, why not just use memcmp() ?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: why not just use memcmp()?
Don't know ... haven't though of that, but the strcmp is working fine, unless you for see a problem?
Thanks David
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
Programm3r wrote: ...unless you for see a problem?
No problem, other than an unnecessary call to wsprintf() .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
GetTimeFormat() and GetDateFormat()
|
|
|
|
|
Programm3r wrote: How does one convert SYSTEMTIME to char *
memcpy i.e.
char *charMem = new char[sizeof(SYSTEMTIME)];
memcpy(charMem,sysTime,sizeof(SYSTEMTIME));
"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
|
|
|
|
|
Hello All,
In my dialog box, I want to use an image on a button, so I made it as Owner Draw, I use CBitmapButton class and it is working fine. But when ever the dialog comes up, the initial focus is on the user defined button only. Here is the code for bitmap button
CBitmap bmp;<br />
BITMAP bm;<br />
bmp.LoadBitmap (IDB_ENABLE_BMP);<br />
bmp.GetBitmap (&bm);<br />
m_oMyBtn.SetWindowPos (NULL, 0, 0, bm.bmWidth, bm.bmHeight, SWP_NOMOVE | SWP_NOOWNERZORDER);<br />
m_oMyBtn.LoadBitmaps (IDB_ENABLE_BMP, IDB_SEL_BMP, IDB_FOCUS_BMP, IDB_DISABLE_BMP);
I found when ever I use "SetWindowPos" the initial focus is always on the owner draw button. If I remove "SetWindowPos" function then the focus is as per my tab order settings.
My idea is to resize the button as per the image size. If any other way to do that let me know.
Thanks for your time
BlrBoy
|
|
|
|
|
Hi BlrBoy,
Try using SWP_NOZORDER in your SetWindowPos function. This retains the Z-order of the control.
Hope that helps.
Kiran.
|
|
|
|
|
I am working on a project in C++/MFC that requires me to add custom buttons to Word 2007. I have been able to find tons of information using VB and C#, but nothing in C++ and only for creating a project from scratch. Anyone have any suggestions?
|
|
|
|
|
Hello,
I have creating a window with my menu which done in the following code
CreateMenu();
AppendMenu(MF_STRING, id_Data, "Data");
AppendMenu(MF_STRING, id_Edit, "Edit");
AppendMenu(MF_STRING, id_Entity, "Entity");
The above code works fine.
Now I want to add a popup menu to Data menu
How should I do That ?
Thanks
Pritha
|
|
|
|
|
Hi Paritha,
Here is a sample code:
<br />
CMenu menu;<br />
menu.CreatePopupMenu();<br />
<br />
menu.AppendMenu(MF_STRING, 10, "item 1");<br />
<br />
CPoint pt;<br />
GetCursorPos(&pt);<br />
<br />
CMenu menu1;<br />
menu1.CreatePopupMenu();<br />
menu1.AppendMenu(MF_STRING, 11, "Item 1 in submenu1");<br />
<br />
menu.AppendMenu(MF_POPUP, (UINT_PTR)menu1.m_hMenu, "Submenu1");<br />
menu.TrackPopupMenu(TPM_RETURNCMD, pt.x, pt.y, this);<br />
Hope that helps.
Kiran.
|
|
|
|