|
I found that the CPU is much lesser(30%) than total CPU available. The single get is much faster than recursive version and also it's faster than SS UI.
It's better than SS UI.
The VSS database is located in remote machine. Is it because of reading from remote machine makes the application to freeze? One thread is to monitor the content of one folder. The control is never reaching this thread, once the 'get' function is called. I tried using timers also, timer event is also not happening. Thanks a lot for your help.
Thanks,
Stanly
|
|
|
|
|
stanlymt wrote: One thread is to monitor the content of one folder. The control is never reaching this thread, once the 'get' function is called. I tried using timers also, timer event is also not happening.
How do you know that the thread is not running? Does it have it's own windows and message loop, or are you outputting to a debug window (TRACE/ATLTRACE/OutputDebugWindow)?
The single get will be faster, but then you have to do your own monitoring of progress, which means looking for file change notifications etc. I suggested the recursive version because you said you wanted to have progress notifications, and this would be one way. I'm guessing that the SS UI does it this way, since there aren't events that get fired (at least, not that we get told about!).
It might be the STA that's contributing to the lockups. You could try using CoInitializeEx to get an MTA instead (in both the main thread and the get thread), and see if that helps at all.
When you say timers, do you mean SetTimer(), which will only cause WM_TIMER to be pulled out of the queue, which, as you're not pumping msgs, won't be happening....
Steve S
Developer for hire
|
|
|
|
|
I know the control is coming to that thread because I've put some debug logs which was not printing. I think I'll go for recursive version.
Thanks a lot for your help.
|
|
|
|
|
BOOL WriteFile(
HANDLE hFile,
LPCVOID lpBuffer,
DWORD nNumberOfBytesToWrite,
LPDWORD lpNumberOfBytesWritten,
LPOVERLAPPED lpOverlapped
);
BOOL ReadFile(
HANDLE hFile,
LPVOID lpBuffer,
DWORD nNumberOfBytesToRead,
LPDWORD lpNumberOfBytesRead,
LPOVERLAPPED lpOverlapped
);
|
|
|
|
|
It's understandable from Parameter names
check MSDN
CHeck MSDN[^]
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
My Blog | Understanding State Patte
|
|
|
|
|
WriteFile is for write to file and ReadFile is for read from file see
<br />
CString WriteToFile;<br />
HANDLE hFile;<br />
DWORD dwRead;<br />
WriteToFile="This is a test";<br />
<br />
hFile=CreateFile((LPCTSTR)"c:\\test.txt",GENERIC_WRITE,FILE_SHARE_WRITE,NULL,CREATE_NEW,FILE_ATTRIBUTE_NORMAL,NULL);<br />
<br />
DWORD m_dwSize=WriteToFile.GetLength();<br />
BOOL bResult=WriteFile(hFile,(LPCTSTR)WriteToFile,m_dwSize,&dwRead,NULL);<br />
CloseHandle(hFile);<br />
<br />
CString strRead="";<br />
DWORD dwReads=0;<br />
hFile=CreateFile((LPCTSTR)"c:\\test.txt",GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);<br />
<br />
DWORD dwBufferSize=GetFileSize(hFile,NULL);<br />
<br />
bResult=ReadFile(hFile,strRead.GetBuffer(dwBufferSize),dwBufferSize,&dwReads,NULL);<br />
<br />
MessageBox(strRead);<br />
CloseHandle(hFile);<br />
<br />
And see MSDN
whitesky
|
|
|
|
|
Hi,
Does any one know how to get a security descriptor from SID . I got the SID of a user using LookupAccontName API. I dont now how to get the security descriptor corresponding to the SID.
Thanks in advance
|
|
|
|
|
See Here[^] and this[^]site maybe it is some helpful to you
whitesky
|
|
|
|
|
What is the difference between Win32 applcation and Win32 Console application?
Because I did one simple addition function in Win32 application,it gave me a link error and it mention some error in WinMain()
-- modified at 0:53 Thursday 20th July, 2006
|
|
|
|
|
A console app runs in a console window, and the entry point is main() . A GUI app doesn't automatically get a console window, and the entry point is WinMain() .
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Win32 console is a text terminal window within the system of Windows API. A Win32 console has a screen buffer and an input buffer.
A Win32 application is a 32-bit application that meets Microsoft's Win32 API standard. This standard ensures that applications can take advantage of Windows features such as graphics, window management, memory management, file I/O, security, networking, and threading. Win32 applications run on one processor or multiple processors and on multiple hardware architectures.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
From your comment I got the impression that you tried to say that Win32 applications are more flexible than Win32 console applications, but that is not true.
Win32 console applications can be as flexible as Win32 applications. In fact, a Win32 console application is a Win32 application which allocates a console for printf to work right away. Also, the entry point is main() because it is assumed that you will be making normal C/C++ applications when the project type is Win32 console.
In every other respect, they are capable of the same functionalities and can have the same features. They both can include "windows.h" and use all Win32 API functions. This means you can use "CreateFile" instead of "fopen" in a Win32 console application, just like in a Win32 application.
Rilhas
|
|
|
|
|
Hello all,
I have created propertysheet in wizard mode and i want to change the caption of third Wizardpage(derived from CPropertyPage) after it popups. In dialog editor i set caption of that propertypage(Say "x"). I want to change it to(say"Y") for reusability.
Can anybody help me?
Regards;
Aj
|
|
|
|
|
|
i use vc++2005, mfc, xp professional sp2.when i debug in functions of a files,the cursor doesn't exactly piont to the excuted line, but it piont to the third line before the excuted line. however,in the other files, everything is normal. i cleaned the solution and rebuilded it, but it don't work yet. what shold i do to make it normal?
|
|
|
|
|
// .h file
class CAPI : public CWnd
{
public:
CString Login(LPCTSTR UserName, LPCTSTR Password, LPCTSTR UserId);
}
// .cpp file function
CString CAPI::Login(LPCTSTR UserName, LPCTSTR Password, LPCTSTR UserId)
{
//username = wwtest2;
//Password = RD9234;
//Userid = wwtest2;
CString result;
static BYTE parms[] =VTS_BSTR VTS_BSTR VTS_BSTR;
InvokeHelper(0x2, DISPATCH_METHOD, VT_BSTR, (void*)&result, parms,UserName, Password, UserId);
return result;
}
"God helps to whom who helps other"
|
|
|
|
|
priyanka s wrote:
// .h file
class CAPI : public CWnd
Buddy, there no way we can help you as this class is not By MS!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
You created a function for login ok then...
whitesky
|
|
|
|
|
i have cereated the function for login...but i dont know how to write code for that???
I am using Active X controls in my project.And the Api has all the function for that which i have in my project as awrapper class.This Active X control is going to b bridge b/w client and server....
I am stuck in the point of coding..
I am new to programmimg.....Thanks
|
|
|
|
|
|
LOGIN TO ODL SERVER TO GET SESSION ID AND DATA FROM THAT
|
|
|
|
|
Given the path of the file, how to open it with code? just like you double click it.
Thank you very much!!!
|
|
|
|
|
Use ShellExecute with the "open" verb.
e.g.
ShellExecute(
NULL,
_T("open"),
_T("C:\\a.txt"),
NULL,
NULL,
SW_SHOWDEFAULT
);
You will need to #include <shellapi.h> and link to "shell32.lib".
Steve
|
|
|
|
|
thank you very much for your help.
|
|
|
|
|
|