|
3rd party software like.....
|
|
|
|
|
Go search on download.com or some other site.. win9x uses fat16 or fat32 which has no security at all.. ntfs is the nt file system which lets you set read/write/edit/delete permissions for files or folders.. if you are on fat16 or fat32 then you have to get a piece of software which fakes this out.. but even this can easily be bypassed by just booting to dos and doing whatever you want with the files..
-dz
|
|
|
|
|
I'm a total virgin when it comes to shell extensions, but I think this is where they would come into play. Check under the Shell section. Mike Dunn has wrote some cool articles on Shell extensions which should get you well under way.
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
I do not know, whether this can be helpfull, but according to msdn:
Multiple Data Streams
NTFS supports multiple data streams, in which the stream name identifies a new data attribute on the file. Each data stream is an alternate set of file attributes. Streams have separate opportunistic locks, file locks, allocation sizes, and file sizes, but files can be shared.
Maybe it is possible to define such stream as password-stream associated with given file system object
Mukkie
|
|
|
|
|
I am trying to implement a simple multithreading in my code. I have a dialog box where the user can search for stuff and get the result back in list control. However, if the search result takes too long, I would like to allow my user to stop the search by clicking on Cancel.
I have added a structure to my header which contains a handle to calling window and a few parameters that I need to pass between the worker thread and the display.
On the cpp side of things, I start my threading function when the user presses the search button:
HANDLE hHandle = ::AfxBeginThread(ThreadFunc, m_ptp);
Where m_ptp is defined as a pointer to my threading structure and Threadfun is my threading function.
Inside of my ThreadFunc, I make a query to the database and this query can take significant amount of time at times. I have tried with many different ways of putting an hour glass around this call, but it never shows up. FOr instance, I have tried the following and it doesn't work:
UINT ThreadFunc(LPVOID pParam)
{
THREADPARMS *ptp = (THREADPARMS*) pParam;
ptp->pWnd->BeginWaitCursor();
// Database call
ptp->pWnd->EndWaitCursor();
::PostMessage(hWnd, WM_USER_THREAD_FINISHED, 0, 0);
}
I have also tried starting the cursor in the calling function and it hasn't worked out for me. Any ideas?
|
|
|
|
|
Pointers to windows can't be used between multiple threads. Try passing just the window handle.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Is your window in the ptp structure part of your ThreadFunc, or the primary thread. Because it is generally not a good idea to call functions for a window, unless it is the same thread that owns the window. In most cases it will just not work.
Also, even if the function is setting the cursor to the wait cursor, the most likely reason that it is not showing is because the WM_SETCURSOR message handler is setting the cursor back the arrow.
What you can do is set a variable in your window object, then handle the WM_SETCURSOR message in your window. This message should call SetCursor() with the wait cursor while that certain bit is set, and pass the message to defwindowproc when that value is not set.
|
|
|
|
|
This is the exact solution that I need. Thank you, kilowatt!
|
|
|
|
|
Use something like:
::PostMessage(hWnd,WM_USER_THREAD_STARTED,0,0);
OnThreadStarted(...
{
BeginWaitCursor();
}
OnThreadfinished(...
{
EndWaitCursor();
...
}
|
|
|
|
|
I have written a TFTP server using CSocket, and CAsyncSocket. I have also re-written it using the SDK socket functions (no MFC). No matter what I do, a 6MB file is taking about 77 seconds (at 512 byte block sizes).
Unfortunately, I cannot make use of the Block Size option to gain speed. The client will not be able to handle it. Re-writing the client is not an option.
We tried a Linux TFTP server, and it transferred the file in about 12 seconds!
Any ideas on why there is such a big difference, or how I can speed things up?
I also tried playing with the thread priorities, and got no increase in performance.
I have tried other servers off the web, and they all perform the same.
Is it possible to get a TFTP server to transfer a file with speeds similar to Linux?
Thank you,
David
|
|
|
|
|
Those huge differences in performance are by no means justified. My hunch is you're doing something wrong. Maybe if you could post the code where you do the transfer we could see a little further.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Here is where the code will spend most of it's time. This loop is sending the next block (512 byte size) of the file requested.
It calls SendBlock() listed below this loop.
The UpdateStatus, and all if it's formatting routines were disabled, just to see if that was the cause.
Sorry about the formatting, I can't seem to find the help on how to insert source code without losing the formatting from Visual Studio.
while (!m_bDone){
m_bCancelRetry = TRUE;
m_nRetryCount = 0;
//Sending a file
if (pbyData[0] == 0x00 && pbyData[1] == 0x04){
//ACK
if (pbyData[2] == HIBYTE(m_nBlockID) &&
pbyData[3] == LOBYTE(m_nBlockID)){
//ACK'd the last block we sent:
if (m_nBlockID == m_nLastBlockID){
m_nBlockID = -1;
AddReportString("Transfer complete.");
DWORD dwTime = GetTickCount();
CString szTime;
szTime.Format("Time to complete = %.2f seconds",(float) (((float)dwTime - (float)m_dwStartTime) / 1000));
AddReportString(szTime);
Abort();
}
else{
m_nBlockID++;
SendBlock();
}
}
else{
//Send the last block
//(no m_nBlockID++) increment here
SendBlock();
}
}
nResult = recvfrom(m_hSock,(char*)m_recvBuf,9126,0,&sockAddr,&nSockAddrLen);
if (nResult == SOCKET_ERROR){
DWORD dwErr = GetLastError();
CString szErr;
szErr.Format("RecvFrom() error = %08lX",dwErr);
AddReportString(szErr);
bErr = TRUE;
m_bDone = TRUE;
}
}
int CClientSock::SendBlock()
{
int nRet = 0;
m_bySend[0] = 0x00;
m_bySend[1] = 0x03; //Data
m_bySend[2] = HIBYTE(m_nBlockID);
m_bySend[3] = LOBYTE(m_nBlockID);
DWORD dwPos = (m_nBlockSize * (m_nBlockID - 1));
BYTE *pSrc = (m_FileData.GetData() + dwPos);
int nNum = m_nBlockSize;
if ((dwPos + nNum) > m_dwFileDataLength){
nNum = m_dwFileDataLength - dwPos;
}
memcpy(&(m_bySend[4]),pSrc,nNum);
sockaddr_in sockTo;
sockTo.sin_family = AF_INET;
int nToLen = sizeof(sockTo);
sockTo.sin_addr.s_addr = inet_addr((LPSTR)(LPCTSTR)m_szClientIP);
sockTo.sin_port = htons(m_nClientPort);
nRet = sendto(m_hSock,(char*)m_bySend,nNum + 4,0,(struct sockaddr*)&sockTo,nToLen);
if (nRet == SOCKET_ERROR){
DWORD dwErr = GetLastError();
CString szMsg;
szMsg.Format("Error %08lX found while sending file to client.",
dwErr);
AddReportString(szMsg);
}
else{
float pct = (float)(((float)dwPos / (float)m_dwFileDataLength) * 100.0);
CString szStat;
szStat.Format("%s: %lu bytes sent (%.0f%%)",m_szSendFile,dwPos,pct);
m_pServer->UpdateStatus(m_nSocketID,szStat);
}
return nRet;
}
|
|
|
|
|
I think I see the problem now. Thanks for taking a look at it.
|
|
|
|
|
I see lots of articles about downloading, but I need help on uploading files to an ftp server, can someone help me please.
Thanks.
==================================================
When Your Mind Wonders...Where Does It Go???
|
|
|
|
|
if you go to the search in the corner and search the message boards for "ftp" the third topic down is "Can´t implement CInternetSession" look there for some help.
-dz
|
|
|
|
|
http://codeguru.com/internet/ftpget.html
|
|
|
|
|
I found an article on codeguru that solved my problem. Thanks.
==================================================
When Your Mind Wonders...Where Does It Go???
|
|
|
|
|
is there a way to deselect an item from a list.
i have tried
m_drvlist.SetItemState(iItem, LVIS_DROPHILITED,LVIS_DROPHILITED);
but it does not seem to do anything.
thank you.
|
|
|
|
|
found my problem
m_drvlist.SetItemState(iItem,0,LVIS_SELECTED);
|
|
|
|
|
Anyone seen an OO command line parser for regular C++/ATL/WTL?
Figured I'd ask before I write my own.
Todd Smith
CPUA 0x007 ... shaken not stirred
|
|
|
|
|
Check out the one from Sells Brothers.
Tools
Look for command line parser.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
look in the C++/MFC section under "parsers", there's like 5 of them in there. (including my own STL-based parser)
-c
All programmers are playwrights, and all computers are poor actors.
Smaller Animals Software, Inc.
|
|
|
|
|
CCmdLine works great. I tried the Sells Brothers parser first but found it to be a little bit over-engineered for my purposes.
thanks all
Todd Smith
CPUA 0x007 ... shaken not stirred
|
|
|
|
|
Hello programmers, i want to make my application start everytime my computer is turned on. Does anybody have the knowledge of doing this ??????? THANK YOU ALL IN ADVANCE !!!!!!!!! HAPPY PROGRAMMING
the smelly man ? lol
|
|
|
|
|
this has nothing to do with programming..
if you look at the help system for windows it tells you how to make things run at startup.. just put a shortcut in start/programs/startup.. and if you are talking about something you have coded that you want to run at startup then you would have your installer do this for you.
btw.. nice topic
-dz
|
|
|
|