I have a atl com service that need to do something on windows log off and lock event.
I created a winlogon dll to sendmessage to service for the above events.
STA Service is not getting those messages.
How to detect logoff and lock event from atl COM Service
Note: Because the notification Dll gets loaded by Winlogon and because Winlogon is running under the local System account (your COM Service probably isn't?), you can't use the SendMessage API as a means of IPC communication between them. Try memory mapped files or named pipes instead. Also, set the Impersonate[^] reg-value of your notification Dll to 1 or modify the Dacl of your memory mapped file/named pipe appropriately (check this: A NotQuiteNullDacl Class[^]).
PS: This were just presumptions from the top of my head -> for the exact behavior/terminology and implementation check the MSDN documentation.
I am using the CSocket class with all the CSocketFile and CArchive stuff (mainly based on the MFC samples). The problem now is, that, after some time, the socket won't receive anything (well, it receives it, but it still stops at some point).
When receiving the data with CAsyncSocket::Receive, it won't stop, so I guess it's a problem with either CSocket or CArchive/CSocketFile. The funny thing is that the MFC samples have the same problem... and it's not just my computer
So is there any known solution to this or do I have to go a different direction without archives?
And yes, I used IsBufferEmpty()...
I think it would be probably easier to write your own control for it. If you use the rich text box, you'll be spending lots of code to restrict it rather than extending it. After all, a rich text edit box is text editing control, while a "console" is a line-editing tool combined with static output.
-- Sancte Míchael Archángele, defénde nos in proélio contra nequítiam et
insídias diáboli esto præsídium. Imperet illi Deus, súpplices deprecámur:
tuque, princeps milítiæ cæléstis, Sátanam aliósque spíritus malígnos, qui
ad perditiónem animárum pervagántur in mundo, divína virtúte,
In inférnum detrude. Amen.
I wrote a c++ dll containing a CWnd, which is created an displayed when the dll is loaded by an application. When I use the dll with a c++ app or a VB app everything works fine, window is created and displayed as planned, but when i load the dll from a java application the window seems not to be created correctly.
i recommand to use statically linked regular DLL.If you choose statically linked DLL it includes copy all the needed MFC library code with in your DLL. So, it size is more. If you choose dynamic linked library the memory space is less compare then static linked library regular DLL. But, you will use proper DLL version in the target machine.
As you will all surely know C# has this cool interface where you can
put XML into the comment blocks of your code, and have it automatically
generated as a web page of comments (especially using a tool like NDoc.)
This gives you a nice class documentation web page heirarchy.
I have a bunch of code that uses DOxygen style coding for inserting
similar stuff into my C++ code, however, I want to use the same techinques
in C++ that I do in C#. Specifically, I want to be able to type in the
comments directly when I use the class view to insert code, and I want
to be able to use NDoc to generate the pages.
I know about DOxygen, in fact I use it, however, I want to get on the
same page as C# with my C++ code for consistency and simplicity (and
by way of the fact that surely future versions of Visual Studio will
head that direction.)
I'm trying to implement the ability to drag and drop a file onto a tree control, BUT it would be great if you could only drag onto certain objects. Is there a way to allow the user to drag a file onto the tree control and depending on what type of object the user drags the file over, drag and drop is allowed or disallowed?
It would be flimsy for them to have to select a tree item then drag and drop, much nicer if you simply drag the file to the object you want to add it to and if its allowed, it works!
When your IDropTarget::DragOver() method is called, you get a POINTL holding the cursor location. Convert that from screen coords to client coords (relative to the tree) then use TVM_HITTEST to find out which tree item that point is over.
Once you get that, you can decide whether to allow the drop over that item. Return DROPEFFECT_NONE to not allow it, or DROPEFFECT_MOVE/COPY to allow it.
I am trying to create a new dialog with a text box that accepts string values from my main dialog's program. In other words, once a button is pushed on my main dialog, a new dialog appears with a text box - i would like to send strings from my main dialog program to the new dialog's text box. I am using CCancelBox dlg; and dlg.DoModal(); to bring up my new dialog once the button is pushed, but I don’t know how to link the text box to my main dialog .cpp program. Thanks a million in advance.
str1 and str2 passed are strings but represent numbers. Is there a way i can do a type checking to find if its a valid number .
I am looking for something like isNumber() functionality as i need to make sure that what is passed is surely a valid integer and not a garbage string which might have catastrophic results !