|
Eshoula Aswomwe wrote: I did increase the size of array by calling the array and increase the size using this variable Incrementing a variable does not change the size of the array. You need to create a new array and copy the values into it allowing an empty cell where the new value is to be added. Then you can add that new value into the empty cell.
Use the best guess
|
|
|
|
|
hi
how to find 80 port is in use or not with c++ code or mfc
|
|
|
|
|
|
Garth J Lancaster wrote: the only way I know is to attempt to connect to the port - if that fails, the most likely reason is, is that the port is in use In use or unavailable? I ask because can't there be more than one connection to a port?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
well your use of 'unavailable' hit the nail on the head for the case I was thinking of - 'client had disconnected, but port was in timeout-wait' - ergo, not technically in use .. this may be particular to the scenario/implementation I see if happen in (a lot, unfortunately)
as to more than one connection to a port, I'd have to go back to my W Richard Stevens to check - I know what we 'see' happening in a lot of cases - eg multiple connectiins to tcp://w.x.y.z:80 may not necessarily be the case - the initial connection is accepted on that port, but then 'spun off' to be handled as a seperate conversation, leaving port 80 free
Is that what you were thinking ?
|
|
|
|
|
I'm not sure if this is relevant to you, but you can call bind[^] on the ip address and port, check if it fails and see if the error is WSAEADDRINUSE .
|
|
|
|
|
Is there a good example of using a CMFCPropertyGridCtrl?
Thanks.
|
|
|
|
|
|
I like to learning C++ with some GUI framework. After searching on Internet MFC is good native development tool for Developers but I have problem is there any value learning MFC nowadays? Because in Windows 8 application type that called Metro applications or give me some good framework to learn C++ GUI Programming
|
|
|
|
|
|
|
Yes.. Working Native means much than it sounds. You should try a little Windows API before going into MFC. If you do some Windows API (Win32), learning MFC will be much easy.
There're plenty of Online stuff for MFC, For Win32 Try the book, "Charles Petzold - Windows Programming".
Pravinda
|
|
|
|
|
"...is there any value learning MFC nowadays?"
In my opinion, the .NET environment is superior to MFC. It was written after MFC, and is much easier to use. The developers learned from their mistakes with MFC.
With MFC, problems that should take minutes to solve sometimes take days. And days.
MFC only works with C++. With .NET you can use it with C++, C#, Basic, and others.
|
|
|
|
|
Disagree !
I don't think that MFC is bad. MFC is a thin layer in front of the Windows API. So it's powerful. .NET has a long pipeline from Windows Kernel to the .NET app.
For small apps, and to develop software faster, .NET is the best. But when it comes to performance MFC is far more greater than .NET. Most of the large projects have written with Native APIs.
|
|
|
|
|
Alan Balkany wrote: With MFC, problems that should take minutes to solve sometimes take days.
How so? I always found it very simple, and if you want part of th win32 api that isnt wrapped by MFC you just call it directly. You can edit the message map simply to add WM_XXXXX commands that arent handled by the class wizzard, and can simply modify the comnstructors to pass all kinds of data round.
The only complexity would be implementing something complex, like windows hooks or some such, but that would be the same with MFR of raw win32 API.
But I agree, learn .Net and C#, it has WAY more commercial demand. (By the way, I didnt know you can use C++ with ,Net. I am a kernel guy and dont venture into user mode that much these days.)
==============================
Nothing to say.
|
|
|
|
|
The consistently incomplete documentation for MFC makes it difficult to use.
Of course an MFC expert can easily use it to solve problems. But it's not user friendly to someone who's not an expert. With .NET and intellisense, you can use .NET effectively even if you don't know it very well.
A couple examples of MFC landmines that eat up the hours and days of your development time:
1. You have a CBitmap and you want to load a .bmp file from disk. How do you do it?
(HINT: CBitmap::LoadBitmap () doesn't work. How retarded is that?)
2. You see that OnDraw () is used to update windows. Fair enough. But you try to use it on a CDialog and it doesn't f***ing work!. Part B: You try to use it on a CFrameWnd and it doesn't f***ing work, but for a DIFFERENT reason!
MFC is full of garbage like this! (And I used it back in 1997 when you couldn't just go to the Internet for a quick answer.) MFC is one of the reasons I hate Microsoft!
modified 4-Mar-13 11:20am.
|
|
|
|
|
Alan Balkany wrote: CBitmap::LoadBitmap () doesn't work. How retarded is that?
Why Windows didn't add simple .bmp, .jpg and .zip file reader/writer APIs way back with Windows 95 has always been a mystery to me.
|
|
|
|
|
I suspect it's because Microsoft sees ALL other developers as potential competition to THEIR products, so they insert conceptual roadblocks and missing or undocumented functionality to slow them down.
|
|
|
|
|
I think it was a combination of incompetence, lack of vision, arrogance and a fear of lawsuits (for the JPG and zip stuff.)
Alan Balkany wrote: undocumented functionality to slow them down.
Contrary to popular belief, that is very rare. Almost all undocumented functionality that is useful is actually provided through other means. Frankly, the biggest problems with Windows is the COM kick they got on in the 90s and that Microsoft engineers tend to over-engineer everything favoring complexity over simplicity (an all too common problem with all engineers.)
|
|
|
|
|
There is a value in MFC even this days. A lots of applications are written with MFC, and some of them(which are usually time critical or compute intence) are still will be written in MFC.
If you interested in learning MFC, the good start is Ivor Horton's "Visual C++ 2010".
|
|
|
|
|
|
Ideally, for learning C++, you do not need a GUI.
You can simply the console message using cout.
If you still need a GUI, MFC is the best bet for native C++.
ATL also has window classes and there is an unsupported windowing framework called WTL that builds on top of this.
In the .Net world there is a C++ extension called C++/CLI that has a GUI.
But this is not strictly C++ because new syntax has been introduced.
Metro apps or Windows Store apps use XAML for its GUI.
But this is also not native C++.
It is another extension called C++/CX that is very similar to C++/CLI in syntax.
So if you really want to learn C++, simply use cout to output messages because it will work not matter what OS you're running it on.
|
|
|
|
|
I need to develop commercial level application
|
|
|
|
|
That depends on what you mean by "value". If you're just thinking about its usefulness on your résumé there are probably better choices.
To the .net is better camp all I've got to say is, personally I'm glad I went from lower level programming environments and worked my way up. I think that actually knowing what's going on makes you a better programmer.
Steve
|
|
|
|
|
If your application is Windows specific and needs any sort of performance advantage, MFC is fantastic. Personally, I like the enhancements to it offered by CodeJock, but to each his own. People like to gripe about MFC because it doesn't have C++ purity, but who cares; it's fast and, with a few exceptions, stays out of my way (in what matters to me.)
On the other hand, for database front ends, ASP and UI applications where you are willing to give up some fine grained control, a little performance AND you are still Windows specific, .NET is the way to go. Some people here have advocated going the Silverlight route. I'm not a fan, but my work doesn't fall into the niche where Silverlight makes sense.
For cross platform, despite some its ugliness, including it's massive size and very annoying pre-compiler, Qt is probably the best bet. (WxWidgets is also worth looking into, but I'm more familiar with Qt and personally find it better going forward, though I could change my mind tomorrow.)
I do agree with a comment above; if you are just learning C++, don't bother with a GUI. Same with C#. Just use the console and try to keep the code as procedural as possible and build from there once you get the basic concepts down. To be honest, I prefer people start with C, but that may not be realistic today.
|
|
|
|