Making member private make them hidden from outside world. So that only class's public member(which is only accessible from outside world) can modify them. Which is called abstraction in OOP.

This is the great feature defined by OOP and adopted by c++, c#, java like languages. Hiding data member prevents accidental modification of data member which is very normal thing.

Say for example you as a software company buy a third party DLL by spending huge amount of money, which provides you lots of classes for graphics manipulation . What if they dont make thier data member private and your developer changes them wrongly and your graphic software crashes. Will you blame the third party that their classes are not working properly. To prevent such kind of obious situation if third party make data members of class as private and expose some public methods which adds validation of data that you are accidentally providing wrong can handle a lot critical errors.

Providing public methods to access private data called encapsulation in OOP.

Banfa commented: Good explaination, encapsulation is 1 of the 3 main tenents of OOP the other 2 being inheritance and polymorphism +0

As per my knowledge due to some security issue on vista and above os's SendMessage and PostMessage Api are disabled if they used to send message across process. You can use this API to send msg within process, parent wnd to child wnd. We had faced same problem. To overcome this we used pipes and memory mapped files.

If you have support to MFC library then you can use CImage class. Its very easy to saving image as jpeg using CImage. Just pass handle to bitmap to CImage or load it from hard drive. Call Save function and specify jpeg as saving type.

jonsca commented: Good idea +5

hey thanks for help ;)

instead of using gethostbyaddr function i used getnameinfo Function.
It is giving the host name of client which is actually i want. Thanks buddy

  • Run regedit
  • right-click on *, new > key
  • name the new key "shell"
  • right-click on shell, new > key
  • name the new key "[B]MyOption[/B]"
  • right-click on Scite, new > key
  • name the new key "Command"
  • Click once on Command to select it
  • right-click (Default) on right side > Modify
  • Add "C:\Program Files[B]MyApp.exe[/B] %1" (Path to exe ahere ever u have stored)to Value Data (don't put the quotes)

@="c:\Program Files\MyApp.exe %1"[/B]

Now on most files, you can right-click and see "MyApp" as option, allowing you to open this file MyApp.exe.

it is so easy brother

first add menu(create new or existing one) to your resource file.

now go to your dialog and select whole dialog not any control then right click on it then goto property and select Menu option and give menu id thats it now compile and run the app menu is attached to it

__avd commented: You made it so easy. +9