|
you can compile the exe file with the dll static linked,you just need to open the settings of the project then change the link options to WITH MFC STATIC LINKED ,compile it ,that is ok!
|
|
|
|
|
Hi,
I am working on a little program that is running as NT service. I need to know at any given moment if somebody (user) is logged in to the system or not. It has to be running under System account, so GetUserName() API doesn't help much since it always returns SYSTEM. I know that there have to be a way to do it and it is probably very simple, but I cannot figure it out. The worst part is that I have to get it to work by Monday.
Please help!
Thank you in advance.
Kostya.
|
|
|
|
|
I had to do something similar a while back - have a service know when someone logged in. This is a total hack, and it's not elegant, but I was also in a pinch so it's what I came up with.
- The service creates a named event when it starts.
- A second program runs from the HKLM Run key. All this program does is open the named event and signal it.
- Back in the service, it sees that the event is signaled, so it knows a user just logged in.
Caveats:
- This won't tell you when the user logs out. To do this, the secondary program would need to keep running and signal the event again when it receives the WM_ENDSESSION message.
- This won't tell you if someone logs in remotely.
- The service must create the event with an empty DACL, so that the secondary program can use it. If you take the default security, the event will have the DACL of the system account, and the secondary program won't be able to access the event. (I don't have my code anymore - it's at my old job - so I can't give you the exact code for making the DACL.)
- This requires that you add an entry to the HKLM Run key. This means you'll have to have admin or power-user privs at some point during your install process.
|
|
|
|
|
I think this is on the right track.
There are articles by Paula Tomlinson in the Feb 99 and July 99 issues of Windows Developers Journal that address this issue, and some of the code samples might be very similar to what Mike describes - especially the July issue.
|
|
|
|
|
Mike and Tim,
Thank you both for your help. I've just put some final touches on my app(s) and it appears to be working fine.
Unfortunately, the article by Paula Tomlison is not accessable via web, but between MSDN, KB and some other information sources I was able to figure it out. In particular, I found CSharedMemory class by Jeff Prosise very useful (http://www.microsoft.com/msj/defaulttop.asp?page=/msj/1198/wicked/wicked1198top.htm).
Anyway, thank you again.
Kostya.
|
|
|
|
|
I need a process to be repeated so long as the mouse button is down.What condition should i test for in my loop
|
|
|
|
|
Well, you catch onLButtonDown. Do you stuff there until to get the onLButtonUp. If you tell us, what
the process is that would help alot. I know what I am telling you here is primitive, but, you have to tell
us a bit more.
sayed hashimi
|
|
|
|
|
Hello i am stupidly new to C++, and i am trying to learn by my own.
I have bought several books and all of they are good but they all lack to continue showing how to do stuff.
One of the things i need to know to understand better c++ is how do you tell c++ to move or copy a file to another directory?
What libraries i need?
ANyone can psot some code for that here?
or send it to my mail.
abravo@arcextreme.com
Thanks
|
|
|
|
|
Copying files is an OS-dependent operation, so it's not part of C++ itself. On Windows, you use the MoveFile() and CopyFile() functions to move/copy files.
|
|
|
|
|
Hi
I need to enter and get 'double'-values from CListCtrl.
At the moment, I can enter and get CString from CListCtrl.
So far, so good but CString is not double !-)
Can anybody help me or give a tip ?
bye,
Sascha
bye the way: www.codeguru.com is very good, but I need a simple solution if possible.
|
|
|
|
|
The _tcstod() family of functions convert from a string to a double.
|
|
|
|
|
VC++6. I want to have more than 16 colors in my toolbar buttons. Is it possible? How do I do it?
|
|
|
|
|
maybe http://www.codeguru.com/toolbar/index.shtml
(http://www.codeproject.com/docking/)
|
|
|
|
|
Hi,
I've been given the task of writing a program which will monitor how many pages have been printed on the printer attached to a system, and after a certain number have been printed, it will print a page of its own. The system could be a network printer server, or just a desktop system. Ideally, it should not be written as a printer dirver.
I could use some help with ideas as to how to approach this.
Thanks,
Aaron
|
|
|
|
|
Has anyone seen an example of docking windows that doesn't use MFC?
Thanks
Justin
|
|
|
|
|
Hello,
I created one dll using MFC/ATL/VC++ 6.0/NT 4.0 SP3. I can compile this dll without any error but when i register this dll using regsvr32, I get this error "DllRegisterServer in dllpath failed. Reutrn code was: 0x80040201". Is any body got this problem ?? I tried to register it on 98 and got same error. It gets register on two 98 machines though.
Any ideas?? Its not a issue of MFC version b/c I cant register on my development machine.
This dll adds extensions to IE. I am using IE 5.01 on all machines.
Thanks
Mahesh
|
|
|
|
|
You can look up the description of this error with the Error Lookup util (Start-Programs-MSVC 6-MSVC Tools-Error Lookup. That error is "An event was unable to invoke any of the subscribers." Dunno if that helps, but it's a start.
|
|
|
|
|
Hi
if it registers on some machines but not others I guess that there is at least 1 DLL missing on the failing machine.
Use the Depend tool os Visual Studio to find out what DLLs you need exactly
Kurt
|
|
|
|
|
thanks.
I read this article in MSDN and thought that I dont have latest version of comcat.dll but i installed SP5 on my machine.
|
|
|
|
|
I have an MFC MDI application that includes a CDialogBar. Inside the CDialogBar there is a CTabCtrl
that hosts a bunch of dialog boxes.
The problem that I am having is: How do I make Alt-F open the system menu when the focus is in
one of the dialogs on the CDialogBar?
I have handled the WM_MENUCHAR message in my CMainFrame class and I get notification there,
but I haven't figured out how to make the menu open normally.
Is this the right way to do this? Is there a better way to handle mnemonics in this situation?
I need to make all the mnemonics work no matter where they are, and no matter where the focus
currently is.
Any help would be greatly appreciated. Thanks!
|
|
|
|
|
I am trying to find a way of identifing a single computer system so that a piece of software cannot be transfered between computers using the same serial number. Can anyone suggest some ways of doing this without using the registry in VC++??
Cory M Hicks
|
|
|
|
|
I want to render a textured NURBS surface.
but I cann't understand below example. So I like to get a demo project.
Example:
The following functions render a textured NURBS surface with normals; the texture coordinates and normals are also described as NURBS surfaces:
gluBeginSurface(nobj);
gluNurbsSurface(nobj, . . ., GL_MAP2_TEXTURE_COORD_2);
gluNurbsSurface(nobj, . . ., GL_MAP2_NORMAL);
gluNurbsSurface(nobj, . . ., GL_MAP2_VERTEX_4);
gluEndSurface(nobj);
|
|
|
|
|
I'm currently trying to speed up my app by identifying code bottlenecks. The problem I find is that when some disk accesses have taken place they are now cached by Windows. Anyone know how I could empty / wipe out the disk cache please?
Thanks
|
|
|
|
|
Do you mean you want to test or speed up the process launch and you find your process is already cached in the windows cache?
FlushInstructionCache -> Process instruction cache is flushed (but not the data)
FlushFileBuffers -> Call this for every open file handle and all writes are performed. (purges write cache)
use FILE_FLAG_WRITE_THROUGH in the file create or open call.
(disables write caching)
more interesting than the above blabla is
http://www.sysinternals.com/cacheset.htm
|
|
|
|
|
hi there
does MSHFlexGrid works under Visual C++?
the Bands facilities is available?
how can i build an hierarhical recordset?
how can i substitute, in Visual C++ 6.0, DataEnvironment object from Visual Interdev or Visual Basic?
thanks in advance for your help
|
|
|
|