|
Yes, absolutely. But I already have the drive letter and information in hand except if its a media device (easy to get though).
As Mike said, it's the way the character information is being stored, so when I grab the file, it kicks back an all uppercase filename. ugh. not sure how to deal with it.
Dan Willis
|
|
|
|
|
>> not sure how to deal with it
change the interface to make the user supply the target filename using a SaveAs Dialog, u know the same way IE does when you download a file?
"No matter where you go, there your are..." - Buckaoo Banzi
-pete
|
|
|
|
|
is this possible? i see nothing in the MSDN about it, there's no "owner-drawn" style checkbox on the scroll bar property page, and i see no articles here or on codeguru about it.
i want a sexy little scroll bar..., not the boring old everyday ones.
-c
Be very, very careful what you put into that head, because you will never, ever get it out. --Thomas Cardinal Wolsey
|
|
|
|
|
Well I'm sure I've seen OD scroll bars, but where... Have you looked on CodeGuru. Doesn't the WinXP Theme stuff let you control the look of any and every control. I don't know whether GUIgui at http://www.nopcode.com[^] mucks with scroll bars, but it is worth a look.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
I have seen them, but I am not sure if they were ownerdrawn scrollbars or custom controls. If I were to try this, I would take a look at the GetScrollBarInfo() (SDK or MFC links) function, it looks promising as it returns the scrollbar's coordinates, thumb size and position, and the state of the various scrollbar components. Maybe call this function in your scrollbar's WM_PAINT handler.
HTH
CPUA 0x5041
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
It's not horrible to implement your own scroll bar. Unfortunately, the example I have belongs to my employer .
Software Zen: delete this;
|
|
|
|
|
Why the GetBuffer?
str2.Format(_T("item %d: %s\r\n"), i, str.GetBuffer(0));
afxDump << str2;
Looks like just a str would be enough instead of str.GetBuffer? The (0) is also puzzling me.
Thanks
Appreciate your help,
ns
|
|
|
|
|
%s wants a const char * (a LPCSTR , in Windows lingo), so the following should suffice:
str2.Format(_T("item %d: %s\r\n"), i, (LPCTSTR)str);
GetBuffer is IMHO overkill for two reasons:- It returns a
char * when just a const char * is needed. - It requires a later call to
ReleaseBuffer , which is prone to error (for lack of care by the programmer, or in the presence of exceptions).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I totally agree with Joaquin. I see GetBuffer abused all over the place, even by Microsoft people.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
|
Actually, you can just use str in this case, since CString includes a builtin LPCTSTR conversion operator. The only time you need GetBuffer is if you are intending to modify the string directly through a character pointer. Also, any time you use GetBuffer , you should call ReleaseBuffer .
Software Zen: delete this;
|
|
|
|
|
I have a bitmap that looks like a form. How can I print
that through visual c++ so that the output looks clear?
I can make it print the bitmap and it looks pretty good,
but the text is just alittle fuzzy. Any ideas on how to
print a crisp, clear bitmap?
Please, any response any one can give me will be greatly
appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
how are you printing it now?
Be very, very careful what you put into that head, because you will never, ever get it out. --Thomas Cardinal Wolsey
|
|
|
|
|
Hi,
I have a worker thread that calls the socket api's ::accept() function, which blocks until a client machine tries to connect to my application. How do you cancel the block? Say you want to shut down the application... Is there any timeout associated with ::accept()? I couldn't find any...
Thanks in advance!
swine
Check out Aephid Photokeeper, the powerful digital
photo album solution at www.aephid.com.
|
|
|
|
|
no timeout on accept just close the socket that unblocks the accept call and returns an error well error notification then u call WSAGetLastError() to get the acutal error number
"No matter where you go, there your are..." - Buckaoo Banzi
-pete
|
|
|
|
|
Thanks!
Check out Aephid Photokeeper, the powerful digital
photo album solution at www.aephid.com.
|
|
|
|
|
Greetings,
I am trying to do something that ought to be simple but it is eluding me.
I want to resize a CListCtrl (in Report mode) from within OnInitialUpdate() such that exactly N rows are displayed (where N is already known to be small enough to fit on the screen without needing scroll bars).
I can use GetCountPerPage() but that doesn't count partial lines and one of the things I want to eliminate is partially viewed lines.
I must be missing something elementary so a code fragment would be very nice!
Thanks.
|
|
|
|
|
I haven't tried it, but you can take a look at CListCtrl::ApproximateViewRect. In the event that this doesn't work, I think it should be possible just to use GetItemRect with LVSIL_BOUNDS, then take the height of the rectangle and multiply it by the number of items you have, and that will be the needed height.
Chris Richardson
C/C++ Include Finder[^]
|
|
|
|
|
Chris Richardson wrote:
haven't tried it, but you can take a look at CListCtrl::ApproximateViewRect. In the event that this doesn't work, I think it should be possible just to use GetItemRect with LVSIL_BOUNDS, then take the height of the rectangle and multiply it by the number of items you have, and that will be the needed height.
Actually I tried this but I must have something still basically wrong:
<... do initialization ...>
CSize sz = m_list.ApproximateViewRect();
m_list.PostMessage(WM_SIZE, sz.cx, sz.cy);
This seems to have no effect.
I think I'm having a senior moment here...
|
|
|
|
|
That's not the correct way to size a window. Use this instead:
m_list.SetWindowPos( NULL, 0, 0, sz.cx, sz.cy, SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOMOVE );
Chris Richardson
C/C++ Include Finder[^]
|
|
|
|
|
That's it!
I know about and use SetWindowPos() but I just couldn't think of it.
Thanks!
And here is my working implementation (if anybody wanted to see actual code):
CSize sz = m_list.ApproximateViewRect();
CRect itRect;
m_list.GetItemRect(0, &itRect, LVIR_BOUNDS);
int vOffset = itRect.Height() - 3;
m_list.SetWindowPos(NULL, 0, 0, sz.cx, sz.cy - vOffset,
SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOMOVE);
|
|
|
|
|
Hi
I was wondering how to find out which nodes of the treeview (a treeview with checkboxes) have their checkboxes checked.
Thanks
Nitin
|
|
|
|
|
GetItemState() ?
"No matter where you go, there your are..." - Buckaoo Banzi
-pete
|
|
|
|
|
I want to find all files that DO NOT contain my string pattern. I am looking for files that don't contain the literal "copyright". I want to search recursively a folder (or better yet, do this in my Visual SourceSafe database).
I have VC++ and Visual Studio at my disposal, but I was unsuccessful at using the Regular Expressions setting on the search tool.
Thank you.
Johnny
|
|
|
|
|
If you already are getting the filenames themselves, then the hard part is done. I've not used the built in regular expressions, but I know there are public domain regular expression classes/libraries out there.
However, there is an even easier way. If you already have them available to you, can you just use strstr() and see if it passes or fails. If you are using CStrings, then I'm sure there is an equivalent method, like substring() or something of the sort.
There are only 10 types of people in this world....those that understand binary, and those that do not.
|
|
|
|