|
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
|
|
|
|
|
Hello again
How can i bold the text of static box ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hold an appropriate CFont object somewhere (for instance, as a member variable of the parent dialog) and set it as the one used for your static with CWnd::SetFont . As you only need to "boldize" the current font and leave all other aspects unchanged, you can construct it from what your static already has (see CFont::CreateFontIndirect , CWnd::GetFont and CFont::GetLogFont ), changing only LOGFONT::lfWeight .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
That is a *great* title. 'Bold, the text of static box'. It's almost poetic.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
Christian Graus wrote:
It's almost poetic
ROTFLMAO
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Hello !
I want to display a report(*.rpt) by Crystal Report library !
I don't want to use Crystal Report ActiveX ...
Can you write example ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
You could use the Crystal Report API engine, however it's just about reached the end of it's lifetime and I can tell you with a great degree of experience with all things Crystal and C++ that you really, really, really *do* want to use the ActiveX RDC (Report Design Component)
The crystal reports developers help file CrystalDevHelp.chm that is installed with Crystal Reports contains the full reference for using the API in the section titled "The Crystal Report Engine Class Library Reference".
We've used the API for many years but we're switching all our development to the ActiveX for many reasons: It's the only method they fully support, it's the only method they want people to use because their dropping the API by the looks of it quite soon, the ActiveX RDC has increasingly (after each release) more functionality than any other method.
Whenever they add a new function they only seem to be adding it to the ActiveX from now on.
But most importantly, it's far, far easier to use the ActiveX and there is no more overhead than any other method.
Ground Zero Tech-Works
http://www.ayanova.com
|
|
|
|
|
Hello Mr. Cardinal,
Thanks for reply !
But i have to use CR API engine ...
Because my BOSS told me that i don't register any ActiveX in the user computers
So, i have to use API engine ... right ?
If i use CR API engine then i don't need to register any ActiveX or DLL ??
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|