|
Thanks.
can you be more elaborate on the following comments given by you..
"When you want to give the limited access to your object's from copy
for e.g
by making it private only member functions can access and public access denied"
Thanks
|
|
|
|
|
Subramaniam wrote: "When you want to give the limited access to your object's from copy
for e.g
by making it private only member functions can access and public access denied"
See the following example
class CDemo
{
int i;
CDemo(CDemo &b)
{
i=b.i;
};
public:
CDemo& operator=(const CDemo &b)
{
this->i=b.i;
return *this;
};
CDemo(){};
CDemo test()
{
return *this;
}
};
int main(int argc, char* argv[])
{
CDemo c;
c=c.test();
CDemo c1(c);
CDemo c2=c;
return 0;
} With this we can prevent public from making copy of the objects only class members are allowed to make such coping
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
SOCKET SoAccept=WSASocket(AF_INET,SOCK_STREAM,0,NULL,0,WSA_FLAG_OVERLAPPED);
//In working thread, at the end of processing for completion of AcceptEx
setsockopt(pPerIOData->m_Socket,SOL_SOCKET,SO_UPDATE_ACCEPT_CONTEXT,(char*)(&SoListen), sizeof(SoListen))
...
WSARecv (pPerIOData1>m_Socket,pPerIOData1>m_pBuf,1,&Recved,&Flags,pPerIOData1,NULL);
...
Here the WSARecv will return 0, and reveived data is valid, but I think it should only post a requestion to the IOCP here, and the data will be received after an GetQueuedCompletionStatus, who tell me what's wrong?
btw: AcceptEx works asynchronously as expected.
|
|
|
|
|
I don't think anything is wrong.
You can use the fact that WSARecv returned 0 to optimize some code, but a completion packet should also have been queued to the IOCP, so GetQueuedCompletionStatus should also return it.
You generally only care if the return from WSASend/WSARecv if != 0, and then only if WSAGetLastError returns != WSA_IO_PENDING.
...cmk
Save the whales - collect the whole set
-- modified at 17:48 Monday 22nd May, 2006
|
|
|
|
|
At the completion of AcceptEx, I called WSARecv, it return 0, and data can be got immediately, nothing wrong. Then until WSARecv return SOCKET_ERROR I put another WSARecv, ensure that WSAGetLastError()==WSA_IO_PENDING. But it can't receive data from the client any more, why?
|
|
|
|
|
I'v not seen any document that says WSARecv can return 0 in IOCP model.
I'm not sure however.
-- modified at 22:17 Tuesday 23rd May, 2006
|
|
|
|
|
followait wrote: I'v not seen any document that says WSARecv can return 0 in IOCP model.
It says so right in the MSDN docs for WSARecv.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Hi,
I have few questions.
i have read some articles on https+vc++ in code project. Thanks to the guys for articles.
1. If i need to do a https request(ssl+client crtification) to a server which is the library i need to use for VC++ dll(not a desktop application).
winInet or WinHttp
2. what are the sequence of operations(API methods) to send the https request.
3. i have client certificate, and i want to select this particular client certificate with the https request.
thanks
|
|
|
|
|
i am able to makes a https connection using wininet,
but how can i handle the response.
i am using the InternetReadFile after the request is sent.
This method reads the contents of the file, but i want a API method which responds only the output of the object file(my case it is servlet).
thanks
|
|
|
|
|
|
Hi,
I get the list of file name with full path as the output in the list box.
when the user double clicks on the list box item i want the file to be opened i have used the below code but it has no effect, its not opening the file. can u please tell me what will be the error.
void CSearchDlg::OnDblclkSout() <br />
{<br />
<br />
int d;<br />
d=m_SOUT.GetCurSel();<br />
CString FName;<br />
m_SOUT.GetText(d,FName); <br />
ShellExecute(m_hWnd, "open", FName, NULL, NULL, SW_SHOWNORMAL); <br />
<br />
<br />
}
Regards,
Vinay Charan.
|
|
|
|
|
vinaycool wrote: m_SOUT.GetText(d,FName);
ShellExecute(m_hWnd, "open", FName, NULL, NULL, SW_SHOWNORMAL);
Is FName the full path to the file?
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
Hi Nibu thomas,
List box contains a data like
C:\dir\filename.ext
i used the F5 and checked the value of FName i am getting Error symbol "FName" not found.
Is the code correct to get the value of the selected item from the list box ??
|
|
|
|
|
Vinay wrote: List box contains a data like
C:\dir\filename.ext
The Fname should be in the format of '\\' instead of '\'
for e.g
C:\\path\\filename.extension instead of C:\path\filename.extension
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Hi Laxman,
I cant change the file path,because the items in the list box contains a data like
D:\folder\folder\00000301\0123.txt
Can u please tell me how to open the file ???
|
|
|
|
|
Vinay wrote: Hi Laxman,
I cant change the file path,because the items in the list box contains a data like
D:\Parichay\Box01\00000301\0123.txt
Can u please tell me how to open the file ???
void CSearchDlg::OnDblclkSout()
{
int d;
d=m_SOUT.GetCurSel();
CString FName;
m_SOUT.GetText(d,FName);
modify the FName path here as above post
ShellExecute(m_hWnd, "open", FName, NULL, NULL, SW_SHOWNORMAL);
}
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Hi Laxman,
I dont know how to do that can u please tell me how to alter the file name in the runtime...
|
|
|
|
|
vinaycool wrote: I dont know how to do that can u please tell me how to alter the file name in the runtime...
Sorry , this is too much
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
vinaycool wrote: how to alter the file name
#include <cstdio><br />
int rename(const char* oldname, const char* newname);
Maxwell Chen
|
|
|
|
|
This answer is not correct. The double backslash is only neccessary if you use a literal string in your programming code. Here you just read the name entered in a listbox. I recoomend to use the source level debuger and place some breakpoints. You should always check following things: is the function actually called? Does the Listbox provide the correct handle? (I also recommend to handle LB_ERR so you see it if something is wrong)Do you get the correct string back from the listbox? Is your call to ShellExecute handled correctly? Does it give back an error message?
I really do not understand why you need to ask such a question in the forum. You reaaly should invest some time to learn how to use the source level debugger and how to read the documentation.
|
|
|
|
|
Can you tell me how to use graphics in a console application(Ex : Draw a line or something)!I can do that in turbo C but in VC++ I dont know any function or any thing to do that!Please help me!
Thank!
|
|
|
|
|
Take a look here[^], I think you'll find what you are looking for. Especially the beginners section.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
kflrei wrote: Can you tell me how to use graphics in a console application(Ex : Draw a line or something)!
Well you have to grab the device context of the Console Application. Then use normal SDK paint functions to paint to this device context.
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
kflrei wrote: !I can do that in turbo C but in VC++ I dont know any function or any thing to do that!Please help me!
you have to learn Windows Programming to DRAW in Windows World!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Thank for your advice!I'll think about that!
(I only want to create some program that can run before windows start!Graphics only to make it easy to use!)
|
|
|
|