|
Thanku..Thanku very much..its working...
bye...
Regards
vijay
|
|
|
|
|
Have a look at the
typedef struct _SHFILEOPSTRUCT {
HWND hwnd;
UINT wFunc;
LPCTSTR pFrom;
LPCTSTR pTo;
FILEOP_FLAGS fFlags;
BOOL fAnyOperationsAborted;
LPVOID hNameMappings;
LPCTSTR lpszProgressTitle;
} SHFILEOPSTRUCT, *LPSHFILEOPSTRUCT;
structure.
I.E:
wFunc
Value that indicates which operation to perform. This member can be one of the following values.
FO_COPY
Copy the files specified in the pFrom member to the location specified in the pTo member.
FO_DELETE
Delete the files specified in pFrom.
FO_MOVE
Move the files specified in pFrom to the location specified in pTo.
FO_RENAME
Rename the file specified in pFrom. You cannot use this flag to rename multiple files with a single function call. Use FO_MOVE instead.
Have a look Here[^]
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
prasad_som wrote: SHFILEOPSTRUCT sfo;sfo.hwnd = NULL;sfo.wFunc = FO_COPY;sfo.pFrom = _T("F:\\FromFolder\0");sfo.pTo = _T("c:\\TargetFolder\0");sfo.fFlags = NULL;SHFileOperation(&sfo);
Thanx prasad that helped me aswell, can the same be applied to files ??? To show file cpoy progress.
Many Thanx
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
Programm3r wrote: can the same be applied to files ???
Yes,
FOF_ALLOWUNDO Preserve Undo information, if possible. If pFrom does not contain fully qualified path and
filenames, this flag is ignored.
FOF_CONFIRMMOUSE Not currently implemented.
FOF_FILESONLY Perform the operation on files only if a wildcard file name (*.*) is specified.
FOF_MULTIDESTFILES The pTo member specifies multiple destination files
(one for each source file) rather than one directory where all source files are to be deposited.
FOF_NOCONFIRMATION Respond with Yes to All for any dialog box that is displayed.
FOF_NOCONFIRMMKDIR Does not confirm the creation of a new directory if the operation requires one to be created.
FOF_NOCOPYSECURITYATTRIBS Version 4.71. Microsoft® Windows NT® only. The security attributes of the file
will not be copied.
FOF_NOERRORUI No user interface will be displayed if an error occurs.
FOF_RENAMEONCOLLISION Give the file being operated on a new name in a move, copy, or rename operation
if a file with the target name already exists.
FOF_SILENT Does not display a progress dialog box.
FOF_SIMPLEPROGRESS Displays a progress dialog box but does not show the file names.
FOF_WANTMAPPINGHANDLE If FOF_RENAMEONCOLLISION is specified, the hNameMappings member will be filled in
if any files were renamed.
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
|
Hi all:
As we all know messages must involve with specific window's handle, but I come across a requirement that there's no window handle available, but still I want a sub thread to send a WM_QUIT(PostQuitMessage(...)) message to main thread, in order to stop the main thread's
while (GetMessage(&msg, NULL, 0, 0))<br />
{<br />
TranslateMessage(&msg);<br />
DispatchMessage(&msg);<br />
}<br />
Send a PostQuitMessage from sub thread doesn't seem to work.
|
|
|
|
|
cant you use PostThreadMessage()?
nave
|
|
|
|
|
Thanks, But how can I get the main thread's ID.
|
|
|
|
|
simple
AfxGetApp()->PostThreadMessage( WM_QUIT, 0, 0 );
nave
|
|
|
|
|
LiYS wrote: requirement that there's no window handle available, but still I want a sub thread to send a WM_QUIT(PostQuitMessage(...)) message to main thread,
To send message you should have a window handle, to send message to that specific window. or you can broadcast the message but in your case its WM_QUIT, so you can not boardcast it. Better you can pass the window handle to the thread at the time its creation and use the handle to send the message
Do your Duty and Don't expect the Result Rate this Post, if I helped You
|
|
|
|
|
This is all happened before CreateWindow
|
|
|
|
|
LiYS wrote: PostQuitMessage from sub thread doesn't seem to work
This would post WM_QUIT message to that threads(sub) message queue, if there is any.
So in this case you should follow suggestion by Naveen .
|
|
|
|
|
what about direct api call of PostQuitMessgae
|
|
|
|
|
Anyone out there have any good references on how to improve TCP/SSL performance on high latency connections.
We see bandwidth dropping radically as latency increases... would like to get rid of this issue.
I don't see much of anything in the socket options.
I also cannot switch away from TCP, am required to use SSL.
Oh, and I really cannot mess with the registry...
And am using OpenSSL for my SSL overhead.
Any thoughts to share?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|
|
Where/when is the latency, how are you measuring it, and where is it coming from?
Depending on when the latency occurs, it could definitely impact throughput.
Mark
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
It's not a measured thing unfortunately.
We have this client/server thingy. I am in California and the server is in California. I don't have much trouble with throughput.
But I have this user in Denmark who is trying to connect to the serer in California. He's got a soooper high speed connection to the internet... but can only get limited bandwidth between his client and our server.
I am very confident in his connection...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|
|
Try increasing the TCP window size, on both client and server, for both send and receive buffers.
See SO_SNDBUF and SO_RCVBUF, in the Winsock docs.
The buffers should be sized to approximately RTT (round trip time) times the bandwidth of the smallest pipe. So, you really need to get a good estimate of RTT (try ping), and it really doesn't matter if your Danish user has a huge pipe if you are shipping it up to him through a 1500/300 ADSL link.
If you don't have access to code, there are some registry tweaks available as described (e.g.,) at "Windows 2000 TCP Performance Tuning Tips" at http://rdweb.cns.vt.edu/public/notes/win2k-tcpip.htm[^]. There are lots of sites like that one (search on "SO_RCVBUF SO_SNDBUF RTT bandwidth"). The Win2k registry entries are the same in WinXP.
Mike
|
|
|
|
|
Hey Mike
Great reply. From a programmer with minimal IT skills - Thanks for the info!
Mark
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Hi all.
In my application I am trying to read some registry values which are stored during installation.
Registry reading/writing operation works fine on all other OS but it fails on Vista.
When I disable the UAC from Vista, it supports registry reading and writing.
Here is the way I am disabling UAC
Start->Control panel->User Accounts->Change Security Settings->Uncheck "Use User Account Control (UAC) to help protect your Computer”.
But disabling UAC is certainly not a good way to get the solution. Is there any other way by which I can read/write registry without disabling UAC?
Thanks
Sameer Thakur
|
|
|
|
|
You can write to HKEY_CURRENT_USER in the registry.
Alternatively you can create a manifest file and then allow your application to run under Admin privileges and this would allow you to write to the registry.
There are also some more ways in which you can do this that you can look for yourself.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I Hope this[^] will help you.
Regards,
Paresh.
|
|
|
|
|
Check the permissions requested when opening the primary keys for reading. You might be using KEY_ALL_ACCESS when you should only request the privileges you need.
Try using only KEY_QUERY_VALUE|KEY_READ instead and oyu will find it probably works as expected.
|
|
|
|
|
Hello All,
I am trying a read text file and extracting words from it and adding to a map.
I want to add only valid words and eliminate numbers and special character words and then add it to map.
Invalid words like 1word , hello# , t2o etc … so I want to eliminate all the number and special characters.
Can anyone please help me with this ….
strlwr(word);
wsize = strlen(word);
stemp = word;
for(int j =0; j<=wsize; j++)
{
if ( stemp[j] == '.' || stemp[j] == ';' || stemp[j] == '*' || stemp[j] == '#' && stemp[j] == '!' || stemp[j] == '@' || stemp[j] == '$' || stemp[j] == '%' && stemp[j] == '^' || stemp[j] == '&' || stemp[j] == '(' || stemp[j] == ')' && stemp[j] == '-' || stemp[j] == '+' || stemp[j] == '/' )
break;
else
FMap[stemp]=offset;
}
This conditions are very lengthy, is there any way I can reduce it by checking the ASCII value and add them to MAP.
Thanking you,
Suresh HC.
|
|
|
|
|
Why don't you simply check if the value is between 'a' and 'z' or between 'A' and 'Z' ?
|
|
|
|
|
Thanks Cedric Moonen for the response.
ASCII values A – 65 to Z – 90 & a – 97 to z – 122.
But hw to check them in the condition ???
|
|
|
|