|
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)
<br />
#ifndef WINVER <br />
#define WINVER 0x0400<br />
#endif<br />
<br />
#ifndef _WIN32_WINNT<br />
#define _WIN32_WINNT 0x0400<br />
#endif <br />
<br />
#ifndef _WIN32_WINDOWS<br />
#define _WIN32_WINDOWS 0x0410 <br />
#endif<br />
<br />
#ifndef _WIN32_IE<br />
#define _WIN32_IE 0x0400<br />
#endif<br />
|
|
|
|
|
Thanks again. True I didn't set the version macros.I compiled the code after including the _WIN32_WINNT macro and MB_SERVICE_NOTIFICATION works fine.
~ Vimal
|
|
|
|
|
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.
Praveen
|
|
|
|
|
Hi.
I'm still running Micr. Visual Studio 5.0 Entreprise Edition, but i don't get the member list.
for example
CWinApp* pApp = AfxGetApp();
pApp->
then you should see the member list of pApp, but i never see it. I've deleted the .ncb file & reloaded the workspace didn't work neither. Anyone knows if there is a patch out to fix this bug?
Would appreciate it much.
Greetings
Jens
|
|
|
|
|
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.
Reply me soon
|
|
|
|
|
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:
www.pcausa.com
http://www.ntkernel.com/products/winpkfilter.shtml
...
|
|
|
|
|
I got an message saying that module User.exe in Frame caused an General protection falut at 0007:0000b35e.How to debug this problem.This ocured once in Win2000 and once in WinNT
|
|
|
|
|
Hi,
how can I get all the user names and machine numbers those are in a domain by selecting the domain names??can anybody give me some sample code?thanks in advance....
BR
Thomas
ThomasKennedyBose
|
|
|
|
|
Hi,
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.
Praveen
|
|
|
|
|
|
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.
Thanks again!
Praveen
|
|
|
|
|
I want to convert a text file, which is encoded in Unicode, into a Ascii one. The text is a mixture of Chinese characters and English. How can I do that?
|
|
|
|
|
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).
Dave
|
|
|
|
|
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...
class RCanalTree : public CTreeCtrl<br />
{<br />
public:<br />
RCanalTree(CCanalManager *pCanalManager=NULL);<br />
<br />
public:<br />
const CCanalManager* GetCanalManagerPointer() { return m_pCanalManager; }<br />
bool SetCanalManagerPointer(CCanalManager *pCanalManager);<br />
<br />
public:<br />
static int m_icons[]={ <br />
IDI_ICON_SYSTEM, <br />
IDI_ICON_CANAL, <br />
IDI_ICON_SITE, <br />
IDI_ICON_WELL, <br />
IDI_ICON_TURNOUT, <br />
IDI_ICON_PUMP, <br />
0
};<br />
virtual void Populate();<br />
int DeleteChildren(HTREEITEM hParent);<br />
<br />
HTREEITEM GetDepthNextItem(HTREEITEM hItem);<br />
HTREEITEM FindItem(const char *name, int dwData);<br />
HTREEITEM InsertChildItem(const char *name, int dImage, HTREEITEM hParent, DWORD data, int iCheck=-1, bool bCondition=true);<br />
<br />
<br />
public:<br />
bool InitializeImageList();<br />
<br />
int GetImageIndexFor(int idOfIcon);<br />
bool DeleteChildItem(HTREEITEM hParent, const char* name, DWORD data);<br />
virtual void UpdateImages();<br />
virtual EnumForOnCheck OnCheck(HTREEITEM hItem, bool bNowChecked);<br />
int GetIconIndex(int idOfIcon);<br />
virtual ~RCanalTree();<br />
<br />
protected:<br />
bool IsScheduleLocked();<br />
CCanalManager* m_pCanalManager;<br />
CImageList *pImageList;<br />
<br />
<br />
<br />
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);<br />
<br />
DECLARE_MESSAGE_MAP()<br />
};
baaaah!
|
|
|
|
|
Read up on how to use static member variables. Initialize it outside of the declaration like this:
class RCanalTree : public CTreeCtrl
{
...
static int m_icons[];
...
};
...
int RCanalTree::m_icons[]={
IDI_ICON_SYSTEM,
IDI_ICON_CANAL,
IDI_ICON_SITE,
IDI_ICON_WELL,
IDI_ICON_TURNOUT,
IDI_ICON_PUMP,
0
};
|
|
|
|
|
dear all,
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?
thanks,
jim
|
|
|
|
|
Something like this[^] maybe?
Mike Mullikin
Times change, politicians don't. - Anna-Jayne Metcalfe - Soapbox 10/03/2003
|
|
|
|
|
|
I have a CEdit controll(with styles ES_MULTILINE | WS_VSCROLL) which has many lines of text in it, how can I scroll it to the bottom-most line? Thanks.
|
|
|
|
|
With this call: pMyEdit->SetSel (INT_MAX, INT_MAX) .
|
|
|
|
|
|
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..
|
|
|
|
|
Hi,
I want to custom draw a tree. The DrawItem only works for clistbox, clistctrl, buttons... Is there any method I can use for CTreeCtrl?
Thanks
-----
We are what we repeatedly do. Excellence, then, is not an act, but a habit.
|
|
|
|
|
Florin Ochiana wrote:
I want to custom draw a tree. The DrawItem only works for clistbox, clistctrl, buttons... Is there any method I can use for CTreeCtrl?
Have you looked at NM_CUSTOMDRAW. This may let you do what you want.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
This should be a simple one for everyone:
I have written a simple client server app to read in a string and send it across. I have implemented this with standard CSockets but want to port it in a simple manner to use CAsyncSockets. I am not familiar with the sequence of events that occur with these-I only know how the CSockets work:
Client<br />
create<br />
connect(IP,Port)<br />
CArchive.write(...)<br />
<br />
Server<br />
create(Port)<br />
listen<br />
CArchive.read(...)<br />
I know that the asyncs. don't use archives and that the read and write mechanisms are different; but the more serious problem that I have is that I have no idea how things are meant to be ordered. I have read a lot about overloading member functions and the like but am thoroughly confused. Anyone able to offer some hints? I have read and tried to disassemble the code for the AsyncProxySocket example that's on here somewhere and ended up bashing my head against the wall.
There doesn't seem to be a great deal in the msdn about them.
Thanks in advance
|
|
|
|