|
Thanks for your reply Scott !
Looks like I'll have to bite the bullet and order !
It's not the money that bothers me, just the hassal factor and the time it takes !
Rgds,
Steve
|
|
|
|
|
I have a dialog with a tabctrl. Every tab is made up of a dialog and controls that are placed on the dialog dynamically. Somehow when I select the tab (inner dialog) the main dialog looses the focus and also my buttons do not receive the BN_CLICKED message. Anyone got a clue as why this might be?
|
|
|
|
|
Make sure your inner dialogs have the WS_CHILD style set. They need to be children of the main dialog (i.e. peers of the tab control). To properly give focus to the selected inner dialog's controls, do this:
pWndCurrentTab->ShowWindow (SW_SHOW);
pWndCurrentTab->Invalidate();
pWndCurrentTab->UpdateWindow();
pWndCurrentTab->BringWindowToTop();
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Thanx for your reply. But my controls do have the WS_CHILD style set. Also I do not have problems with listctrl's. But maybe the problems lies deeper. My application consists of a view with a tabctrl and there several dll's that put the controls on this tabctrl (I did think this up myself). In case of the buttons I do not get the BN_CLICKED message and I did try once to overwrite the OnCommand of my tabactrl and that seems to (kinda) work, but then I still have the focus problem + when I try to add for example an ownerdraw button I do not get the WM_DRAWITEM message either. Still any thoughts
|
|
|
|
|
Hi all,
How to show a message box from a windows service ?
Any tips, pointers, links ?
Thanks in advance
~ Vimal
|
|
|
|
|
add MB_SERVICE_NOTIFICATION flag in the MessageBox function
|
|
|
|
|
Thanks.
Though the MB_SERVICE_NOTIFICATION flag is specified in the MSDN, the complier gives an "undeclared identifier" error on my windows 2000 machine . But MB_DEFAULT_DESKTOP_ONLY does the trick.
~ Vimal
|
|
|
|
|
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
|
|
|
|
|