|
Hi,
I would like to know the difference between Regular DLL using shared MFC DLL, MFC extension DLL, Regular DLL with MFC statically linked. Which one is better in performance and all other important aspects. I would be thankful for ur help.
Thanks & Regards
Sanjay S. Umap
|
|
|
|
|
|
Hello All,
In Socket Programing i am getting an Error No 10053.
It is for Connection closed by Software.
So anybody Tell me what is the problem inside?
Thanks in Advance.
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
What's going on in the code when you get the error?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
At client side connection get close.
But server at server after that it cannot send messages.
Thanks and Regards,
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
10053 referred to as ECONNABORTED or WSAECONNABORTED.
The TCP stack on your computer has decided to terminate the connection because something BAD happened in it's conversation with the host.
The error is kinda mysterious, and doesn't point to a cause. And the cause could either either side of the connection -- you or the host.
See this link for a description of the error: http://www.sockets.com/err_lst1.htm#WSAECONNABORTED[^]
If your server is developed in-house -- go talk to them. It could be their fault -- possibly either software or server configuration or even a routing problem.
If not, go visit their website. You are probably not the first to run into this problem.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</A>
|
|
|
|
|
Hello everyone,
I think the value_type of vector<int> should be int and the value_type of vector<int> should be int*. But I am not 100% sure,
1. how to write a program to verify this idea;
2. where to find the definition that the value_type of interator of vector<int> is int*.
It is appreciated if you could help.
<br />
#include <vector><br />
<br />
using namespace std;<br />
<br />
int main (int argc, char** argv)<br />
{<br />
vector<int>::value_type;
vector<int>::iterator::value_type;
<br />
return 0;<br />
}<br />
thanks in advance,
George
|
|
|
|
|
Firstly we can't see the “<” and “>” characters in your post or what’s between them – this information is vital if you expect an answer to your post. Do you review your posts?
I assume you mean the following:
#include <vector>
using namespace std;
int main (int argc, char** argv)
{
vector<int>::value_type;
vector<int>::iterator::value_type;
return 0;
}
The line vector<int>::iterator::value_type is incorrect and might result in compiler errors (depending on the particular STL implementation you’re using.) The correct way to get type information is as follows:
#include <vector>
#include <iterator>
iterator_traits<vector<int>::iterator>::value_type
The reason for using external adaptation via the iterator_traits class is simple: it allows the use of types such as int* to be used as iterators (since int* s are not classes and so can’t expose a value_type directly.) Also note that the crap-fest STL that comes with MSVC6 will fail to compile the code I gave because it’s missing the required iterator_traits specializations.
Also note that you can not assume that an iterator is a pointer: it may or may not be depending on many factors, among them the whims of the implementors (of the STL being used.)
Steve
|
|
|
|
|
Thanks Steve!
I have also referred some links, like this one in sgi implementation,
http://www.sgi.com/tech/stl/iterator_traits.html[^]
Currently, I am using Visual Studio 2005 and using other implementation to illustrate is also fine. Yes, you are correct, I mean vector with greater than and less than signs.
From your reply, I do not understand why from this statement,
iterator_traits<vector<int>::iterator>::value_type
if the type of vector is T or int (i.e. vector <t> or vector <int>), the value_type iterator is also defined to T or int? How it is implemented? For example, from either sgi implementation or Visual Stuido 2005 implementation is fine.
regards,
George
|
|
|
|
|
In <iterator> (or some implementation defined file included by it) you'll find a template something like this:
template <class Iterator>
struct iterator_traits
{
typedef typename Iterator::iterator_category iterator_category;
typedef typename Iterator::value_type value_type;
typedef typename Iterator::difference_type difference_type;
typedef typename Iterator::pointer pointer;
typedef typename Iterator::reference reference;
};
This simply forwards the requests to the iterator class. The following partial specialization allows would allow pointers to be used as iterators (note that MSVC6 can’t handle partial template specialization):
template <class T>
struct iterator_traits<T*>
{
typedef random_access_iterator_tag iterator_category;
typedef T value_type;
typedef ptrdiff_t difference_type;
typedef T* pointer;
typedef T& reference;
};
Note that no forwarding is used here: the types are defined in-place.
Steve
|
|
|
|
|
Thanks Steve,
I have read through the above codes, but I am confused that when the statement as you mentioned,
<code>
iterator_traits<vector<int>::iterator>::value_type
</code>
whether
<code>
template <class Iterator>struct iterator_traits
</code>
or
<code>
template <class T>struct iterator_traits<T*>
</code>
is invoked?
regards,
George
|
|
|
|
|
|
Thanks Steve,
My question is answered.
regards,
George
|
|
|
|
|
My project contains client application and server application. Always using server to control the client side. A Dialog at client side using a CFileDialog to open a image file. the problem is, after the server side close client side dialog, but the CFileDialog remains on screen.
We tried lots of way to close CFileDialog, but failed.
like EndDialog(), EndModalLoop(IDCANCEL) EndModalLoop(IDOK), and PostMessage(WM_KEYDOWN,VK_ESCAPE, 0)
So....what can I try next?
--
I create a demo to show this problem. Dialog A calls Dialog B, and Dialog B calls a CFileDialog, then add timer event in Dialog A to Destroy Dialog B. the CFileDialog was closed too.
Does this demo wrong to reproduce this problem?
|
|
|
|
|
You have probably not set the parent window of the CFileDialog.
|
|
|
|
|
Thanks for your reply. I tried set fFileDlg.m_pOFN->hwndOwner = this->GetParent()->m_hwnd , but it's doesn't work.
-- WuJunyin
|
|
|
|
|
Can you show me the code fragment regarding this?
|
|
|
|
|
<br />
CString strFilter = "..."; <br />
CFileDialog fFileDlg(TRUE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,strFilter,NULL);<br />
fFileDlg.m_pOFN->hwndOwner = this->GetParent()->m_hwnd;<br />
<br />
if (fFileDlg.DoModal() == IDOK)<br />
{<br />
...<br />
}<br />
|
|
|
|
|
Try like this...
CFileDialog fFileDlg(TRUE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,strFilter,this);
//fFileDlg.m_pOFN->hwndOwner = this->GetParent()->m_hwnd;
if (fFileDlg.DoModal() == IDOK)
|
|
|
|
|
I have tried it before I post this message.
|
|
|
|
|
Are you sure that the file dialog is coming as modal? Means can you switch the focus to the main dialog when the file dialog is open?
|
|
|
|
|
I'm sure it's coming as modal, and i cannot switch after the filedialog appeared.
------ WuJunyin
|
|
|
|
|
How is the main window is closed, by the server? Can you please show me the relevant codes?
|
|
|
|
|
Thank you for your help.
This bug has been fixed.
|
|
|
|
|
Could you please tell me what the problem was?
|
|
|
|