|
What's that thingy called?
I'm trying to add one to my app. If you're not sure what I mean, open Windows Explorer and make the left pane much wider, which results in a now shorter right pane. What the heck is that thing called that lets you do that? The closet I've come so far is "Rebar control" and that seems to only apply to the one control it's attached to.
I'm attempting to add one to my app using C++ through the API, so if you can step up and play "Name That Control" I'd appreciate it. No MFC references please.
--chajadan
|
|
|
|
|
|
Well that definitely gave me an anchor point for my searches, but I'm looking for the direct Win32 API calls I need to make, not the MFC ones. Perhaps if I knew of a good MFC reference that detailed the underlying API calls things would be much easier on me, but I don't.
--chajadan
|
|
|
|
|
Splitters are not a built-in control, you'll need to code them yourself. For a good reference, check out MFC Internals which goes into painstaking detail on MFC's splitters.
--Mike--
Just released - RightClick-Encrypt v1.4 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Hi Gang,
I was wondering if anybody has a sample of a CFileDialog where I can select more than 12 items. It reliably selects 12, just nothing more. When more are highlighted, it just returns nothing. Any ideas?
Env: VC6,sp5,XP/SP1
Thanks,
Nick
|
|
|
|
|
my memory of this is that for multi selection to work you must ensure that the buffer you pass in for the filenames is adequately sized.
might this be the problem?
|
|
|
|
|
|
Nishant S wrote:
You need to allocate enough memory for the lpstrFileTitle member of the OPENFILENAME struct as well change the nMaxFile member!
Nish
Hey Nish, do you by chance have a quickie example? My program keeps excepting. I'm sure it's something simple.
Thanks for the help,
Nick
|
|
|
|
|
Hi Nick,
the following code allows you to open multiple files in a MDI app.
Tabbing got lost
<br />
void CManagerApp::OnFileOpen() <br />
{<br />
CFileDialog dlg(true, _T("process"), NULL,<br />
OFN_ALLOWMULTISELECT | OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY,<br />
_T("Process definitions (*.process)||"));<br />
<br />
DWORD dwMaxFile = 4096;<br />
dlg.m_ofn.nMaxFile = dwMaxFile;<br />
LPTSTR pszFilenames = new TCHAR[dwMaxFile];<br />
dlg.m_ofn.lpstrFile = pszFilenames;<br />
dlg.m_ofn.lpstrFile[0] = NULL;<br />
<br />
if (dlg.DoModal() == IDOK)<br />
{<br />
POSITION pos = dlg.GetStartPosition();<br />
while(pos)<br />
OpenDocumentFile(dlg.GetNextPathName(pos));<br />
} <br />
<br />
delete[] pszFilenames; <br />
}<br />
Alwin
|
|
|
|
|
How do I make my CListCtrl not show the horizontal scroll bar? I don't need it to horizontally scroll, and the scroll bar is taking up much-needed space.
Thanks!
|
|
|
|
|
Either:- Make sure your columns are narrower than the width of the control (if in report mode), or
- Make sure all the icons are positioned within the visible area (if in icon mode), or
- Use the
LVS_NOSCROLL style (this will get rid of *both* scrollbars though...)
---------------- Shog9 ----------------
------- Drink Coca-Cola -------
---- Use SciTE ----
|
|
|
|
|
How do I resize the column to the right size, depending on whether there is a vertical scroll bar or not? I thought about just subtracting the system width of scroll bars from the column's width, but then it would also be that size if there wasn't a vertical scroll bar.
|
|
|
|
|
If you've only one column, you can use the special value LVSCW_AUTOSIZE_USEHEADER to automatically make it full width (assuming the content is less than full width). If you've more than one column, this will still work assuming they all add up to less than the width of the control, but the extra space will all be given to the last column.
---------------- Shog9 ----------------
------- Drink Coca-Cola -------
---- Use SciTE ----
|
|
|
|
|
Thank you, that did the trick
|
|
|
|
|
Hi.
Is it possible to pass a pointer to a class member function to a worker thread?
Otherwise, is it possible to pass in a global function? If yes, do you have to use typedef (*func)(parameters)?
Thanks,
Kuphryn
|
|
|
|
|
1. no. well, not directly, in most cases. you could, for example pass the object itself and then use the function from there. or if the function is a static member function, you can pass it as a normal function pointer. but, passing a non-static member function isn't possible because there's no "this" pointer to establish a context for the function.
2. yes, if you're passing the function pointer. no, if you're passing a class.
-c
Greenspun's Tenth Rule of Programming:
"Any sufficiently complicated C or Fortran program contains an ad-hoc, informally-specified bug-ridden slow implementation of half of Common Lisp."
|
|
|
|
|
|
|
DrPizza of GameDev brought up a solution I missed yesterday. The solution is to encapsulate a function in a struct that is a class member. That will allow you go not have to declare a global function.
The only thing I am uncertain of is if you have a private member struct, will the global worker thread function i.e. the function you pass to __BeginThread() recognize the abstract private member.
Kuphryn
|
|
|
|
|
Hi.
How do you pass data and/or pointer to data in a parent process, both primary and/or child threads, to the primary thread (default) of a child process?
Jeffrey Richter demonstrates the use of CreateProcess(), but he does not discuss a way to pass in data.
Thanks,
Kuphryn
|
|
|
|
|
You need to use an IPC mechanism like NamedPipes, sockets or - the most easy one, shared memory.
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
|
Okay. Thanks.
Which method of passing data across processes performs best?
Kuphryn
|
|
|
|
|
Don't pass pointers across process boundaries.
Each process has its own addresses for stuff.
Create a shared memory space and use offsets
into that as your sharable "pointers."
(You can try to map the memory to the same address
in each process, but that isn't guaranteed to
be successful.)
|
|
|
|
|
Okay. Thanks.
I re-read Jeffrey Ritchter's section on file-mapping. I believe using a file-mapping virtual memory is an effective, if not, the best way to share data across processes.
Kuphryn
|
|
|
|