|
I voted you 1 for use of SMS-text. (Your initial post was fine.)
Others may disagree, but I think "it wud b very kind of u if u . . ." belongs on some teen dork site.
|
|
|
|
|
NormanS wrote: I voted you 1
i don't understand this voting concept at all
|
|
|
|
|
vamshin wrote: don't understand this voting concept at all
At least he was kind enough to explain why the low vote.
Basically a lot of people are getting tired of the short hand abbreviations, it makes your post harder to read and understand. It’s important to remember that not everyone is a native English speaker and your short hand comments maybe misinterpreted.
There isn’t any need for it here.
ZeePain! wrote: This seems like one of those programs that started small, grew incrementally, building internal pressure, and finally barfed all over its source code sneakers. Or something.
thedailywtf.com[^]
|
|
|
|
|
Voting is a system where CodeProject members rate a post or an article, thereby showing whether they think it is a "good" or a "bad" post. Voting is useful for articles, but some people rate posts as well. Voting on articles is done for technical reasons (so if you see 2 similar articles, but one is rated 2.2 and the other gets 4.5, you would know the article with 4.5 is regarded as "better" by CodeProject members.)
I don't think the vote you get matters at all for posts (if you actually get any vote at all - most posts don't.)
I gave you a low vote because I am a difficult bast*rd who hates SMS abbreviation, and the laziness or coolness it implies (particularly when my favourite wife uses it.)
|
|
|
|
|
Hi,
I have been working on an MFC application. Now I want to make another application with broader scope with different components in it - one component being the application I have been developing.
I have seen some samples, where there is one .dsw file and many .dsp project files in it. So when I open the dsw I can have many projects in it and I can compile either those projects alone or compile the whole workspace. But no idea how to do this.
Can anyone point me to some write up about this or some technical name for such projects so that I can search and find out.
Please HELP!!
- KK
|
|
|
|
|
|
Create a blank workspace with no files added to it.
Use the Project>Add To Project>Files and drop the files that you were using earlier. That's all
|
|
|
|
|
Select the Add to Project option from the Project menu. Select New. Click the Projects tab. Add your new project here. Rather than adding more files to a single project and workspace, this will create separate projects within the same workspace.
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
I delete all the files/directories in a directory recursively in my application, and since that takes time I want to show a progress bar.
To implement the progress bar I first need to scan the directory to know how many files are there and then in the second pass I progress the bar appropriately every time I delete a file/directory.
Is there a way to quickly find out how many files, including those in the sub directories, are there in a directory? If there is a way other than explicitly walking down the directory using FindFirstFile/FindNextFile, I would like to know, since this is causing the time to delete almost 1.5 times the time spent.
thanks!
|
|
|
|
|
There is no need to make two passes. While counting, add the list of files and folders to an array of some sort and delete them from there.
You can always use SHFileOperation() . It uses recursion and a progress bar.
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
Hi
pls send your mail id to dingudikka@yahoo.com
I will send the sample source code to count the no:of files and folders in a drive
regards
Vallikumar A
|
|
|
|
|
hi guys,
we have a game server/written in c++/ and an application/written in erlang/ simulating thousand of users playing on the game server.
The server manages connections using IO Completion ports, but when launching many/thousands connections/ against the server it starts dropping connections - the erlang application reports that the socket is closed, while trying to write to the socket.
How can I get the reason for closing the socket on the server side - with GetLastError function i'm getting just the error code of the io operation attempt on the socket. But I need the error for socket closure, please help!
All ideas are welcomed,
Thanks
yani
|
|
|
|
|
socket closure causes
1. completion of a queued read operation with 0 bytes(gracefull close) and this is no error.
or/and 2. GetQueuedCompletionStatus returns false. now GetLastError returns the error of the queued operation.
U gotta mungle with the OS's settings to allow more sockets and give WSAAccept/accept a big queue.
|
|
|
|
|
Hi,
I am making an asynchronous ftp connection and then I want to list all files in the current directory. Here is my function
BOOL
StatupController::StartupSyncSoftware( StationType _stType ) {
ClsArchive *UnZipper;
char pszZipFile[64];
char pszDestPath[64];
char pszRemoteFile[64];
char pszFtpServerAddress[64];
HINTERNET hConnection =NULL,
hFtpConnection =NULL,
hDir =NULL;
BOOL bResult;
HINSTANCE hOcx;
FARPROC lpfn;
WIN32_FIND_DATA Data;
BOOL bRes;
DWORD error;
UnZipper = new ClsArchive();
switch( _stType ) {
case SatelliteStation:
strcpy( pszZipFile, "C:\\Flightvision.zip" );
strcpy( pszDestPath, "C:\\" );
strcpy( pszRemoteFile, "Flightvision.zip" );
strcpy( pszFtpServerAddress, "192.168.1.38" );
// open ftp connection
hConnection = InternetOpen( "FVStartup", INTERNET_OPEN_TYPE_DIRECT,
NULL, NULL, INTERNET_FLAG_ASYNC );
InternetSetStatusCallback(hConnection,FtpCallback);
if( hConnection == NULL ) return FALSE;
hFtpConnection = InternetConnect( hConnection, pszFtpServerAddress, INTERNET_DEFAULT_FTP_PORT,
"anonymous", "pass", INTERNET_SERVICE_FTP, 0, 0 );
if(hFtpConnection == NULL) return FALSE;
// find latest version
//DisplayDir(hFtpConnection,INTERNET_FLAG_NEED_FILE);
hDir = FtpFindFirstFile(hFtpConnection, TEXT ("*.*"),
&Data,
INTERNET_FLAG_NEED_FILE,
0);
if(hDir!=NULL) {
do {
bRes = InternetFindNextFile(hDir,&Data);
} while((error=GetLastError())!=ERROR_NO_MORE_FILES); // ERROR_IO_PENDING 997
}
// close connection
InternetCloseHandle(hDir);
InternetCloseHandle(hFtpConnection);
InternetCloseHandle(hConnection);
case BaseStation:
case WorkStation:
case NotAssigned:
default:
return false;
}
the problem is that the InternetFindNextFile(..) function always returns FALSE and the last error that I gen with GetLastError() is ERROR_IO_PENDING. I did not start any lengthy operation before that, this is way it doesn't make much sence to me. I also noticed that the FtpCallback function is never called and, of course, I think this is OK since no operation has been started yet. Can somebody give more insight on this and help me figure out why the directory listing isn't working correctly?
Thank you very much in advance.
A. Kafazov
|
|
|
|
|
akafazov wrote: the problem is that the InternetFindNextFile(..) function always returns FALSE and the last error that I gen with GetLastError() is ERROR_IO_PENDING.
Which indicates that the request has been made asynchronously, and your application will be called back with INTERNET_STATUS_REQUEST_COMPLETE when the function has completed.
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
However, the callback function is never called with INTERNET_STATUS_REQUEST_COMPLETE or any other flag. The situation also indicates that there is an outstanding operation in progress but there isn't. It's all very weird and I don't understand why.
A. Kafazov
|
|
|
|
|
I am using NetShareGetInfo and i am getting a NERR_NetNameNotFound.I am using the folder path as the share name e.g "C:\\WINNT\\profiles\\chikomok\\My Documents\\Open_Shares" and the sever is the remote P.C were the program is running
Can some please tell me what the problem could be.
Kelvin Chikomo
|
|
|
|
|
If the share name does not exist, then system will return NERR_NetNameNotFound error message. So please check your share name exactly with the shared device in the server.
And also server name should begins with \\. If this parameter is NULL, the local computer is used.
best of luck
regards
Vallikumar A
|
|
|
|
|
When i try to use \\. i get an error 53 which i do not know what it means.
Any help
Here is my code
<br />
#include "stdafx.h"<br />
#include "test2.h"<br />
<br />
#ifdef _DEBUG<br />
#define new DEBUG_NEW<br />
#undef THIS_FILE<br />
static char THIS_FILE[] = __FILE__;<br />
#endif<br />
<br />
<br />
CWinApp theApp;<br />
<br />
using namespace std;<br />
<br />
<br />
void wmain( int argc, TCHAR *lpszArgv[ ])<br />
{<br />
PSHARE_INFO_502 BufPtr;<br />
NET_API_STATUS res;<br />
LPTSTR lpszServer = NULL, lpszShare;<br />
switch(argc)<br />
{<br />
case 3:<br />
lpszServer = lpszArgv[2];<br />
case 2:<br />
lpszShare = lpszArgv[1];<br />
break;<br />
default:<br />
printf("Usage: NetShareGetInfo sharename <servername>\n");<br />
return;<br />
}<br />
cout<<lpszServer<<" "<<lpszShare<<endl;<br />
if((res = NetShareGetInfo ("\\.","guest" ,502,(LPBYTE *) &BufPtr)) == ERROR_SUCCESS)<br />
{<br />
printf("%S\t%S\t%u\n",BufPtr->shi502_netname, BufPtr->shi502_path, BufPtr->shi502_current_uses);<br />
if (IsValidSecurityDescriptor(BufPtr->shi502_security_descriptor))<br />
printf("It has a valid Security Descriptor.\n");<br />
else<br />
printf("It does not have a valid Security Descriptor.\n");<br />
NetApiBufferFree(BufPtr); <br />
}<br />
else <br />
{<br />
<br />
if(res == NERR_NetNameNotFound)<br />
cout<<"Netnamenotfound"<<endl;<br />
else if(res==ERROR_ACCESS_DENIED)<br />
cout<<"Access denied"<<endl;<br />
else if(res==ERROR_INVALID_LEVEL)<br />
cout<<"invalid level"<<endl;<br />
else if(res==ERROR_INVALID_PARAMETER)<br />
cout<<"invalid parameter"<<endl;<br />
else if(res==ERROR_MORE_DATA)<br />
cout<<"More data"<<endl;<br />
else if(res==ERROR_NOT_ENOUGH_MEMORY)<br />
cout<<"not enough memory"<<endl;<br />
else if(res==NERR_BufTooSmall)<br />
cout<<"buffer too small"<<endl;<br />
else<br />
cout<<"Error "<<res<<endl;<br />
}<br />
return;<br />
}
|
|
|
|
|
You didn't specify that to which machine have you connected to, so it is throwing that error.
Use NetResource structure and WNetAddConnection to open the connection so that you can have access to the shared folders on the remote machine . You can also try and check other return values.
Remember WNetAddConnection returns a DWORD value
eg ERROR_ACCESS_DENIED etc.
Does this solve your problem
Wishes
Anshuman
|
|
|
|
|
I thought all i had to do was to call the netsharegetinfo method. i am just trying to get information from my computer thats all. The method description says put //. to access shares on the remote machine.
I really need to get this going
Help please
Kelvin Chikomo
|
|
|
|
|
If you want to access the information from your machine then no need to give the share name(Server) with \\.
Instead this give NULL.
This will get the information from your local machine.
regards
Vallikumar A
|
|
|
|
|
I have tried that, thats when i get the NERR_NetNameNotFound error. should i give the full path of my shared folder or just the share name. It seems logical to use the share name.
|
|
|
|
|
The NetShareGetInfo function retrieves information about a particular shared resource on a server.??To what extent do you want to have the control??.
SO if you need the control of the files/folders/printers that are residing on the other machine use NETRESOURCE structure and pass it to WNetAddConnection2 function. This opens the connection and you can get the control to the shared folders.
Can you tell me what exactly do you want to do because there are a lot of roads that lead to somewhere from here but that would be useless mentioning here if they are of no use to you
Wishes
Anshuman
|
|
|
|
|
I am creating a tool to check the attributes of all the shares on my computer. just my computer. So basically i need to get all the information about the shares on my PC using NetShareGetInfo.
So far i have been trying to get info for one specific share but it keeps saying the the shre does not exist(NERR_NetNameNotFound)
Thanks for the help hey.
Kelvin Chikomo
|
|
|
|