|
i've never used that method of creating lists.. but ive used bunches of them and have always specified the widths of the columns.. here is how i do mine.. dunno if it'll help er not..
void CTopView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
ListView_SetExtendedListViewStyleEx(m_lstReportList.GetSafeHwnd(), NULL, LVS_EX_FULLROWSELECT | LVS_EX_SUBITEMIMAGES);
m_lstReportList.InsertColumn(0, "Form", LVCFMT_LEFT, 55);
m_lstReportList.InsertColumn(1, "Description", LVCFMT_LEFT, 238);
m_lstReportList.InsertColumn(2, "Period", LVCFMT_LEFT, 70);
}
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
dazinith wrote:
i've never used that method of creating lists.. but ive used bunches of them and have always specified the widths of the columns.. here is how i do mine.. dunno if it'll help er not..
Yeah, I've used that method in other applications and it works like a charm, but this application is written in Win32, not MFC.
thanks though.
Gotta work with what ya got in this case. Anyone else have a suggestions?
|
|
|
|
|
Actually,
Your replay gave me an idea. I checked the MFC code realizing that MFC is just an OO implementation of Win32, and Looked into the InsertColumn. That told me everything I needed to know, which happened to be me forgetting to add the LVCF_WIDTH to the item mask. that took care of my problem.
Thanks!
|
|
|
|
|
I don't know if I understand your question correctly. You want to set the width of the columns, so that the column text prefectly fits in? You could try GetTextExtentPoint32 to set the width directly to the width of your string.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I have a Formview class and I'm trying to display a message box when the user hits the X to close the form. If I do the processing in OnDestroy, the message box doesn't show up until after the form has closed.
How can I show this messagebox before the form goes away? I tried to catch a WM_CLOSE or WM_DESTROY message with PreTranslateMessage, but neither seem to work.
|
|
|
|
|
Interesting. Add some breakpoints in OnClose(). What gets called when you exit the program?
Kuphryn
|
|
|
|
|
|
ShellExecute ( NULL, "open", "control.exe", "Speech", NULL, SW_NORMAL ) ;
Desired result:
the user clicks on a button in dlg and Speech settings applet opens.
Problem is when SAPI 4 and 5 coexist on the same machine, two Speech icons are present and it doesn't open the applet
Any suggestions on how to approach this problem?
Thanks
Later, JoeSox www.joeswammi.com The only thing that saves us from the bureaucracy is inefficiency. An efficient bureaucracy is the greatest threat to liberty.
Eugene McCarthy
|
|
|
|
|
All,
I have a routine that writes to a USB device using the WriteFile API. The problem is, the USB device I'm writing to has a low battery, so when the WriteFile attemps to send data, it never gets a response back from the device.
The WriteFile gets its handle from an HID driver (Human Interface Device). I am calling the WriteFile with the LPOVERLAPPED structure (I need it for the ReadFile API, and you can't mix and match overlapped with non-overlapped). I would like to have the function return if it doesn't get a response back after X number of retires or X number of seconds...either or.
Any suggestions on how I can do this?
Regards,
Brigg Thorp
Software Engineer
Timex Corporation
|
|
|
|
|
What do you mean the function does not return? Given that the design is non-blocking via OVERLAPPED I/O, WriteFile() should return immediately.
Kuphryn
|
|
|
|
|
Since the USB device I'm writing to has a low battery, there is never a return message packet sent back to Windows from the WriteFile. So, the system just hangs in the WriteFile event forever. I put a breakpoint on the line after the WriteFile and it never gets there. Is there any way to cancel the IO after say 5 seconds of inactivity?
Regards,
Brigg Thorp
Software Engineer
Timex Corporation
|
|
|
|
|
Interesting. In terms of C++, one solution is be an exception try/catch.
Kuphryn
|
|
|
|
|
I have a CFormView and I need to capture the ESC key. The control the has the focus always receive the OnChar but the form never does. I don't want to use an Accelerator nor any code on the controls.
Any Ideas?
|
|
|
|
|
Just a guess:
Override PreTranslateMessage in your CFormView.
Mazy
"And the carpet needs a haircut, and the spotlight looks like a prison break
And the telephone's out of cigarettes, and the balcony is on the make
And the piano has been drinking, the piano has been drinking...not me...not me-Tom Waits
|
|
|
|
|
PreTranslateMessage is never called on the CFormView
|
|
|
|
|
thats how i did it.. here is some code from one of my dialogs that is derived from CFormView..
in my .h
BOOL PreTranslateMessage(MSG* pMsg);
in my .cpp
BOOL CST3WKSHT::PreTranslateMessage(MSG* pMsg)
{
CSCTaxApp* pApp = (CSCTaxApp*)AfxGetApp();
if(pMsg->message==WM_KEYDOWN && pApp->m_bEnterAsTab)
{
if(pMsg->wParam==VK_RETURN)
pMsg->wParam=VK_TAB;
}
return CFormView::PreTranslateMessage(pMsg);
} this converts my keypresses from enters to tabs.. and it does work.. hope that helps
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
Thank for the help. I had a problem in my code:
MSDN Library:<br />
PRB: Modal Dialog Box Prevents Calls to PreTranslateMessage <br />
ID: Q126874
|
|
|
|
|
Hello,
After using VS6 a lot I found out how to save my work environment (window positions, toolbar and menu bar content and positions, fonts, colors etc.) by experimenting with the registry. This is extremely useful when you reinstall your machine or if you use a lot of test machines where you just don't want to reconfigure everything.
While migrating to VS7 I find that this is no longer possible. I just don't know where my settings are stored. I tried saving all the registry settings I could find (and this is bad, because I only would like to save the parts that are related to the UI - and is of no help anyway), the files I thought that are worth saving but I am still unable to backup my environment.
Anyone knows where all this stuff gets saved?
Regards,
Levente
------------------------------------------->>
Life is tough. Then die you do. [Yoda]
|
|
|
|
|
Levente Farkas wrote:
Anyone knows where all this stuff gets saved?
Unfortunately, not me. But I have often wondered about this myself.
From what I have heard the config is stored all over the show, registry, config files, etc.
If any one figures this out. Please share.
[edit]
It seems we're not alone... How do I move my VS.NET Studio Settings to another Computer?[^]
Oh and this message probably should be in the VS.NET IDE Issues forum.
[/edit]
Bruce Duncan, CP#9088, CPUA 0xA1EE, Sonork 100.10030 Blackadder: Baldrick, have you no idea what irony is? Baldrick: Yeah, it's like goldy and bronzy only it's made of iron.
|
|
|
|
|
Yeah, right. I just saw that there is such a forum called "VS.NET IDE issues".
------------------------------------------->>
Life is tough. The die you do. [Yoda]
|
|
|
|
|
How do you make a toolbar or dialogbar in a DLL that you can dock with the main window in mfc, and if possible have the DLL handle the messages output from the toolbar.
Is there any easy way to do this?
|
|
|
|
|
I used Seagate Crystal Report 8.5 with my VC project. It's excelent on printing and preview. But when I export the datasheet to MsWord or MsExcel, the column's borders and the row's borders disappear (but when I export to Acrobat PDF, it works)
Just a question: why Seagate can't export completely with border on MsWord and MsExcel ?
=======================
Nothing is perfect
|
|
|
|
|
Hi,
I am looking for books that will help me learn about windows networking API's. Say I want to know the ways by which I can transfer a file from one computer to another under windows 2k. Obviously FTP is the answer, but are there any other ways ?
I am looking forward to your suggestions.
~ Vimal
|
|
|
|
|
if you are just copying a file and its a local network then you can use regular file copy commands and just pass the network name of the computer and path.. like '\\mycomp\uploads\'.. it really depends on the use as to what methods you would want to use.. obviously you wouldn't want to use ftp unless you are going to have machines running ftp servers as well..
still a newb.. cut me some slack :P
-dz
|
|
|
|
|