|
|
Hi,
I need to copy a file of 24MB to a location on a network.
I use CopyFile method. But its extremely slow when the destination path is in a network.
If I copy a file on to the local drive its much more faster. Problem does not occur if the file size is less around 5kb.
Can anyone tell me the reason and an work around?
Thanks
|
|
|
|
|
As i recall CopyFile API is used by explorer applications such as windows explorer, total commander, explorerx2 etc....
try to copy the file manually, and see if it is slow...if it is, than nothing you can do , because the file transfer depends on the network connection.....
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Thanks Yaron,
Indeed the network is slow and not CopyFile.
It took the same time to copy the file manually.
Cheers!
-rt
|
|
|
|
|
in the resource tab of VC 6, only adding BITMAP option is available. is it possible to add other image files as resource eg gif, tiff etc
|
|
|
|
|
Aparently you can add any type of file to the resources, but if you add not a basic file type (such as bitmap, icon etc.) it will appear as binary when you try to look at it...
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Thanks for reply
YaronNir wrote: it will appear as binary when you try to look at it...
Thats right, I want to avoid that, all i want is that other images can be added and displayed as bitmaps are added and displayed.
|
|
|
|
|
As far as i know in VC IDE you can't....
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
want to monitor the changes in the registry,By selecting on of the Root key then monitor the changes in that inlcude key,subkeys.....for name,value and status.
i Add the code in the thread function for monitoring as belowvoid MonitorThread(void* pParam)
{
//here am not understanding what event it returns
// RegNotifyChangeKeyValue(hKey1,TRUE,REG_NOTIFY_CHANGE_NAME|
// REG_NOTIFY_CHANGE_ATTRIBUTES|REG_NOTIFY_CHANGE_LAST_SET,hEvent1,TRUE);
DWORD dwFilter = REG_NOTIFY_CHANGE_LAST_SET, dwType, dwSize ;
char lpszUser[81];
HANDLE hEvent;
HKEY hKey;
LONG lErrorCode;
while(1) {
m_Sec.Lock();
//memset(lpszUser,0,81);
dwSize = 81;
dwType = REG_SZ;
// Open a key. Change second parameter to fit your needs.
lErrorCode = RegOpenKeyEx(hKey, NULL, 0,
KEY_NOTIFY | KEY_READ, &hKey);
// Create an event.
hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
// Watch the registry key for a change of value.
lErrorCode = RegNotifyChangeKeyValue(hKey, TRUE, dwFilter, hEvent,TRUE);
// Wait for an event to occur.
WaitForSingleObject(hEvent, INFINITE);
lErrorCode = RegQueryValueEx(hKey,NULL,0,&dwType,(unsigned char*)lpszUser,&dwSize);
//Add code for reading from the registry key
int item=pList->InsertItem(pList->GetItemCount(),lpszUser);
// Close the key.
lErrorCode = RegCloseKey(hKey);
m_Sec.Lock();
// Close the handle.
CloseHandle(hEvent);
// if(m_cStop1==TRUE)
// exit(0);
//Sleep(1);
}
}
For reading root key i put one combo box in the dialog and selecting one root key by pressing start button starts the monitoring ,if any changes occurs in the that rootkey registry display that key name,value ans status(create/modify/delete).
by pressing stop button stops the monitoring
Thanks,
Kiran.V
|
|
|
|
|
If this code is in a secondary thread, then the following statement is a recipe for failure:
int item=pList->InsertItem(pList->GetItemCount(),lpszUser); Instead you should be posting a message to the main thread (the one that owns the GUI). See here for why.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
How to load more than one image in a particular cell ( for a single item) in a listctrl report view .
Can I arrange the text and images in any order in that cell(eg: image1 text image2 image3)
Remember for a single cell(Item)
Thanking you
SANDEEP A.C
Sanc
|
|
|
|
|
Only way is to draw it yourself....and you mentioned the way you want it to appear....
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
hi
I want to check for Invalid Mail Address in MFC. I have used SMTP to connect & send a mail but if i give inavlid mail id it doesn't display error message.
Can anyone provide me links or code???
Thanx in advance
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
|
|
|
|
|
Chcek out this link:
http://www.oreillynet.com/pub/a/network/excerpt/spcookbook_chap03/index3.html
Cheers
"Peace of mind through Technology"
|
|
|
|
|
check this out:
http://www.oreillynet.com/pub/a/network/excerpt/spcookbook_chap03/index3.html
Cheers
"Peace of mind through Technology"
|
|
|
|
|
How to make the edit display the value by hex string?
such as
....
m_spin.SetBase(16);
m_spin.SetRange(0,0xFF);
m_spin.SetPos(0x2F);
...
the edit display "0x002F",what I want is just the string "2F" only.
ps:I tried to format m_edit in the function OnUpdateEdit(), but failed.
|
|
|
|
|
What is this m_spin ? A Progress bar ?
It has nothing to do with the edit control !
What you put in the edit control, it's up to you to format it correctly.
|
|
|
|
|
It may be an object of CSpinButtonCtrl..
nave
|
|
|
|
|
yes
CSpinButtonCtrl m_spin;
CEdit m_edit;
..
m_spin.SetBuddy(&m_edit)
...
|
|
|
|
|
yes
CSpinButtonCtrl m_spin;
CEdit m_edit;
..
m_spin.SetBuddy(&m_edit)
...
|
|
|
|
|
zeus_master wrote: How to make the edit display the value by hex string?
If "2F" is already in s string-type variable, just use CEdit::SetWindowText() :
m_edit.SetWindowText("2F"); If not, please explain more clearly what you are after.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
In fact, I want to build a simple tool to debug some registers. the registers value range is from "0x00" to "0xFF". only display the string from the hex value
please see sketch map below:
____
|DE | // edit value display is 00,01,02.......,0A,0B,....0F,...1E...FF
<||> // spin left<- ->right
|
|
|
|
|
Now I understand. Unfortunately, the only solution I can think of is to make the edit control right-justified and just wide enough to hold FF.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
what you mean is this function m_edit.SetWindowsText("FF")?
would you tell me the way of you setting?
thank you
|
|
|
|
|
I assumed you simply wanted to know how to set the text of an edit control.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|