I'm working on a project and I'm a beginner in VC++.
I'm creating a TCP server that will receive a bitmap and will show it on window.
The motive is to receive the continuous images from a client and show them one by one on server window.
Well, you are starting off from the wrong basis here.
A TCP server (in fact a client and server) is implemented in the kernel (on WIndows as TCPIP.sys) and supports am interface called TDI (on older Windows OSs and called something else on newer ones). TDI transports across the IO manager (Kernel to USer mode), providing sockets in the user mode for applications to use.
So what you need are two apps one that opens a socket and sends a bmp file, and another that waits on a socket and can render that bmp file to the screen.
(You can also not directly display UI stuff from the kernel so the stock TCP kernel driver would never be able to display a bmp)
If you really wanted to implement a user mode TCP server/client module then the question is why, and the problem is how you are going to send IP packets to the network card. And if you wanted to send Ethernet packets to the network card you would need to implement IP in user mode too. And if you wanted to do that you would need to write a network driver for your card with a interface accessible to the IO manager that you could open in user mode to get those Ethernet packets to it. All in all a massive and complex problem, so just use sockets, its what they are made for, and made by a lot of very clever people who understood the network stack and provided it for people like you to use.
sir this application is for showing the IPAD on a windows screen.
That's why I'm creating this to do so..
I'll have to receive the data from IPAD and will have to show it on
Window or on a GUI in windows 7.
I've studied your applications written on codeproject
and discussed to my senior but he refuses to use it in a long way.
The thing is only to receive the images and show them without saving,,, its complete thing like you have done..
doesn't a modal need a user respose yes/no when you do a dlg.domodal that thread stops until the user responds
True, but if it's the main window there is no other thread to worry about. You can do lots of actions within the dialog box while it is on the screen. Maybe you should explain exactly what problem you are trying to solve, rather than deciding on the window type before you know what you want to do with it.
The registry is like a file system with different access rights for the different keys. Navigate to your key using regedit and open the 'Permissions' command from the context menu to see the permissions for specific users and groups. Some keys have restricted access even for administrators (SAM, SECURITY). Such keys can be only accessed by the SYSTEM user.
So the answer to your question is: You must have the access rights which are usually granted when you open the key using the account of the key's owner.
At the moment I know only two reasons for denied permissions when trying to write to HKCU:
Using RegOpenKeyEx(), the key was not opened with the KEY_SET_VALUE or KEY_WRITE access right.
Using RegOpenKey() instead of RegOpenKeyEx().
Regarding the second reason I will cite the MSDN:
The RegOpenKey function uses the default security access mask to open a key. If opening the key requires a different access right, the function fails, returning ERROR_ACCESS_DENIED. An application should use the RegOpenKeyEx function to specify an access mask in this situation.
If this does not solve your problem, you should show us the code that fails (including the RegOpenKeyEx() call).