|
I dont know why after you answer to questions we cant see orginal question!?
|
|
|
|
|
Timid children, I suppose.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
CPallini wrote: Timid children, I suppose.
No Hamid Children.
OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus
Best wishes to Rexx[^]
|
|
|
|
|
Maybe Hamid child or....Are there a lot of him ?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
CPallini wrote: Maybe Hamid child or....Are there a lot of him ?
I think its yet for me
|
|
|
|
|
Hey you back,where are you,do you remember me yet?
|
|
|
|
|
I was looking for a MFC control which can show HTML or plain-text content. Is there an existing one or do I have to write my own wrapper ?
Thanks
Cage
|
|
|
|
|
Do you want to use of CDhtmlDialog orCHtmlView?
|
|
|
|
|
I had considered them but wanted something which is as simple as an intelligent edit box which can render HTML, thought dialog or view was an overkill.
Thanks for helping Hamid...
Regards
Cage
|
|
|
|
|
|
Thanks Gary, this definitely gives me more options.
|
|
|
|
|
You're welcome .
|
|
|
|
|
Hello friends,
How do I check if a file is open or close?
Suppose I've 1 file and I want to find out if it is open or not How can
we do that?
I don't want to open the file for which I am going to check if it is open
or close.
Thanks in advance to all of you.
ritz1234
|
|
|
|
|
u an use this function in case of CFile.
BOOL GetStatus(
CFileStatus& rStatus
) const;
static BOOL PASCAL GetStatus(
LPCTSTR lpszFileName,
CFileStatus& rStatus
);
|
|
|
|
|
u can use this in case of fstream
bool is_open( );
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
To use is_open() function we have to open the file first.
I don't want to open the file to check it is open or close.
ritz1234
|
|
|
|
|
it works dear,
Case:1 if u run the apliation than it shows msg box means file is open.
fstream fs("C:\\fstream.txt", ios::out );
//fs.close();
if(fs.is_open())
{
AfxMessageBox("Test::File is Open");
}
Case:2 if u run the apliation than it is not show the msg box means file is not open.
fstream fs("C:\\fstream.txt", ios::out );
fs.close();
if(fs.is_open())
{
AfxMessageBox("Test::File is Open");
}
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Thanks for the cooperation,
But the problem is not solved
Here is the first part of the code I've tested.
<br />
int nOpen;<br />
fstream fs("C:\\Documents and ettings\\Rigel\Desktop\\SerialNumbers.txt",ios::out );<br />
nOpen=fs.is_open(); <br />
if(nOpen)<br />
{<br />
AfxMessageBox("Test::File is Open");<br />
}<br />
case 1: When the SerialNumber.txt is not already open by the user.
It doesn't show me the msgbox that's right because the file is not open.
case 2: When the SerialNumber.txt is opened by the user by double cliking the file.
In this case this code doesn't show me the messagebox that's wrong.
ritz1234
|
|
|
|
|
Use BOOL in place of int in "int nOpen;"
1 for tue and 0 for false.
and use this condition::
if(nOpen=0)
{
AfxMessageBox("Test::File is Open");
}
or
if(nOpen=1)
{
AfxMessageBox("Test::File is Open");
}
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Thanks for the reply,
But the result is the same.
It doesn't show the messge either the file is opened or not.
I've nOpen==1 instead of nOpen=1 in the code posted by you.
Have you copy the code in VC 6.0 project and try on it?
ritz1234
|
|
|
|
|
Thanks for the reply,
But in Getstatus() we can have the attributes of the file.
No information is there about the file is opened or close.
ritz1234
|
|
|
|
|
ritz1234 wrote: Suppose I've 1 file and I want to find out if it is open or not How can
we do that?
Unless you are capable of writing a low-level device driver, you'll need to open the file in exclusive mode. If it fails, you'll know that it is open elsewhere. This has already been discussed at length yesterday. What's still troubling you?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello, I was reading one of the tutorials on your site and thought I would try code something that could download files off the internet.
However, when I try to download large files or ones that use weird characters the files become corrupt and do not work. This is the case for .rar,.zip and many other formats. Further, I am unable to get information from .asp sites at all!? Any help would be greatly appreciated.
g++ ws.cpp -lws2_32
Note: Include files altered to work with this forum, missing "<"
<br />
#include winsock2.h><br />
#include ws2tcpip.h><br />
#include stdio.h><br />
#include iostream><br />
#include fstream><br />
<br />
using namespace std;<br />
<br />
<br />
int main() {<br />
<br />
char servername[40] = "members.myserver.com";<br />
char filepath[40] = "/username/file.rar";<br />
char filename[20] = "downloadedfile.rar";<br />
char buff[512];<br />
struct hostent *hp;<br />
unsigned int addr;<br />
struct sockaddr_in server;<br />
int y;<br />
<br />
<br />
WSAData wsaData;<br />
int iResult = WSAStartup(MAKEWORD(2,2), &wsaData);<br />
if (iResult != 0) {<br />
printf("WSAStartup failed: %d\n", iResult);<br />
return 1;<br />
}<br />
<br />
<br />
<br />
SOCKET conn;<br />
conn=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);<br />
if(conn==INVALID_SOCKET)<br />
return 0;<br />
<br />
<br />
if(inet_addr(servername)==INADDR_NONE)<br />
{<br />
hp=gethostbyname(servername);<br />
}<br />
else<br />
{<br />
addr=inet_addr(servername);<br />
hp=gethostbyaddr((char*)&addr,sizeof(addr),AF_INET);<br />
}<br />
if(hp==NULL)<br />
{<br />
closesocket(conn);<br />
return 0;<br />
}<br />
<br />
<br />
server.sin_addr.s_addr=*((unsigned long*)hp->h_addr);<br />
server.sin_family=AF_INET;<br />
server.sin_port=htons(80);<br />
if(connect(conn,(struct sockaddr*)&server,sizeof(server)))<br />
{<br />
closesocket(conn);<br />
return 0;<br />
}<br />
<br />
<br />
sprintf(buff,"GET %s\r\n\r\n",filepath);<br />
send(conn,buff,strlen(buff),0);<br />
<br />
<br />
ofstream file;<br />
file.open(filename);<br />
<br />
while(y=recv(conn,buff,512,0))<br />
{<br />
file << buff;
}<br />
<br />
<br />
file.close();<br />
closesocket(conn);<br />
<br />
<br />
WSACleanup();<br />
<br />
return 0;<br />
}<br />
Thanks! =D
|
|
|
|
|
Hi all,
i want to find out values of language,computer name and user name through coding....
I am unable to find it in registry. How could i find them
Thanks in advance
|
|
|
|
|
char RemoteFileName[60];
TCHAR chrComputerName[MAX_COMPUTERNAME_LENGTH + 1];
DWORD dwBufferSize = MAX_COMPUTERNAME_LENGTH + 1;
if(GetComputerName(chrComputerName,&dwBufferSize)) {
// We got the name, set the return value.
strcpy(RemoteFileName,chrComputerName);
you may need to #include <windows.h>
|
|
|
|