How do I know the context menu created by TrackPopupMenu is dismissed? Do I get any message? I know I will get a message if the user select an item, but how about if the user click anywhere outside of the menu?
this is your above code.
try removing '"' quotations before the strName and see.
then also if you are getting an error,
then hardcode the filename and see like fopen("c:\\test.txt");
and also you have to do some error checking like,
File = fopen(strName, "w");//NOTE:try removing the + and see
if(File != NULL)
AfxMessageBox("File Not Opened successfully");
i suspect that, the problem may be with + or the filename you are passing.
You can remove both the fflush and fclose statements.
The file will still generated and the text will be written in it.
Tell me the status, if you are still getting the error message, or the file is generating or not.
Also you can use ProcessExplorer to get the parent of the Error Message window. Is this the same application.
To answer your question Sreedhar, yes, case in point laptops which come with a stupid touchpad which remains active when I plugin a respectable USB mouse.
To answer Charles, the only way you can do this is to use the Raw Input Model. Handle the WM_INPUT message, process the RAWINPUT structure pointed to by lParam, it contains a RAWINPUTHEADER structure which contains a hDevice that you can pass to GetRawInputDeviceInfo. NOTE: raw input is available only when the application calls RegisterRawInputDevices with valid device specifications.
I joined the forums several days after spending several more days exploring through all the wonderful articles posted here. I had started to teach myself c++ just about 2 months ago. Things go well at times and things go slow, I am sure you can relate to how it was starting how in the programming world.
Right now I have been trying to teach myself how to get a simple connection between two computers. My original plan was to build a basic chat client that acts as a server/client for a peer to peer type of connection. After some problems I have decided to make a very simple console server that listens on a port and prints a string that it receives.
My server listens in a port and it appears I can even make my client have an "ESTABLISHED" connection with my server. However when I send() and recv() data, nothing happends. Or it locks up.
I am concerned that I am not using the right sockets for the right job. What I guess I want is a very general clarification of what each socket will do. I have read through 4 different tutorials here and most have been extremely helpful, however due to my own incompitance I keep getting it wrong!
Right now the way I understand it.
The serverside will have two sockets.
WIth the listeningsocket I create the socket.
ListeningSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
Bind the socket to a port and address
addr.sin_addr.s_addr = can be "INADDR_ANY" because its the server and is not targeted to connect at anything,
I bind port 8888, set the IP family type then run the BIND command