|
Hello,
Short question:
How to get physical drive number, where specify volume letter i.e. C: is assigned ?
any idea ?
Mila
|
|
|
|
|
int a;<br />
a = PathGetDriveNumber("c:\\");
You also need to include "shlwapi.h" and link with shlwapi.lib
this is this.
|
|
|
|
|
Not that fast
This function returns ... quote: "0 through 25 (corresponding to 'A' through 'Z') if the path has a drive letter, or -1 otherwise"
In fact, returned value corresponds an logical drive number and doesn't correspond with physical drive number.
Mila
|
|
|
|
|
I remembered it the moment I had hit the submit button.
You could still get all the drives in the system, and check if it is a logical or physical drive, maybe.
this is this.
|
|
|
|
|
I have an input stream which consists of a length marker and then data of the specified length, there can be any number of blocks and of any size. I am currently waiting until the complete data has been sent and then parsing but I now need to do it as the data comes in, any ideas how I might go about it, the method I have is:
BOOL DataRead(string szRequest)
The data is passes in via szRequest and returns TRUE when I reach the end of the data input, I need to parse the blocks and add to some sort of buffer if possible.
|
|
|
|
|
What I would do in this situation is:
Keep a static buffer (TCHAR m_Buffer[20000] etc) large enough for the incoming data. (Maximum size block should fit).
Read the incoming data, parse it for the required information. If the needed data is found, then use it, and discard the buffer; Else if needed data is not found, then save it to the static buffer , and add the incoming data to it at the end, and parse it again, and continue the cycle.
this is this.
|
|
|
|
|
Thanks for the reply, I have started to implement what you suggested but I cannot have a static buffer because the incoming data could be anything from 1k to 2GB, I have tried appending the data to the string with += but which seems to work well with the parse routine I have but I get memory errors at random points in the prog. I realise it is because I should not be appending to the string but what are my options to get round this?
|
|
|
|
|
Well, if all you need to do is parse the data, and extract the info, then create a buffer large enough, and append data to it when it comes, but make sure that it does not overlap the size of the buffer. If it comes to being full, then empty it, or save it to a file etc.
I dont think I have made it much clearer for you, but anyway.
this is this.
|
|
|
|
|
Hi,
I am creating a shell extension and having some problems in Dropping a file on the extension.
My extension actually communicates with an FTP server and whenever a file is dropped in it, I have to copy the file onto the FTP server. This process is working fine in a single threaded component. But I would like to show a progress dialog for the same and I am doing the file copy in a background thread and showing a modal dialog in the main thread.
The problem is IDataObject is created in the main thread and I am passing a reference of the same to the background thread. When I invoke the GetData(..) method of IDataObject, its returning failure. But when the same in inoked from the main thread, I am getting the results.
The extension runs in an Aprtment threading model.
Any help would be appreciated...
Thanks and Best Regards
Jugs
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
It sounds like you're not marshalling the interface across apartments.
|
|
|
|
|
Hi Jon,
You were right.
I was not marshalling the interface across apartment boundaries. I used CoMarshalInterThreadInterfaceInStream and CoGetInterfaceAndReleaseStream methods and was successfull.
Thanks for the support.
Best Regards
Jugs
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Hi! anyone who knows how to use CTreeCtrl's tvs_haslines in CListCtrl? actually, im using custom control - its a list control with first column like a tree control but actually just modifying the item using LVITEM attributes. It works ok but I cannot add the tvs_haslines property.
Please help.
|
|
|
|
|
What have you tried ? What goes wrong ?
~RaGE();
|
|
|
|
|
Hi fellow CPians,
In which dll or executable can I find the icons representing the two arrows IE uses in his toolbar to browse on the next or on the previous page ? it does not seem to be in shell32.dll, and i think it is the same image used twice, one is simply reversed.
Thanks
~RaGE();
|
|
|
|
|
have you tried looking directly into iexplore.exe or into explorer.exe ?
moreover, look at those arrows, the shadows of the upper left border are the same, so they cannot be the same one reversed...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20] | soon : [VisualCalc 3.0]
|
|
|
|
|
toxcct wrote: iexplore.exe or into explorer.ex
Yes, no luck
toxcct wrote: shadows of the upper left border are the same, so they cannot be the same one reversed
Hmmm, well done, Watson !
~RaGE();
|
|
|
|
|
I've imported a swf file as a binary resource in my resources. How can I load this file and use it in my code? In general, when I have a binary resource how can I read and use it?
... And nothing else matters!
|
|
|
|
|
|
|
I wanna set a control size by exact values in pixels while I'm in designer. Is there any way?
... And nothing else matters!
|
|
|
|
|
yes, you can, even if this is quite dangerous to.
you can always use the keyboard to size pxl by pxl your controls, otherwise do this :
1. close VisualStudio
2. open the .rc file of you project in a WYSIWYG editor (notepad is sufficient).
3. find the id of the control to edit (e.g. IDC_MY_BUTTON)
4. set its position/size in the following order :
- left border position
- up border position
- width
- height
cheers,
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20] | soon : [VisualCalc 3.0]
|
|
|
|
|
No, units in the RC file are in DLU ( dialog (un)logical unit ) and will be converted to pixel when displayed; will scale the dialog according to the DPI and font scaling ( big font vs. normal font ) ( unless I'm really mistaken )
toxcct wrote: in a WYSIWYG editor (notepad is sufficient).
me think notepad is not a WISIWYG editor ...
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Maximilien wrote: me think notepad is not a WISIWYG editor ...
please explain...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20] | soon : [VisualCalc 3.0]
|
|
|
|
|
MSWord is a wisiwyg editor, what you see on the screen is (normally) really what you get when you print it out.
This is not the case for notepad, since you do not know how what you write will come out when you print it (additional footers and headers, page nums and so). You can turn the printer settings in landscape mode while nothing will change on your screen when using notepad.
I think what you meant is a plain text editor, not a wysiwyg.
~RaGE();
|
|
|
|
|
word is not a wysiwyg 'cause all the formatting stuff modify the rendering of the file. create a word file, then open it into another editor (ok, you don't want notepad, so let's say edit or vi) and you'll see some horrible character... with word, What You See Is NOT What You Get !!!
now, i'dd like to know (as notepad is supposed not to be WYSIWYG) where are those hidden bytes which make it not a plain text editor...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20] | soon : [VisualCalc 3.0]
|
|
|
|