The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: baltoro on August 30, 2011, 08:36:30 PM

Title: Programmatic Access to the Recycle Bin
Post by: baltoro on August 30, 2011, 08:36:30 PM
This might be a subject of interest to some of you MASM Forum members,...
Raymond Chen has a blog entry entitled: How Can I Get Information About the Items in the Recycle Bin? (http://blogs.msdn.com/b/oldnewthing/archive/2011/08/30/10202076.aspx)
Title: Re: Programmatic Access to the Recycle Bin
Post by: baltoro on August 31, 2011, 04:19:06 PM
...Seeing as MASM programmers are so fascinated with this subject,...I thought I should post part two,...
Modernizing Our Simple Program That Retrieves Information About the Items in the Recycle Bin (http://blogs.msdn.com/b/oldnewthing/archive/2011/08/31/10203215.aspx)

And, Raymond Chen has posted a third blog entry about items in the Recycle Bin,...so, I am adding this link for completeness:   
Invoking Commands on Items in the Recycle Bin (http://blogs.msdn.com/b/oldnewthing/archive/2011/09/01/10204404.aspx)
Title: Re: Programmatic Access to the Recycle Bin
Post by: Vortex on August 31, 2011, 08:21:55 PM
Hi baltoro,

Thanks for the links. Reading the reader comments :

QuoteCOM is not a friendly technology to program.

I agree. COM is very complicated to learn and use.

QuoteC++ cannot be called by non C++ code cleanly.

Now, is C++ a "clean" language?
Title: Re: Programmatic Access to the Recycle Bin
Post by: baltoro on August 31, 2011, 08:55:08 PM
VORTEX,   
Interesting comments. COM is especially difficult to do correctly in assembly language. In fact, I didn't even think it was possible until I visited Japheth's Website (http://www.japheth.de/). This page: COM and Assembly (http://www.japheth.de/COMnASM.html) has an enormous amount of information (source code examples).
I learned COM by reading Don Box's book: "Essential COM"
But, in all honesty, I use Visual Studio to write COM (which I do very infrequently),...mainly because of the MIDL Compiler (http://msdn.microsoft.com/en-us/library/aa367300(v=vs.85).aspx)
Title: Re: Programmatic Access to the Recycle Bin
Post by: Vortex on August 31, 2011, 09:00:33 PM
Hi baltoro,

Japheth is the expert of COM programming in assembly. Personnaly, I prefer to keep things related to COM simple as possible. COM is not easy to read and maintain. Maybe I am going off topic : A lot of people can create extremely complicated code but writing readable,clean and understable code is another art. I don't guess that COM can be a part of this.
Title: Re: Programmatic Access to the Recycle Bin
Post by: baltoro on August 31, 2011, 09:08:14 PM
Right. I think I've seen a few COM examples posted here by EDGAR, for instance:

I have to suspect that you EDGAR, and Japheth are the only people in the galaxy that write COM in assembly,... :eek
Title: Re: Programmatic Access to the Recycle Bin
Post by: Vortex on August 31, 2011, 09:12:58 PM
Quote from: baltoro on August 31, 2011, 09:08:14 PM
I have to suspect that you EDGAR, and Japheth are the only people in the galaxy that write COM in assembly,... :eek

Hi baltoro,

To tell the truth, my COM knowledge is very modest and my COM examples are very elementary and simple. Edgar has nice COM examples and I appreciated his efforts. Japheth and Edgar are presenting good work related to COM.
Title: Re: Programmatic Access to the Recycle Bin
Post by: baltoro on August 31, 2011, 09:21:12 PM
As regards COM,...it's not fun to learn. I had to force myself to become acquainted with it, bacause I read somewhere that an awful lot of the components that the Windows System commonly uses are COM. If you examine the OLE/COM Object Viewer (http://msdn.microsoft.com/en-us/library/d0kh9f4c.aspx), you'll see this is true.
Title: Re: Programmatic Access to the Recycle Bin
Post by: Vortex on August 31, 2011, 09:29:54 PM
Yes,  I know COM is allmost everywhere in Windows. I don't understand why humanity is inclined to make things more and more complicated. COM is not an exception here.

From Bogdan Ontanu's web site :

Quote"Any intelligent fool can make things bigger, more complex, and more violent.
It takes a touch of genius -- and a lot of courage -- to move in the opposite direction."
- Albert Einstein

A designer knows he has achieved perfection
not when there is nothing left to add,
but when there is nothing left to take away.
- Antoine de Saint Exupery
Title: Re: Programmatic Access to the Recycle Bin
Post by: baltoro on August 31, 2011, 09:38:56 PM
 :bg ...Ha,...Ha,... :bg
Yeah,...if I ever see Don Box,...I'll be sure to back over him with my car,... :eek

I think what makes COM difficult is that it is designed to be remoted. And, the security it has to implement to do this is buried deep within just a few COM interfaces. It's BIG weakness, I think is that all the necessary configuration information resides in the Registry, where any idiot can find it.
Don't tell HUTCH this,...but, I think if I was actually a hacker/evildoer,...I'd be using COM for just about everything,... :eek
Title: Re: Programmatic Access to the Recycle Bin
Post by: Vortex on August 31, 2011, 09:59:56 PM
Quote from: baltoro on August 31, 2011, 09:38:56 PM
I think is that all the necessary configuration information resides in the Registry

The registry is another complicated database too. Instead, why not to create and use simple and readable configuration files? Just have a look at Vista, 7 and Server 2008 : they introduced a registry based information store to replace the simple boot.ini file...
Title: Re: Programmatic Access to the Recycle Bin
Post by: redskull on August 31, 2011, 11:11:52 PM
I never really had too much problem with COM, but that's probably coming from a C++ background first.  I think it makes perfect, logical sense if you look at as a way to write truly object-oriented code; of course, if you don't care to write object oriented code in the first place, then it will no doubt seem overly architectured and complex.  My only real beef with COM is the threading model is truly heinous, it being sort of 'tacked on' after windows went 32-bits.  Other than that, it all seems pretty straightforward, given the goals. 

IMHO, some of the stuff you can do with COM is really, truly amazing

-r
Title: Re: Programmatic Access to the Recycle Bin
Post by: Geryon on September 01, 2011, 07:45:18 AM
COM is just a system wide class factory pattern.
If your language don't have "->" operator, it would be frustrating due to "pointer of pointer of pointer of ....." thing.
The main purpose of COM is prevent conflict of different version of same dll.
Title: Re: Programmatic Access to the Recycle Bin
Post by: dedndave on September 01, 2011, 03:15:06 PM
Quote from: Geryon on September 01, 2011, 07:45:18 AM
COM is just a system wide class factory pattern.

that's easy for you to say   :P

the first thing i noticed when i started reading the docs was that i saw about 20 new buzz-words in the first paragraph   :lol
Title: Re: Programmatic Access to the Recycle Bin
Post by: baltoro on September 01, 2011, 08:53:08 PM
Yeah,...funny,... :eek
That's one of the most annoying aspects of learning COM initially,...getting used to the clinical language that authors use to describe the COM interface archetecture. And,...what most authors don't make clear (and. the MSDN docs are notorious for this...) is why the essential features of COM exist in the first place. That's why I always recommend Don Box's book. He starts off describing serious problems in the evolution of C++, in particular, the DLL Hell (http://en.wikipedia.org/wiki/DLL_Hell) problem. He provides clear examples demonstrating in detail, how and why it occurs,...and, then, suggests a better way to define and implement a class object, so that it is essentially impossible to crash your program by importing a DLL function that is incompatible with your local definition (in the binary sense).
...So,...COM can be thought of as a better C++,...