|
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.
|
|
|
|
|
Guess i got a problem here...
i am sending u the code.. please help me in this.
say i have 10 items in the listbox. not if i i click the 4 to the 8th item in the listbox, the first 5 items are displaying the listbox.
<br />
CArray<int,int> aryListBoxSel;<br />
int nCount = m_listbox.GetSelCount();<br />
aryListBoxSel.SetSize(nCount);<br />
m_listbox.GetSelItems(nCount, aryListBoxSel.GetData());<br />
<br />
for(int i=0;i<m_listbox.getselitems(ncount,arylistboxsel.getdata());i++)><br />
{<br />
CString str,str2;<br />
int n;<br />
n=m_listbox.GetTextLen(i);<br />
m_listbox.GetText(i,str.GetBuffer(n));<br />
m_list.AddString(str);<br />
}<br />
<br />
what is the reason for that?<br />
<br />
<br />
</m_listbox.getselitems(ncount,arylistboxsel.getdata());i++)></int,int>
|
|
|
|
|
You got the selected indeces in aryListBoxSel; and you are using your own index, i for getting the selected text where i varies from 0 that i swhy you got the first 5 items. you have to use some thing like m_listbox.GetTextLen(aryListBoxSel[i]), m_listbox.GetText(aryListBoxSel[i],str.GetBuffer(n));
|
|
|
|
|
thanks a lot. a simple mistake costed me a lot of time.. better late than never.. thanks anyways.
|
|
|
|
|
Doubts again,
I was telling u that i have to merge the selected files. i know that i can use CFile to do the reading and writing of files. but when we select the file how do we store each file name? when i tried to use the array its giving me an assertion error.
|
|
|
|
|
Except DlgDirList you can use of FindFirstFile/FindNextFile.
|
|
|
|
|
I followed the tutorial here [^]:
create the driver service and start it if created successfully. After creating or open the service successfully,it start the service failed. I use GetLastError and find the error code is 2.
I don't know why,and how to fix it?
Regards.
|
|
|
|
|
Before asking a question here you should really spend some time trying to debug the problem.
What happens if you attempt to debug it ?
Error code 2 = The system cannot find the file specified.
regard,
Jonathan
|
|
|
|
|
Of course I did. I know what error code 2 means.
But the real problem is that,the file(example.sys) does exist.
Regards
|
|
|
|
|
Look in the registry and check what the entries added by the SCM look like. The ImagePath entry is probably not correct.
Judy
|
|
|
|
|
Hello everyone,
When we use OLESTR to allocate a variable from string literal, like OLESTR("Hello World"), the memory space for the string literal is on stack, right?
I can not find official document for this from MSDN.
thanks in advance,
George
|
|
|
|
|
George_George wrote: When we use OLESTR to allocate a variable from string literal, like OLESTR("Hello World"), the memory space for the string literal is on stack, right?
Nope, String literals don't follow the lifetime rules of the variables allocated on the stack. AFAIK they are always allocated on read-only memory.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|