|
I have an ATL database program which I *think* I understand how to create a connection point for, but I can't find any examples for creating a sink in MFC from an ATL server. Could someone point me in the direction of a tutorial ? It seems to me too complex to explain in a post, although if you feel you can, I'll appreciate that also. I have a book that shows me how to use a connection point from VB or ATL, but not MFC, and I tried to MFCise the ATL exmaple to no avail.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
|
Fantastic - thank you so much. I've not written a line of useful code tonight, although between what I found to read, and the article you linked me to ( plus the MSDN CD I'll bring home from work tomorrow night !! ), I reckon I'll make up for it tomorrow night
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
1) I'm using CopyFile, which does what I need, but it does not copy the security attributes of the file (owner information particularly). I've rooted around in the documentation, but cannot seem to find how I can set the file security attributes of the copied file to match source file.
2) Also, I'd like to know how to set a file to 'my' owner name when I've copied it to a local machine. (Hopefully Q:1 will answer Q:2)
I'm hoping there is something easy and obvious I've overlooked. If you can point me to the right name I'd appreciate it.
Thanks in advance!
--Mark Terrano
www.ensemblestudios.com
(Creators of the Age of Empires series)
|
|
|
|
|
I believe SHFileOperation copies security attributes, unless you specify FOF_NOCOPYSECURITYATTRIBS flag. If you don't want a progress dialog, use FOF_SILENT.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi !,
Is it possible to get the content of a RichEditCtrl in a CString ( with all the formatting escape sequences..), and paste it then to a word table through automation.
Thanks, Bye !
Braulio
|
|
|
|
|
Is there a way to find out how long the system was idle (time since last keyboard or mouse action)?
Any help appreciated.
|
|
|
|
|
On Win2000 you can use GetLastInputInfo. On other systems you'll need to create a global keyboard/mouse hooks. Have a look at Feb'2000 issue of Microsoft Systems Journal, C++ Q&A column. It should be in the 'Periodicals' section of your VC++ help, if it's not there, go to msdn.microsoft.com, then MSDN Magazine.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hello,
I need to create the following structure, I am sure that STL is the best to use, however, I am confused on how I should do it. Maybe someone could offer suggeststions.
My structure will look like this:
CMyClass
|
|
CMyClass
| |
| ----->CMyClass
| | |
| | ------->CMyClass
| | . .
| | . .
| | . .
| ----->CMyClass
| .
| .
| .
.
.
.
Any suggestions on how I could use STL in the best way for this?
Thanks!
Jeremy.
"Hey man, Taliban, Tali me Banana."
|
|
|
|
|
Are you going to implement a tree? There's no standard tree container (map and set use trees, but this is an implementation detail). I think the easiest way is to add a vector<CMyClass *> to CMyClass - this vector will hold pointers to children objects. You can also add a parent pointer, which will be NULL in the root object.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I have an application on iPAQ that needs to communicate to a device through the comm port. I use GetCommState(...) to get the DCB values and then modify its baudrate, bytesize, stopbit and parity values. Later when i try to apply these changes using SetCommState(...), it just hangs there.
When i switch off the device, it returns with no error. Does anyone know what is causing this problem?? Thanks.
Wee Giap
|
|
|
|
|
Hi
As far as I know it is possible for other applications to
get a handle of the window from my application (e.g.: FindWindow), and then it is possible for this application to write into my window. Does anyone know a method to prevent this?
Thanks in advance
|
|
|
|
|
It's not possible to hide a HWND. You may try to make FindWindow harder to use - for example, by generating class name randomly each time your program starts, but this doesn't give you 100% protection - it's possible to iterate over all windows in the system.
BTW: What are you afraid of?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I'm writing a high security digital signature ActiveX control. And I thought it would be bad if another program writes into my window and then the signer thinks he signs something different then he really signs.
I try know with Win32 Hooks. I hope this helps.
|
|
|
|
|
What if another program displays its own window looking like yours? Assuming that users's machine is infected by worm or virus targeting your ActiveX, there's not much you can do.
I'd keep a checksum (or even a verbatim copy) of displayed text somewhere. Even if this program writes its own text, you'd be able to detect data corruption.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
The text is already secured through a hash value, so it can't be corrupted. But this other program is able to write into my window and the user sees something different than he signs!
This other thing, with the virus looking like my ActiveX is a problem too. I thought I can do something in correspondence with the server programm to which the signed file is sended.
Do you have any ideas?
Martin
|
|
|
|
|
Hello NitramR,
Try this idea. I haven't checked it out, but it should work. There are a few different ways of acheiving the end result.
1a) System wide hook that hooks each process. This loads your spy DLL into their process when their process starts.
1b) Use CreateRemoteThread() to inject your DLL into the running process. You'll need a thread to watch for new processes and then inject your DLL into each new process. This is more complicated than a system wide hook, but acheives the same result.
2) Your DLL will then hook the Kernel/User/GDI/whatever DLL functions that you think are appropriate. In this case you'll want to be hooking User32 functions related to finding windows.
In your hooks you'll let the function execute then examine the return value before returning. If the value indicates your window you'll overwrite the value to indicate failure.
3) Their program will search for the window and fail.
There is info on hooking technique elsewhere on this site and also in MSJ/MSDN website/magazine.
Caveats.
--------
If they know which DLL you are loading they may be able to write code to hook LoadLibrary and LoadLibraryEx and prevent the library from loading dy diverting the function call and returning a library not loaded return code. Not hard to do. If they get their hooks in before you get your hooks in, you have lost the battle.
Cheers
Stephen Kellett
--
C++/Java/Win NT/Unix variants
Memory leaks/corruptions/performance/system problems. UK based.
Problems with RSI/WRULD? Contact me for advice.
|
|
|
|
|
Ok guys
I did some research on hooks and I'm know convinced that there is know solution for this problem.
The only thing to do, in my opinion, is to warn the user and give him the responsibility to keep his computer free of viruses and stuff like that.
Thanks anyway.
|
|
|
|
|
There is a mistake in the previous message. Of course I meant: "I'm NOW convinced that there is NO solution for this problem."
SPEED KILLS
|
|
|
|
|
I created regular dll by the wizard.
I have a dialog class in it and I writed export global function so:
/********************************************************/
extern "C" __declspec(dllexport) int func()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
MyDialog dlg;
dlg.DoModal();
return dlg.num;
}
/********************************************************/
But when I test it with client program it dont show me the dialog.
It is only return me the return value.
WHY ???
What can I do ??? PLEASE HELP !!!!
|
|
|
|
|
So are you Gil, or are you Lili?
|
|
|
|
|
Hi,
How do I get flat scrollbars in a CTreeCtrl?
For at CListCtrl it's done by using SetExtendedStyle(), but I can't find any similiar member function in CTreeCtrl.
Roar
|
|
|
|
|
I'm afraid you can't do that. There's no TVS_xxx style for setting flat scrollbars. Even if you use InitializeFlatSB, FlatSB_ShowScrollBar and FlatSB_SetScrollProp with CTreeCtrl's HWND, all you'll get will be flat scrollbar that doesn't scroll the window contents.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
??
I would really like to recursively call the OnPrint function but everytime I try, it's catastrophically not working. I am doing something wrong or is this just not possible?
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
Recursively calling OnPrint is rare and most likely not needed. Write your own Print() method and call it. Otherwise, study the OnPrint() method flow-you can completely replace it without any problem if it does not meet your needs.
The framework calls the OnPrint() after a lot of preparations.
Best regards,
Paul.
Paul Selormey, Bsc (Elect Eng), MSc (Mobile Communication) is currently Windows open source developer in Japan, and open for programming contract anywhere!
|
|
|
|