|
Inside OnAccept(..), call
Accept(CAsyncSocket& rConnectedSocket, SOCKADDR* lpSockAddr, int* lpSockAddrLen);
if Accept succeeded then, lpSockAddr will have the IP address of the connecting machine.
Hope CMySocket is CAsyncSocket
Do your Duty and Don't expect the Result Rate this Post, if I helped You
|
|
|
|
|
Thank you Parthi,
But i want to know from which the connection request is generated, and according to the rights they have i will decide to accept or reject. Is there a way to do this?
KIRAN PINJARLA
|
|
|
|
|
If the protocol is TCP then the only information you have is the remote peer's IP address (as
"seen" by your server). Any authentication you'll have to do yourself.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi
I want to explain the situation that I am in trouble then I will ask a question.I have four dialog boxes (Dlg1,Dlg2,Dlg3,childDlg).Each of Dlg1,Dlg2 and Dlg3 has a edit box and a button.The buttons are creating the childDlg and childDlg is sending a string for edit box of the dialog box which created the childDlg.But I couldn't find which one created the childDlg.I am using this line to get parent:
Dlg1 *dlg1 =(Dlg1 *) GetParent();
But I cannot find if it is Dlg1,Dlg2 or Dlg3.How can we do that?
I have another problem.Can we set a pointer to the edit box of the dialog box which created childDlg?Because the names of member variables which were declared for edit boxes are different.
I think about a complex solution but I know it is a very bad programming.Maybe you can find a simple solution.
|
|
|
|
|
You can distinguish the windows by their handles. BTW you can also pass some kind of identifier to the dialog, before calling the DoModal method (you can define you own method, for instance SetParent , in your childDlg class).
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.
|
|
|
|
|
The CDialog constructor accepts a pointer to the parent window. Doing it like this should be all you need:
<br />
void CMyDialog::DoSomething()<br />
{<br />
CMyOtherDlg dlg(this);<br />
dlg.DoModal();<br />
}<br />
If you don't pass in a parent window pointer (for modal dialogs), I believe MFC apps assume that the parent is the main app window itself.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
i built my application on VC 2005 and trying to run on some other machine where VC 2005 is not available but some error message is occuring i.e(This application has failed to start because the application configuration is incorrect. reinstalling the application may fix this problem).
i got some solution from http://blogs.msdn.com/nikolad/archive/2005/03/18/398720.aspx but i am not able to understand what exectly he want to convay like "x86_Microsoft.VC80.CRT" if anyone can help then i can test my application even on some dummy Pc
Thanks
RYK
|
|
|
|
|
Are you running application in Vista?
If your application contains many modules try testing module by module so that you can find which part cause problem. There are many chance for failure. For example file open with write request may fail.
Also try switch off optimization of compiler.
Best Regards,
Suman
|
|
|
|
|
No i am using XP and i have only one module with some function.hardly 2 files are there.
with regards
RYK
|
|
|
|
|
Maybe this[^] article will help.
In brief, there is no easy solution (like distributing the dll's with your exe).
|
|
|
|
|
alraedy i used that one it works for only application but one rest of application it is throwing the same error.
if you have any steps to floow then please do let me know.
with regards
RYK
|
|
|
|
|
Hi,
Well if you have dependency Walker on your machine, copy it to the remote computer.
Drag the .exe into the Dependency Walker Program.
You will see that some dll are missing, thus as the error suggested, the configuration is incorrect.
i.e. It can't find these dll's.
MSVCM80D.DLL
MSVCP80D.DLL
MSVCR80D.DLL
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
It's not that simple: you cannot simply copy the dll's along your exe the way you did with VC6 (for example).
|
|
|
|
|
Cedric Moonen wrote: you cannot simply copy the dll's along your exe the way you did with VC6 (for example).
I'm well aware of the fact that the dll's can't be copied. I was just making a point of the fact that he didn't understand what was going on.
But on the other hand wouldn't it help statically linking to those dll's ??
( )
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
There is a quick and dirty way to copy your app to another machine, see here[^], not ideal for installation but I have successfully used it to try apps on other XP machines before we got the installer going. You can copy the dlls if you do as they describe.
Sorry - that's not the right link - I'll see if I can find it.
-- modified at 8:10 Thursday 12th April, 2007
Here's the link - this allows you to do it simply by copying files - rough equivalent of having the dlls in the same directory as the .exe before manifests: link[^]
-- modified at 8:27 Thursday 12th April, 2007
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
Follow this link[^]
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
Hello all,
I have 2 exe's and on button click i want to switch from one to another.
On my button click event i have written this code
TCHAR szBuffer[ MAX_PATH ];
DWORD dwLength = GetProgramFilesDirectory( szBuffer, MAX_PATH );
CString Folder_path,index_File ;
Folder_path.Format("%s",szBuffer);
index_File = Folder_path + "\\neha\\neha.exe";
ShellExecute(NULL,"open",index_File,NULL,NULL,NULL);
exit(0);
on
exit(0);
its giving don't send error
can we use any other function instead of exit(0) for closing application.
thanks in advance
|
|
|
|
|
neha.agarwal27 wrote: can we use any other function instead of exit(0) for closing application.
Is PostQuitMessage() of any help?
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
I'm a new man,I'm a Chinese.Like .NET & C++.I just want to make friend with Everbody!
MSN:mynameiswanglin@hotmail.com
|
|
|
|
|
Max.Payne wrote: MSN:mynameiswanglin@hotmail.com
no
welcome to CP
now what's your question ?!
|
|
|
|
|
|
Hi,
I think some people in this forum like .Net & C++ so you are not alone .
Max.Payne wrote: MSN:mynameiswanglin@hotmail.com
Not good idea to write email address on the global forum.
I didnt see any question on your message do you have any question or problem?
|
|
|
|
|
Welcome to the codeproject friend!!
Best Regards,
Suman
|
|
|
|
|
Hello Max.Payne
May I ask a question?
|
|
|
|
|
Yes please!You can send MSN(mynameiswanglin@hotmail.com) to me,and send message on this Message board!
|
|
|
|