|
The strings I display in the CCombobox might be longer than the specified combobox width.
I need to enable horizontal scroll bar for above purpose.
Please suggest me how to do that.
Thanks a ton
|
|
|
|
|
ArtiGujare wrote: Please suggest me how to do that.
Use the SetHorizontalExtent() method.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
|
i don't understand what you want to do...
you want to use system() , or you have to ?!
|
|
|
|
|
for invoking dos com. or like run in start in win.
pl help me
Thanks,
Anji.Manchikanti
|
|
|
|
|
you didn't answer his question I think.
what i understood is that he asked if you were obliged/told to use system (to invoke dos commands), or you ask about how using it (or how doing such dos cmd calls).
as DavidCrow said, system() is not a safe function to use, and as much as possible, avoid using it. prefer calling the ShellExecute() Win32 API instead.
-- TTD --
|
|
|
|
|
anjicafe wrote: now i am using system() in vc++6.0...
Don't use this antiquated API. Use CreateProcess() or ShellExecute() instead.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
include stdlib.h before using system();
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
hi
I need to get the date as follows
Desired output eg:current date and time : 4/18/06 2:25:02PM
I used the following code but i want to know whether it's AM or PM and also i want the time in 12:00 format not 24:00hrs.
COleDateTime dtCurrentDate ;
dtCurrentDate = COleDateTime::GetCurrentTime() ;
strDate.Format(_T("%d/%d/%d\t"),dtCurrentDate.GetMonth(),dtCurrentDate.GetDay(),dtCurrentDate.GetYear()) ;
strTime.Format(_T(" %d:%d:%d"),dtCurrentDate.GetHour(),dtCurrentDate.GetMinute(),dtCurrentDate.GetSecond()) ;
strDesc += _T("current date and time")+ strDate + strTime;
thanx in advance
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
-- modified at 10:54 Friday 21st April, 2006
|
|
|
|
|
Try using the COleDateTime::Format(...) method. It allows formatting of date/time information a'la strftime(...)/_tcsftime(...) . If you want to avoid CString , you can get the underlying time value into a tm structure and pass it with your own buffer to strftime(...)/_tcsftime(...) .
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Use COleDateTime::Format for this purpose.
It returns a CString built up with the format specifiers given as argument.
E.g. Format( "%I:%M:%S %p" ), this gives a time string such as "4:51:14 PM".
Hope this helps
--
Roger
It's suppose to be hard, otherwise anybody could do it!
-- modified at 10:56 Friday 21st April, 2006
Changed to a capital 'S' in the format string
|
|
|
|
|
Hi!
I have a listview control ("SysListView32" window class) in my application.
The content of this listview is changing frequently (say 1 (insert or delete) item/sec).
It is created with (LVS_NOCOLUMNHEADER | LVS_REPORT | LVS_SORTASCENDING | LVS_SINGLESEL | LVS_OWNERDRAWFIXED) style flags.
If we see the last items of the listview (the scrollbar is on the bottom) and the inserted (or deleted) item's position is on the beginning of the list, the whole content of the listview is scrolled up / down (because the scrollbar position is not changing).
I thing this is very annoying for the users (and for me), and I decided to "fix" the position of the scrollbar by using the LVM_ENSUREVISIBLE and WM_SETREDRAW messages like this:
1, send WM_SETREDRAW (FALSE)
2, send LVM_INSERTITEM or LVM_DELETEITEM
3, adjust the scrollbar position by sending LVM_ENSUREVISIBLE
4, send WM_SETREDRAW (TRUE)
It works fine with LVM_DELETEITEM.
But LVM_INSERITEM scrolls the content (it is visible!) even if there is the "setredraw(false)" call before sending LVM_INSERITEM message!
Has anybody ever faced this problem or maybe I did something wrong?
Thanks,
mate
(I already posted this to another forum but i had no answer)
|
|
|
|
|
I have a program that disables the wireless NIC when a hard-wired network connection is detected. It works fine but there is one catch - when you want to use wireless later, you have to go to the Network Connections window and click Disable, then Enable to get it working again. People at our company just cannot remember to do this and I would really like to avoid them having to do this if possible.
The method of disabling the NIC I have used is roughly:
myMIBIFROW.dwAdminStatus = MIB_IF_ADMIN_STATUS_DOWN;<br />
dwError = SetIfEntry(&myMIBIFROW);
It works but one drawback is that the control panel Network Connections window still thinks it is enabled after this. I think this is why you have to click Disable first then Enable to get the wireless going again.
So, does anyone know how to programatically simulate a click on the Disable and Enable menu options? Any other tricks to help?
BTW - setting the status to up and calling SetIfEntry() did not work.
Thanks.
Dave
|
|
|
|
|
Sir,
I want to get some information of a cell (index of image, text etc)from a CListctrl(Report view) by giving the selected row index and column index.
Thanks in advance
Sandeep A.C
Sanc
|
|
|
|
|
use GetItem()
TCHAR tcText[MAX_PATH];
LVITEM litem;
litem.mask = LVIF_IMAGE|LVIF_TEXT;
litem.pszText = tcText;
litem.cchTextMax = MAX_PATH;
GetItem( &lviItem );
|
|
|
|
|
Might help to specify the iItem and iSubItem values as well...
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
HI,
How do we get the database into the comboboxes of domodal dialog boxes(Multiple dialog boxes).I've got it into the main dialogbox.
pls let me know
swapna_signsin
|
|
|
|
|
pass the database to dialog.
i often do in this way, create a function:
int MyDialog::MoModal(MyDatabase*pDB)
{
//p_DB is class member variable: MyDatabase*p_DB;
p_DB=pDB;
return CDialog::DoModal();
}
then you can use p_DB in any way as you like.
A special image tool for C++ programmers, don't miss it!
The world unique Software Label Maker is here for you and me ...
A nice hyper tool for optimizing your MS html-help contents.
|
|
|
|
|
i tell u, there is no such thing.
the dialog is "domodal" in same thread whatever how to call it.
A special image tool for C++ programmers, don't miss it!
The world unique Software Label Maker is here for you and me ...
A nice hyper tool for optimizing your MS html-help contents.
|
|
|
|
|
Hi
Does anyone knows if it possible to open a .txt file in main() with the usual
ifstream in1("input.txt", ios::in) written in the main() body, and then pass to a certain function or class member function a pointer pointing to the first character of the file, without having to open the "input" file from this function. If this is not possible, how can I ask the function through some argument to open itself the file? (the function should open the file even is his name is not "input", the name could maybe be given as argument?...)
Thanks
|
|
|
|
|
Do like this. Open the file using following code,
ifstream fin;<br />
fin.open("input.txt", ios::in);
now pass this fin to your function.
You should declare your function lile this,
your_function(ifstream &in, ...);
The in will contain address of fin. So you can perform file I/O operations using in
In case of any proble, let us know.
Good luck
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
Dear All,
How can I change views of CView type to CScrollViews?
This I dont want at runtime but at designtime.
What changes have to be made?
Do I have to change other OnDraw alogirthms too? since Here I would have to take consideration of available view window rect.
Best regards,
pathak
|
|
|
|
|
pathakr wrote: How can I change views of CView type to CScrollViews?
Modify the view's .h and .cpp files.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
very easy.
1)create a new project with CScrollView as view.
2)change CView to CScrollView for old project
3)compare 2 projects to see what default functions etc you should add to old project.
anyway, backup old project first
A special image tool for C++ programmers, don't miss it!
The world unique Software Label Maker is here for you and me ...
A nice hyper tool for optimizing your MS html-help contents.
|
|
|
|
|
Hi,
I have lines places. I want to identify lines by clicking on them.
Many onLButtonDown I can scan the array of all the lines and see
whose vertex is nearer and get the line.but this may not be correct always.
How about mouse sticking in between the two vertexes, suppose I want to move the line.
Thanks
Leya
|
|
|
|