|
I get it to work anyway. I think the reason was in strFilePath which contain a '\' characters e.g. "C:\something\something_else\...\...".
What I did is I caled CFile::GetFileName() now it works!
But now I can't use this regarding directories, and I can't use listing directory for files.
You see, I'm trying to record CD using IMAPI and users should be able to select directories as well as files to record them to CD. Now it would be vainly for users to see on their CD only files and no directories as they heve selected!
Could I open a stream (put folder name) and add numerous files one by one until all files are added from directory??
THX for help
|
|
|
|
|
Were you using single backslashes in a string literal?
If you're working with files and folders then you can construct full pathnames for each file.
SHBrowseForFolder() could be used to let the user select a folder.
Once you have a path to a folder, append the filename to it for each file (which makes a full
pathname) and create the stream from that pathname.
Is that what you're trying to do?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I already use SHBrowseForFolder() for folder selection.
"Were you using single backslashes in a string literal?"Re: Backslashes are in folder/files path's. I was doing it wrong, I've used the whole path name for CreateStream calls and I think that was the reason for errors. Now I use only filenames GetFileName() and it's all OK. But there is still issue of preparing a folder storage for burning on CD.
Now I'm working on an function which will be recursive, it will go in the folder and crating streams for all files in all folder inside the root folder.
My main concern is how, and is it posible, to create that much storage and stereams to pass to those storages and at the end write such storage on CD. I know it can be done. As I understand that storage are like folders and streams like files, is that means I should use storages for folders and streams for files. On example if I had a folder 'F1' and in side folder 'F2' and two files. And in 'F2' one file.
F1-->F2-->file3<br />
->file1<br />
->file2
I should do something like this: create a storage for 'F1', go inside and search for files, find 'F2' which is a folder (recursion call) I create another storage for 'F2' and go inside, where is a file named 'file3'. Now I create stream for 'file3' and add it to storage for folder 'F2', go back add and create two streams for 'file1' and 'file2' and all that plus storage for 'F2' add to storage for 'F1'! If this is so, how can I add storage to storage?
Thanks
|
|
|
|
|
I'm not sure why you're using structured storage if you are putting the results on a disk.
All the streams go into one file so you can arrange the heirarchy of the storage object any
way you want
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
|
why on hell are you modifying a function of the C runtime ???
if your compilation fails, it's because of your code, not the sources provided with the compiler (even if the compiler reported the error in memcpy())
|
|
|
|
|
No No this is a question I have to answer, I am just checking to make sure the function code show doesnt cause cause any problems and it is efficient code.
|
|
|
|
|
You delete your question!?
|
|
|
|
|
Yeah they said that I didnt need to post it twice but the question basically was:
What is wrong or how can I improve this function:
void* memcpy( void* dest, void* src, size_t size )
{
byte* pTo = (byte*)dest;
byte* pFrom = (byte*)src;
assert( dest != NULL && src != NULL );
while( size-- > 0 )
*pTo++ = *pFrom++;
return (dest);
}
|
|
|
|
|
Hi Josh,
You're copying a byte at a time... it is not as efficient as it could be on architectures such as x86 which has SIMD instructions.
Jeff
|
|
|
|
|
There's absolutely no reason to post this twice.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hello,
after the CFormView::OnInitialUpdate() i perform a textbox1.SetDecimal();
In this function of the CEdit derived class i make a ModifyStyle(ES_LEFT|ES_CENTER,ES_RIGHT);
followed an Invalidate() ...
But the textbox is still with an alignment to left (set to left by the designer ).
Is there a special command to applic the Style-Modification ?
Big thanks
|
|
|
|
|
See Edit Control Styles[^], particularly the part that states "After the control
has been created, these styles cannot be modified, except as noted."
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Thank you for your reply.
So it isn't possible to set the alingement to right during the execution of the application.
I tried already to manipulate the CreateStruct before the OnCreate is startet, but this
also don't work.
|
|
|
|
|
Hi,
"before he OnCreate" does it mean PreCreateWindow().
if not please try CEditDerivedClass::PreCreateWindow()
|
|
|
|
|
Thanks for your answer
Is it possible that it don't stop into the CEditDerivedClass::PreCreateWindow()
with a DDX_CONTROL created Textbox ?
|
|
|
|
|
Hi,
So you are using the control already on the resource.
Would I like to know if are applying the style before
Create and I hope not change it thereafter, why don't you
set the edit control style in the resource to Align Right
|
|
|
|
|
To built views faster.
I put for example 50 textboxes on a view. 30 of them are right-align.
I need to change all styles.
During coding the view, i set all 30 textboxes to number-textboxes (labelPrice.SetDecimal() )
Now, the SetDecimal() sets different parameters to the textbox (only numbers, right-align, ... )
I must anyway write one line per textbox, so this line changes also the styles.
If i like to change something, i don't need to change all textboxes on Dialog-Ressource, but only
some line of codes ...
In future, some peoples who don't programm a lot, should design all views, so it should be so quickly and easy as possible
|
|
|
|
|
Hi,
The dialog child items are created at dialog creation.
DDX_Control will only subclass controls not creating the control.
subclassing will allow the messages to be routed to the
class we specified. but at that time the control will be created already, so you won't get oncreate or precreatewindow events for the control.
In my opinion, setting styles after DDX_Control doesnot "built views faster".
If you specify Styles in resource designer it would have assigned at creation.
But you are then interrupting the control while ModifyStyle which involves sendMessage like process.
I suggest you specify styles of controls in resource design and SetDecimal will do the initialisation of data excluding the style.
Best Regards
|
|
|
|
|
I mean by "built views faster", that the developer can design faster the views, not that the view
is faster created at runtime.
Ok, i'll set those styles at the designer.
Big thanks anyway
|
|
|
|
|
baerten wrote: So it isn't possible to set the alingement to right during the execution of the application.
Not exactly. It's just not possible to change those styles after the control has been created.
You need to specify ES_RIGHT when you create the control. If the control is on a dialog resource
(in other words, NOT being created manually at runtime) then set that style in the dialog
resource.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi Coders!
IDE: Microsoft Visual Studio version 6.0
Lang: C++
Question:
Would anyone know a standard timing function that provides accuracy at the microsecond(us) scale, or at the very least at the low millisecond(ms) scale?
Why:
I am running an application that is supposed to send out data along a line every 24 milliseconds. I have the data to send at every interval, I just need a timer to send it accurately at the specified times(every 24 ms).
Thanks everyone for your suggestions!!
L
|
|
|
|
|
If you need precision of the order of the milisecond, then you'll need to use another operating system than Windows which is not real-time. You will never be able to have such precision.
EDIT: except if you use WinCE, in which case it is a real-time operating system.
|
|
|
|
|
|