Well, I think, that MB_SERVICE_NOTIFICATION have a little bit better behavior .
Reason for "undeclared identifier" - you probably didn't set the windows version macros.
Just simply put following snippet before you will include <windows.h> header (usually included in stdafx.h)
// Allow use of features specific to Windows 95 and Windows NT 4 or later.<br />#ifndef WINVER <br />
#define WINVER 0x0400<br />
// Allow use of features specific to Windows NT 4 or later.<br />#ifndef _WIN32_WINNT<br />
#define _WIN32_WINNT 0x0400<br />
#endif <br />
// Allow use of features specific to Windows 98 or later.<br />#ifndef _WIN32_WINDOWS<br />
#define _WIN32_WINDOWS 0x0410 <br />
// Allow use of features specific to IE 4.0 or later.<br />#ifndef _WIN32_IE<br />
#define _WIN32_IE 0x0400<br />
You should use SERVICE_INTERACTIVE_PROCESS in dwServiceType while creating the service (In CreateService()).
(You can use also do this manually by going to services window and changing to property of the service and checking "Allow service to interact with desktop" under Log On As group.
Thanx for showing interest.
By 'blocking' a packet I mean that I want certain packets not to reach their destination. Actually I mean to say is that I want to make an application which would let only those packets to pass which are allowed by me and block or discard those packets which are not allowed by me to further pass on.(i.e some thing like a firewall ). I am interested in using WINSOCK2 lib. Plz dont refer me to work on driver.
E.g Lets say I want that TCP packet should not reach their destinatin but ICMP packets should e.t.c.
AFAIK, there is no way how to do it with winsock (without developing a driver).
If you are allowed to use only W2K Server and W.NET Server there is a possibility to use the packet filtering in Routing and Remote Access Service.
For XP(Home+Professional) only, you can use Internet Connection Sharing/Firewall.
Other way is - go driver way - but you don't need to develop your own driver - I think, there are some drivers available on internet also with src code, where they have DLL with exported functions for configuring the filters. I know one personally, the name is something like pcaplib or similar, you have to look for windows version of course.
another links I found while 1 minute googling:
I have an exe being launching from a service using CreateProcess() call. As you know that the service is run in SYSTEM' (Default User') context and not in logged user' context. In my .exe, I have File Save option. When the FIle Save dialog comes up, it shows the desktop of the Default User and not of the user who has logged in. I want the File Save dialog to come up with the logged on User' profile (Desktop, My Documents, History, etc). Has anybody faced this problem earlier?
Please let me know if you have faced this problem before and if you have solved the defect or if you have a workaround for this.
thanks for the quick reply. But the problem here is that I do not have know who has logged in and what is his password. For CreateProcessWithLogonW, we need the username and the password. I thought of using CreateProcessAsUser. But there also I do not know how to get the token that represents the user. If you could help me in giving some piece of code, I would be greatful.
Use the API function WideCharToMultiByte() which is well documented on MSDN. It also depends if you want to convert to ascii (and hence lose all Chinese characters) or to an ansi code page that still allows the chinese characters to be retrieved (a multi-byte character set). If you want to go to ascii, you can use 1252 as the target codepage.
If you are running this on a Chinese system (i.e. Chinese Windows, or English Windows with Chinese regional settings), then you can pass in CP_ACP as the target code page, and it will convert it to the current system codepage, which should include the chinese characters. If this is not a chinese system, then you will need to pass in the chinese code page number instead (which i can't remember of the top of my head).
I have a tree control class. I also have an image list that I want to associate with my tree. Why can't I declare a static array and initialize it with the id's of icons, in the resource file, in my tree control class??
I've included "resource.h" so I should know what the IDI's are...
Read up on how to use static member variables. Initialize it outside of the declaration like this:
class RCanalTree : public CTreeCtrl
0// NULL place holder used to terminate the array.
i want to display some dynamic information when my mouse point to some place in the dialog box.
does anyone know how to popup a yellow box to display such information? i am not talking about CMenu. but, i want a yellow box. how can i do that in MFC or any other third parties method?
my problem is like this,
1. when the user choose a menu item from the menu, a dialog box will be pop up
2. the dialog box contains some edit box which let the user input the value
3. after user input the value and click on the "view output" button, the dialog box will link to another window to show its output(diff input will have diff output)
i am now having problem on link the dialog box to another window which is going to show the output...
since i m new to mfc, can anyone helps me on that?? thanks..