|
Hi,
How can I pass switches in a exe?
|
|
|
|
|
What do you mean ? You mean command line arguments ? If yes, then simply open the command prompt and add them after the executable name. If that's not what you are looking for, then you should explain more in details.
|
|
|
|
|
Also, from within the Visual Studio IDE, you can go to the project properties in the "Debugging" section
and put your commandline arguments in the "Command Arguments" setting.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Can you more explain,plese?
|
|
|
|
|
I want to enumerate files on specific drive to get total count of files on that drive. Currently i am using only one thread for this but i want to use multiple thread for this so that job get divided into these thread.
Can anyone help me for my problem?
|
|
|
|
|
Member 3420509 wrote: Currently i am using only one thread for this but i want to use multiple thread for this so that job get divided into these thread.
Is there a particular reason to do that ? If your program is not running on a multicore, then this will probably slow down the procedure, as you will incur the cost of thread switching and you'll need to protect some part of it for multi-threaded access (which will also slow down).
|
|
|
|
|
Some people think multi-threading would make it run faster ...
Maxwell Chen
|
|
|
|
|
Yeah, but some people might be wrong
|
|
|
|
|
make this multithread is leading into headache, because you'll have to synchronize your threads, so that each thread don't count the same file twice...
synchronized them is certainly going to make your multithread solution slower than a single threaded one...
|
|
|
|
|
yes that is the question that how can i assign the equal task to each thread.
|
|
|
|
|
IMO, using multiple threads to access a physical drive will make things worse.
Imagine the battle between the threads to get the control of the drive, there is only one moveable head on a disk.
|
|
|
|
|
After enumerating the files i want to process on files, in windows there is thread based switching, so if i have multiple thread my work will be fast. what do you think about this.
|
|
|
|
|
Of course DlgDirList returns number of folder or files when you use of it on the listbox.
|
|
|
|
|
Need help there is nothing wrong with the code that might be some Dll problem what are the dlls can cause a crash when we call MessageBoxIndirect( ) in vc++.
Please suggest me to find the actual problem that crashing the host
Thanks & Regards,
Ramarao.
|
|
|
|
|
Did you try to use your debugger to locate the problem more precisely ? Did you check the callstack and inspect the different variables around the crash occurence ?
With so little information, there's not much we can do...
|
|
|
|
|
Hi Cedric Moonen,
InitThunk((TMFP) &CExtBox::HookProc, this);
m_hHook = SetWindowsHookEx(WH_CBT, (HOOKPROC) GetThunk(), NULL,GetCurrentThreadId());
ASSERT(m_hHook);
nRes = MessageBoxIndirect(&mp);
if(m_hHook)
UnhookWindowsHookEx(m_hHook);
This is the code part i am using and it was crashing when it calls MessageBoxIndirect().
This code was running from a long time now in fresh version of release this is giving problem. If i use MessageBox( ) then it is working but the function that i am calling is used in somany places so i cannot avoid it.
It is giving the following Application error
Event Type: Error
Event Source: Application Error
Event Category: (100)
Event ID: 1000
Date: 3/13/2008
Time: 7:14:39 AM
User: N/A
Computer: SILT06-FERG
Description:
Faulting application Acp.exe, version 5.2.1002.21, faulting module unknown, version 0.0.0.0, fault address 0x01f5f968.
Data:
0000: 41 70 70 6c 69 63 61 74 Applicat
0008: 69 6f 6e 20 46 61 69 6c ion Fail
0010: 75 72 65 20 20 41 63 70 ure Acp
0018: 2e 65 78 65 20 35 2e 32 .exe 5.2
0020: 2e 31 30 30 32 2e 32 31 .1002.21
0028: 20 69 6e 20 75 6e 6b 6e in unkn
0030: 6f 77 6e 20 30 2e 30 2e own 0.0.
0038: 30 2e 30 20 61 74 20 6f 0.0 at o
0040: 66 66 73 65 74 20 30 31 ffset 01
0048: 66 35 66 39 36 38 f5f968
I do not know how to check the callstack so please suggest me now what can i do?
Thanks & Regards,
Ramarao.
|
|
|
|
|
how can i display the files of a particular folder in a listbox? and how can i do multiple selections in a listbox?
|
|
|
|
|
Chandrasekharanp wrote: how can i display the files of a particular folder in a listbox?
Check Listing the Files in a Directory[^] and add the string to list box.
Chandrasekharanp wrote: how can i do multiple selections in a listbox?
Set the LBS_MULTIPLESEL Style for List Box
|
|
|
|
|
ok.. thanks.. i got that..
now another thing that i need to do is to merge the files. say in the listbox there are 5 files. no i need to merge this file and save the merged file in another file name. what needs to be done for this?
how can i save the file names in different variable?
|
|
|
|
|
These are very basics, you refer msdn if you are using MFC, CListBox, CFile, CString member functions can be made use.
Chandrasekharanp wrote: say in the listbox there are 5 files
refer CListBox:: ( GetSelCount, GetSelItems, GetText)
Chandrasekharanp wrote: no i need to merge this file and save the merged file in another file name. what needs to be done for this?
Refer reading and writing to file using CFile.
Chandrasekharanp wrote: how can i save the file names in different variable?
from my previous reply the FindFirstFile API fills the WIN32_FIND_DATA it has cFileName member and use CString.
I expect you are not askig for Code for copy paste.
|
|
|
|
|
no. i don't expect that from u.. at times it happens that u go bonkers...at such situations u send these queries...
anyways thanks yaar.
|
|
|
|
|
Chandrasekharanp wrote: at times it happens that u go bonkers
thats true.
yaar, Ok I try to be generous, And is n't the previous reply useful. or what part you feel you need help.
|
|
|
|
|
it really helped me.. when i saw it i felt bad that i asked something like this...
will certainly ask u if there is something needed..
|
|
|
|
|
if i have to send the selected items to another listbox what functionality should be used?
|
|
|
|
|
If you got how to get the selected items from List box and how to add list box items then mix these functionality.
|
|
|
|