|
Its amazing how much good icons can improve your application.
I used to spend ages making, what in the end turned out to be pretty crap, icons.
check out www.glyfx.com, they have a free version of the typical icons available with VC++ but you can pay them for more advanced icons.
or if you feel adventurous try out
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwxp/html/winxpicons.asp
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
How can I get the width of a char in a view(in pixels). It seems to be difficult for me coz each chars width will be different
|
|
|
|
|
GetTextExtent or GetTabbedTextExtent API functions or correspoding methods of CDC in MFC.
Pavel
Sonork 100.15206
|
|
|
|
|
Since I want the char size in OnChar function itself, i cannot use GetTextExtent API. I have the log font size stored in a variable. But it is in logical units. I want to get the pixel size.
|
|
|
|
|
You can use CWnd::GetWindowDC/ReleaseDC to get/release a display context of the window.
Pavel
Sonork 100.15206
|
|
|
|
|
Try this ...
CSize size = pDC->GetTextExtent(sChar);
int nWidth = size.cx;
Best regards,
Eugene Pustovoyt
|
|
|
|
|
Since I want the char size in OnChar function itself, i cannot use GetTextExtent API. I have the log font size stored in a variable. But it is in logical units. I want to get the pixel size.
|
|
|
|
|
I need to use a device driver (developed by a colleague of mine)
in my application that runs on WINNT and I have the following problem:
I can access to the driver (CreateFile and OpenEvent) only if
I'm logged with an Administrator user.
Non-administrator users cannot access to the driver even if it
starts automatically with the OS.
Is this a normal situation or can I do something to allow the
application to access to the driver even if it is used by a
non-Admin user ???
|
|
|
|
|
I assume you checked the return code for the failed CreateFile() and it was #5 (access denied). If so then the most likely problem is the device driver was installed requiring admin privs to connect to it. Check the install.
|
|
|
|
|
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."
|
|
|
|