|
check whether the focus rectangle is drawn somewhere explicitly in the code. BTW someone did ask about getting the focus rectangle on the button yesterday but he was not able to get it... may be you to can exchange ideas..
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Hi All,
I am currently making a VC++(MFC) app which will act as additional login screen. It will come up when user logs in to Windows XP machine and user has to use a username/pwd combination which will be given to him.
The business idea is for a Cyber Cafe where users login with their account details, and they can browse till they have "browsing time" in their accounts. Once they logout or their "browse time" is over, the login screen again appears facilitating the next user to login with his credentials.
I have created the MFC login screen(starting it as a windows service) and when user logs in successfully, I am placing the MFC program in the systray where user can login and see his remaining time, etc.
What I wanted from community is couple of design suggestions -
Q1. Is the idea of placing the app in the systray appropriate ? Can you advise some other approach which could come handy ?
Q2. Also, I am looking forward to have the authentication being done via a machine(a server) - which has all authentication info as well as browse time information stored in it. I was looking fwd to use Winsock API for this purpose. The client application(installed on all machines) will contact server app in following cases -
1) while logging in - to get authentication info, browse time info.
2) while logging out - to record time spent in browsing.
Is this network design appropriate - using client/server architecture and winsock API or can their be any improvements in the design ?
Thanks for the help!
Regards
Cage
|
|
|
|
|
I wanna make cursor IDC_HAND when mouse hover in my CMyButton(derived from CButton).
In CMyButton I deal with ON_WM_MOUSEMOVE message, see code below:
void CMyButton::OnMouseMove(UINT nFlags, CPoint point)
{
ASSERT(m_hWnd);
TRACKMOUSEEVENT tevent;
tevent.cbSize = sizeof(tevent);
tevent.dwHoverTime = 0;
tevent.hwndTrack = m_hWnd;
tevent.dwFlags = TME_LEAVE;
_TrackMouseEvent(&tevent);
SetCursor(LoadCursor(NULL, IDC_HAND));
CButton::OnMouseMove(nFlags, point);
if (FALSE == m_bHovered)
{
m_bHovered = TRUE;
this->Invalidate(TRUE);
}
}
Hope I state my problem clearly!
modified on Tuesday, December 2, 2008 1:43 AM
|
|
|
|
|
Did you try handling WM_SETCURSOR? This is much easier than trying to deal with mouse messages.
|
|
|
|
|
Thanks. It worked!
I vote you 5!^_^
|
|
|
|
|
Also, I think you need WINVER to be greater than or equal to 0x0500 to use IDC_HAND
|
|
|
|
|
I recently migrated from VS2003 to VC2008. I have only converted a few projects so far so my "sample size" is small. My problem is that dialog based MFC projects lose the 3D look that they had when compiled with VS2003. In VS2003 and earlier, 3D "just happened". You got it by default. Something seems to have changed in VS2008 and I can't work out what...
The problem can't be due to a quirk in my projects because it even happens with the most trivial project possible. Create a dialog based MFC app in VS2003, leave all the defaults, add a few controls, build and run. You get the 3D look. Then convert the project to VS2008. All the controls have gone flat. The problem is not a result of the conversion because projects initially built under VS2008 have the same behaviour.
Still, there must be a way to build for 3D because one of my converted projects has kept its 3D look. Also, among the sample apps that come with VS2008, there is at least one that is MFC dialog based and it too has a 3D look.
I've looked at dialog settings, compiler options, linker options, includes files, the rc file, but I can't work out what the difference is between apps that have and don't have the 3D look. Thanks for any clues...
|
|
|
|
|
Is it because VS2008 automatically applies a manifest to use Windows Themes for common controls, whereas VS 2003 doesn't?
|
|
|
|
|
Thanks for the hint. It's indeed something to do with the manifest. As long as I have the dependency on Microsoft.Windows.Common-Controls V6 in the manifest, I loose the 3D look under WinXP (not under Vista though). I throw it out and things are back to normal. Am I missing something?
|
|
|
|
|
Don't think so - the manifest is there to enable the Windows XP/Vista themes. It's possible that under Vista, the installed version of the common controls doesn't match the one in the manifest, so it reverts to the old, 3D look. I don't really know - my main distribution platform is Windows 2000
|
|
|
|
|
Whenever I create an exe or DLL with debugging info, the full path of the pdb file (ie. the linker output path) is placed in the exe or DLL. I have seen some exe and DLL's where only the pdb filename (without path) is used instead.
How can I do this ?
modified on Saturday, December 6, 2008 6:40 PM
|
|
|
|
|
I managed to find out myself. For anyone that's interested, there's an undocumented linker switch /pdbpath:none which will remove the full path but keep the pdb file name.
|
|
|
|
|
Can anyone recomend a decompiler that can convert c++ dll's to C# code?
Thanks!
|
|
|
|
|
How the hell is that a decompiler ?
What you want does not exist, unless the dll is C++/CLI.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
You need a tool to convert C++ to C#, but be aware that no tool can convert C++ to C# completely.
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
VB & C# to Java Converter
Java to VB & C# Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB, C#, or Java to C++/CLI
|
|
|
|
|
[Neo] There's no spoon decompiler. [/Neo]
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Well, I'm not into C++ at all but I have a project written in VC++ and I need to convert it to C#. Isn't it true that when it's compiled it written as a MSIL. The MSIL can then be decompiled back to any Microsoft language?
|
|
|
|
|
xkrja wrote: Isn't it true that when it's compiled it written as a MSIL. The MSIL can then be decompiled back to any Microsoft language?
How does it matter? Even if that was true, that would hold good only for .NET languages. C++ is a completely different language for that matter. Or are you talking about CLI/C++?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
How do I know? The source code is in a Visual studio solution. Does that mean it's C++/CLI?
|
|
|
|
|
Could anybody be kind enough to tell me how to set the width
and height of a window? at start up and during execution of
a program.
And also, maximizing the width, height
and setting the posistion, please
Thanks V Much
Simon
|
|
|
|
|
Look at SetWindowPos , is that what you want?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Yes, please.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
GDI+ MeasureString and MeasureCharacterRanges work nice with small strings. An occasional page fault and some additional memory usage but nothing to be alarmed about.
When I push the limits by using large strings and the above two functions numerous times to perform various measurements, I get my fair share of page faults and a reasonable increase in memory usage. Nothing that I wouldn't expect while increasing the demands on the GDI+ library.
However, once I go back to being reasonable and only working with small strings again, the excessive amount of page faults continue to occur. It's like GDI+ can't get itself back together once the memory requirements are reduced.
I've tried "GdiPlusShutdown" and "GdiPlusStartup" just to see if that would get GDI+ to reset itself but the excessive page faulting continues after that. (I didn't expect this to work or be a reasonable solution anyway but it was worth trying to gain more information on the problem)
Has anyone noticed this excessive page faulting (sometimes I can get it up into the 1,000's per refresh cycle) that continues after GDI+ workloads are reduced to simple single character measurements again? Does anyone know how to get GDI+ page faults back down again?
|
|
|
|
|
Very interesting, can you post a snippit that causes a page fault?
Thanks,
-David Delaune
|
|
|
|