It did return a nonzero value otherwise it would give a download error.
stanlymt
Posts
-
Problem with CopyFileW -
Problem with CopyFileWDownload was successful and temporary file is perfect!!! But when it is copied it did return a nonzero value but the destination file was corrupted.
-
Problem with CopyFileWI'm using CopyFileW to copy a temporary downloaded file to proper location. But in a rare scenario, CopyFileW didnt return any error but first 198,324 bytes of 454,086 bytes of destination file was written empty, rest of data is copied properly. This was used on Windows XP. Please tell me where would have gone wrong.
-
Editbox identification problemID is the Editbox ID in the resource file. If you need to handle differently for each edit box in the dialog, you have to handle it seperately. Otherwise, you can use one button as 'default' button and handle the event there.
-
Editbox identification problemYou can override default PreTranslateMessage function of the dialog/window class. BOOL CBAMBuildToolDlg::PreTranslateMessage(MSG* pMsg) { if (pMsg->message == WM_KEYDOWN) { if(pMsg->wParam == VK_RETURN) { if (pMsg->hwnd == ::GetDlgItem(*this, IDC_EDITBOXID) //Replace with proper ID { //Handling of the return key for this edit box return TRUE; } } } return CDialog::PreTranslateMessage(pMsg); } I hope the above code snippet will help you. Regards, Stanly
-
path nameHi Radhika, You can use string manipulations to remove the prefix of drive letter. There are so many helpful functions in CString class.
-
VSS automation problemI 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.
-
VSS automation problemI 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
-
VSS automation problemThanks a lot for responding. I tried using thread to perform 'get'. In this case also, once the 'get' function is called application is not responding to any messages even the message loop of each thread. The 'get' completely blocks other messages. I tried using recursion mechanism to 'get' file. There is a major drawback for this method. The performance is affected to a large extent. It's take very long time to get a big folder because it has to recurse to each folders and subfolders. Thats why I thought of shifting to single call mechanism to 'get' whole folder. Can you please help me with this problem? Thanks, Stanly
-
hard diskDWORD GetSerialNumber(int nDrive) { DWORD dwHDSerialNum = 0; if (!GetVolumeInformation(GetRoot(nDrive), NULL, 0, &dwHDSerialNum,NULL,NULL, NULL, 0)) return (DWORD)-1; return dwHDSerialNum; }
-
VSS automation problemI'm using VSS interface in my program. I'm getting the latest version of the file by using Get function in IVSSItemPtr. IVSSItemPtr vssi; COleVariant varBuf(strProjectFolder); vssi = m_vssdb->GetVSSItem( varBuf.bstrVal,0); vssi->Get( NULL,VSSFLAG_USERRONO | VSSFLAG_RECURSYES | VSSFLAG_FORCEDIRYES | VSSFLAG_GETYES ); The above code works perfectly for me. It gets the latest version. But I'm suffering from biggest disadvantage. Once this function is called it disables my main application. No messages are handled by main window, when the Get function is called. Once that function execution is finished then only Window accepts messages. Till then all the messages are blocked. Even all the threads are suspended. For large folders when we use Get function, it's takes very long time and it's quite annoying that Window gets disabled and all background threads are suspended. Is there any way to overcome it? I wanted to monitor the status of the Get function. Is there any way to run background thread to monitor it? Can we enable the Window to accept messages. Thanks, Stanly
-
Killing the processThis solution won't work for me because I won't be able to keep track of all spawned windows/applications. Spawned application say MS SQL query analyzer is not created by me. So, that application may spawn other applications. I want to implement the function of Kill Process tree just like in Process Explorer by Mark Russinovich (www.sysinternals.com). Thanks, Stanly
-
Killing the processThe problem with me is that, I'm spawning many process. One process my spawn other process. So my spawned process is having many other spawns. But when I'm terminating the main spawned process, only that process is terminated, not the child processes. I want to implement Kill Process Tree function for my child processes. Thanks, Stanly
-
Killing the processHow will I kill all the spawned processes of my application? I dont want to kill my main application, but only the all other processes spawned by my main application? Is there any articles related to this? Thanks, Stanly
-
handling the RETURN keyThis is not the proper way of handling RETURN Key. If you have more than one edit box and if you want to handle RETURN in different ways for each edit box, then this method fails. Check the below code: BOOL CApplyValue::PreTranslateMessage(MSG* pMsg) { if (pMsg->message== WM_KEYDOWN && pMsg->wParam == VK_RETURN) { if (pMsg->hwnd == ::GetDlgItem(*this, IDC_EDIT1) //Replace with proper resource ID { //Do your processing for Edit box1 GetDlgItem(*this, IDC_EDIT2)->SetFocus(); //If you want to set focus to next edit box } else if(pMsg->hwnd == ::GetDlgItem(*this, IDC_EDIT2) { //Do your processing for Edit box2 } return TRUE; } return CDialog::PreTranslateMessage(pMsg); }
-
Checking for Software installed.Thanks a lot!!! Thanks, Stanly
-
Checking for Software installed.I mean not my software. I want to check whether certain softwares(Visual Studio, SQL Server like that) are installed in the system or not? Thanks, Stanly
-
Checking for Software installed.How will I know programmatically, software installed in the system? How to check whether the installed software is correct version? Is there any article related to this? Thanks, Stanly