|
ASSERTION should give you idea, why app is failing.
neha.agarwal27 wrote: in wincore.cpp and the position it shows is send message
But what line in wincore.cpp ?
Prasad
MS MVP - VC++
|
|
|
|
|
line no 980
sometimes it also gives memory cannot be read error
|
|
|
|
|
Probably, you can show call stack , it is showing. Cannot guess without seeing some code.
Prasad
MS MVP - VC++
|
|
|
|
|
neha.agarwal27 wrote: line no 980
There's several versions of MFC in use. What's at that line in your MFC source?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
Hi
In my programme Server was Lisening in port no "9090" and
client was connected to that by giving port no and IP-Address .
Now i want to know wheather Server can provide an Port no to client when they connect.
Because if same port no used by two client ,they cannot access(therfore server must assign a port no).
Give me a suggestion about this.
Regards
shakumar
shakumar
|
|
|
|
|
the port 9090 is the listening socket
when a connection is established a new socket is createdon the server side and the listening socket continues to listen. The server side port number used in the connection is assigned by the network stack
you can use the netstat command in windows to see which ports are being used
|
|
|
|
|
server will continue to listen on same port no.
When clients makes a connect server will accept the request and new socket will be created with diff id.
|
|
|
|
|
Thanks for Your Reply
shakumar
|
|
|
|
|
Are you actually running into a problem?
Or are you just wondering how it all works?
What's been said about server-ports is true. For example, a web server listens on port 80 and can accept multiple connection via that port. It does so by creating 1 listening socket on that port. When incoming connections are made, new sockets are created to handle each conversation/connection.
On the client side, you can run into problems if you assign a port there. Don't do it, always set your client-side port to 0.
If you were to attempt to test 2 clients fromt the same computer, you'd run into problems with conflicting ports. By using port 0
you're instructing your tcp stack to allocate an available client-side port -- avoiding any conflict.
It's not like you actually would care about this client-side port...
I don't know if this helps, but I thought I'd share...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</A>
|
|
|
|
|
In VS install directory, there're some files(.cpp, .h) seems to be source code of MFC. So can I put them back into VC and compile them?
|
|
|
|
|
Yes but if you make any changes you will need to distribute your new DLL(s) along with your app
|
|
|
|
|
You can. But you really shouldn't do it unless you have a very good reason to do so. And I can't think of a good reason to.
If you want to change the behavior of some class, just subclass it and handle it in that good old C++ way...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</A>
|
|
|
|
|
Oh...I'd like to have a try. Just to know MFC libray better.
So are there any instructions about compiling MFC source code on the internet?
|
|
|
|
|
I'm not sure how building the library yourself will help you "know MFC libray better", but...
Take a look in the atl/mfc src directory.
For example, in VS 2005, there's a readme.txt that states:
Building ATL and MFC
To build either ATL or MFC open a command prompt and run vcvars32.bat from <path to vc8>\bin
Change directory to <path to vc8>\atlmfc\src
atlmfc.mak can be used to rebuild all ATL and MFC libraries and DLLs.
Following is the command line you can specify with NMAKE
nmake /f atlmfc.mak [ALL | ATL | MFC] [CLEAN= ] [LIBNAME= ] [PLATFORM= ]
Targets
ALL - builds both ATL and MFC. This is the default target. LIBNAME has to be
specified.
ATL - builds only ATL.
MFC - builds only MFC. LIBNAME has to be specified.
CLEAN=1 cleans the files generated by the specified targets
LIBNAME="name of the MFCdll being built" - specifying MFC80 builds the prebuilt DLLs
PLATFORM=[AMD64|IA64] if building for 64-bit on a 32-bit system
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
Very long time ago, I just wondered why doesn't MFC add all Windows message handlers to CWnd and make them all virtual, so that derived classed don't need to add message handlers but only to override virtual functions.
MFC claims that it uses message maps rather than virtual functions just in order to tune the performance, now it's time to tell the real difference.
|
|
|
|
|
Cool. Let us know the results!
From Technical Note TN006:
"Microsoft Windows implements what are essentially virtual functions in window classes using its
messaging facility. Due to the large number of messages involved, providing a separate virtual
function for each Windows message results in a prohibitively large vtable.
Also, since the number of system-defined Windows messages changes over time, and since a specific
application may want to define some Windows messages of its own, the message-map mechanism
provides a level of indirection that prevents interface changes from breaking existing code."
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
Hi All,
How Can we make a Modeless Dialog Box to Act as Modal Dialog Box??
Thanks
Today is a gift, that's why it is called the present.
|
|
|
|
|
The two kinds of dialogs are created differently. If you're using MFC or ATL, call DoModal() . In the APIs, call DialogBox() instead of CreateDialog()
|
|
|
|
|
I know that but what I want is , how can we make a Modeless Dialog box Once Created to act as Modal dialog box? If I have a dialog and on a button click I am creating a modeless dialog box using create(). Is there a way in which I can make my modeless dialog box to act as modal dialog box?
Thanks
Today is a gift, that's why it is called the present.
|
|
|
|
|
Why are u creating it modalless to make it modal? Just create it in modal way.
CDialogBox* MyDialog;
MyDialog->DoModal ();
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
narayanagvs wrote: Is there a way in which I can make my modeless dialog box to act as modal dialog box?
Actually, no. Unless you 'recreate' (destroy previous and DoModal a new one) your dialog, you cannot turn a modeless into a modal one.
--
=====
Arman
|
|
|
|
|
You can probably do something when your dialog looses the focus. If the focus is going to a window other than your dialog or its children then put the focus back to your dialog but I dont know how well it would work or how it would effect other apps running on the system. Ie its a hack
|
|
|
|
|
You could disable the dialog's parent window, then be sure to re-enable it when your dialog closes. But yeah, this is a hacky idea. Raymond Chen[^] has written some posts about doing manual modality like that, check out his blog.
|
|
|
|
|
Michael Dunn wrote: Raymond Chen[^] has written some posts
"This is like asking for a cheeseburger and then trying to peel every last bit of cheese off the patty to turn it into a plain hamburger."
Mark Salsbery
Microsoft MVP - Visual C++
"Great job team! Head back to base for debriefing and cocktails."
|
|
|
|
|
You can disable the parent window.
« Superman »
|
|
|
|