[Setacl-devel] Re: COM and SetACL
Brought to you by:
helgeklein
From: Helge K. <hel...@ne...> - 2003-01-23 21:53:02
|
Comments below. Helge ----- Original Message ----- From: "Howard W Wortley" To: <set...@li...> Sent: Thursday, January 23, 2003 8:11 PM Subject: [Setacl-devel] COM and SetACL > >> COM control: Howard, would you like to start with the > control? > > sure > > >> When I started to work on the main class CSetACL I > implemented the interface to the outside world first - it > should be complete enough by now to be able to build a > control (and a console EXE) around it. My plan was to expose > the public funtions in the control which are all input > functions to pass data to the class. There is, of course, > the need to pass strings back to the calling > class/function/EXE, like detailed error/success/status > messages which might be needed by the caller. I used a > callback function for that purpose to be able to send any > message in realtime while the program is still working. > Example: someone uses the OCX to build a GUI around SetACL. > The user of this GUI wants to create a permission listing of > a large partition which might take a while. Via the callback > function the GUI can display in real time the permissions > that currently processed by SetACL. Is a callback function a > viable way to do it and does it work with COM? > > Hum ho. > > (1) where are the current classes there are no files to download on the > site. > Are we working from a clean sheet ? This is an easy one (file releases refer only to files that are made available to the end user - which we do not have yet): https://sourceforge.net/cvs/?group_id=69165 You can access the CVS from there with your browser. It is of course easier (and for uploading mandatory) to use the CVS client WinCVS. There are detailed descriptions of how to set up Putty (for SSH encryption) and WinCVS in sourceforge's docs section. In the CVS I have created a directory called "baseclasses" which contains my work to date. It consists of an MFC console app (for testing purposes) built around the main classes which reside in the file CSetACL.cpp. I am afraid I do not quite understand your question regarding the "clean sheet" (sorry, my native language is german). Do you mean if we start from scratch? I would say yes, the new baseclasses (see above) have nothing in common with the old SetACL, except for some of the internal logic. > (2) what kind(s) of COM objects do you want to implement. It is not possible > to have one ATL COM object which will run as a console app, a COM server and > as an ActiveX control, though of course there are common elements. > It looks to me that the wish list consist of > a. a classic ATL COM application that does pretty much the same as the > current setACL > b. a COM server that can be called from any C++ application; a version that > supports VB6 is a little different cos of the wacky VB6 strings > c. a console version of (a) > d. an OCX control for scripters / VB6 > > My suggestion is to implement (a) amd (c) first. (b) can be derived from > that fairly easily. (d) is a different bag of tricks - an ActiveX OCX > control runs in the thread of the app that invokes it remember, and VB6 > cannot do free threading except by black arts. Getting back to the COM > object generally with COM u define the interfaces and methods and then build > a UI to express them rather than developinf downwards from the UI VisualC++ > wizard style. Do u have the resource files for the dialogs anyway ? > It would help a lot if u can post the souce for the original SetACL so i can > get my head aorund your thinking, plus anything for the new one u have apart > from specs. which I have. > Maybe I was not specific enough on this one (It does not help that I am no COM expert, though I implemented an ATL COM DLL to be used from VB five years ago). I believe SetACL is and will mainly be used by systems administrators. These people need (in decreasing order): 1. a console app to be used from the command line or in scripts or batch files 2. an ActiveX DLL to be used from OLE/ActiveX enabled scripting languages like VBS or Perl There are a few actual programmers who use SetACL (one guy mailed me who develops an installation program like InstallShield) from languages like C++ who would need: 3. an ATL COM object Some more remarks on my points with regard to the callback function: To 1) The console app should be fairly straightforward much like the one used by me for testing purposes (in the CVS/baseclasses) which already uses the callback function. To 2) I had the following in mind: to build an ActiveX DLL in C++ which can be used easily from VBS / VB. I imagined the callback could be implemented nicely using (ActiveX) events which are supported in VB (I do not know about VBS). Even if VBS does _not_ have events one could still use the console version from VBS if the status strings passed via the callbacks/events are needed. Some background: the callback function is only needed to pass status strings to the caller, for example the name of the directory that is being processed. The ActiveX DLL would implement a function that is being called and passed these strings. Each time the function is called it fires an event that can be caught in VB with an event handler similar to "OnClick". To 3) This should be fairly straightforward, too. Does all this make sense? I hope I am not terribly wrong, especially with 2). I think 1) and 2) are the most important implementations for our target audience. Howard: just to be sure: when I asked if you'd like to program the COM control I really meant the ActiveX DLL from 2). |