How to change class of a file object ("Become" page functionality)? - OS2

This is a discussion on How to change class of a file object ("Become" page functionality)? - OS2 ; Hi, all file objects (WPDataFile or derived) have a "Become" page (or "Object class" ?) where you can change their class to a selection of other compatible classes where "compatible classes" do not necessarily have to be anchestors of the ...

+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 20 of 35

Thread: How to change class of a file object ("Become" page functionality)?

  1. How to change class of a file object ("Become" page functionality)?

    Hi,

    all file objects (WPDataFile or derived) have a "Become" page (or
    "Object class" ?) where you can change their class to a selection of
    other compatible classes where "compatible classes" do not necessarily
    have to be anchestors of the current class (they can also be children of
    anchestors, therefore can be siblings of parent or grandparent etc.
    classes) but I guess they are restricted to be at least of WPFileSystem
    or derived classses.
    The user interface is there but I cannot see what SOM method supports
    that. Anyone have any insight what SOM method supports this class change
    or any idea how I can debug what SOM method is called on that user action ?
    I have found method somCastObjCls (defined for SOMClass class) which
    maybe does the right thing. However it is not documented and therefore
    the parameters not defined (also not in the interface repository) so it
    will be trial and error to find the right parameters ...

    Maybe the interface is: BOOL somCastObjCls(SOMClass *receiver,SOMObject
    *targetObj,somId *targetClass);

    Any help or hints ?

    Lars

  2. Re: How to change class of a file object ("Become" page functionality) ?

    On Mon, 23 Jun 2008 00:01:23 +0200, Lars Erdmann wrote:

    > all file objects (WPDataFile or derived) have a "Become" page (or
    > "Object class" ?) where you can change their class to a selection of
    > other compatible classes where "compatible classes" do not necessarily
    > have to be anchestors of the current class (they can also be children of
    > anchestors, therefore can be siblings of parent or grandparent etc.
    > classes) but I guess they are restricted to be at least of WPFileSystem
    > or derived classses.
    > The user interface is there but I cannot see what SOM method supports
    > that. Anyone have any insight what SOM method supports this class change
    > or any idea how I can debug what SOM method is called on that user action ?
    > I have found method somCastObjCls (defined for SOMClass class) which
    > maybe does the right thing.


    Nobody knows, at least outside of IBM, and they aren't saying anything.
    I suspect there is no method. If there was it would be a wpSomething()
    method.

  3. Re: How to change class of a file object ("Become" page functionality) ?

    On Sun, 22 Jun 2008 23:23:14 UTC, Paul Ratcliffe wrote:
    > On Mon, 23 Jun 2008 00:01:23 +0200, Lars Erdmann wrote:
    >
    > > all file objects (WPDataFile or derived) have a "Become" page (or
    > > "Object class" ?) where you can change their class to a selection of
    > > other compatible classes where "compatible classes" do not necessarily
    > > have to be anchestors of the current class (they can also be children of
    > > anchestors, therefore can be siblings of parent or grandparent etc.
    > > classes) but I guess they are restricted to be at least of WPFileSystem
    > > or derived classses.
    > > The user interface is there but I cannot see what SOM method supports
    > > that. Anyone have any insight what SOM method supports this class change
    > > or any idea how I can debug what SOM method is called on that user action ?
    > > I have found method somCastObjCls (defined for SOMClass class) which
    > > maybe does the right thing.

    >
    > Nobody knows, at least outside of IBM, and they aren't saying anything.
    > I suspect there is no method. If there was it would be a wpSomething()
    > method.


    This functionality is provided by ClassAssociationManager which is
    derived directly from SOMObject. It has 3 methods:

    Method Entry point
    camQueryBecomeableClasses PMWP 03:0001c1dc
    camBecomeInstanceOf PMWP 03:0001c104
    camQueryPreviousClass PMWP 03:0001c078

    BTW...
    > If there was it would be [...]


    This should be "If there _were_ it would be [...]"


    --
    == == almost usable email address: Rich AT E-vertise.Com == ==
    __________________________________________________ _________________
    |
    | DragText v3.9 with NLS support
    Rich Walsh | A Distinctly Different Desktop Enhancement
    Ft Myers, FL | http://e-vertise.com/dragtext/
    __________________________________________________ _________________


  4. Re: How to change class of a file object ("Become" page functionality)?

    Great, thanks ! I think I will be able to go from there. It'll cost me a
    few traps until I will have correctly figured out the parameters to pass ...

    By the way: how did you know ? By guessing from the name ?

    Lars

    Rich Walsh schrieb:
    > On Sun, 22 Jun 2008 23:23:14 UTC, Paul Ratcliffe wrote:
    >> On Mon, 23 Jun 2008 00:01:23 +0200, Lars Erdmann wrote:
    >>
    >>> all file objects (WPDataFile or derived) have a "Become" page (or
    >>> "Object class" ?) where you can change their class to a selection of
    >>> other compatible classes where "compatible classes" do not necessarily
    >>> have to be anchestors of the current class (they can also be children of
    >>> anchestors, therefore can be siblings of parent or grandparent etc.
    >>> classes) but I guess they are restricted to be at least of WPFileSystem
    >>> or derived classses.
    >>> The user interface is there but I cannot see what SOM method supports
    >>> that. Anyone have any insight what SOM method supports this class change
    >>> or any idea how I can debug what SOM method is called on that user action ?
    >>> I have found method somCastObjCls (defined for SOMClass class) which
    >>> maybe does the right thing.

    >> Nobody knows, at least outside of IBM, and they aren't saying anything.
    >> I suspect there is no method. If there was it would be a wpSomething()
    >> method.

    >
    > This functionality is provided by ClassAssociationManager which is
    > derived directly from SOMObject. It has 3 methods:
    >
    > Method Entry point
    > camQueryBecomeableClasses PMWP 03:0001c1dc
    > camBecomeInstanceOf PMWP 03:0001c104
    > camQueryPreviousClass PMWP 03:0001c078
    >
    > BTW...
    >> If there was it would be [...]

    >
    > This should be "If there _were_ it would be [...]"
    >
    >


  5. Re: How to change class of a file object ("Become" page functionality) ?

    On 23 Jun 2008 03:57:51 GMT, Rich Walsh wrote:

    > This functionality is provided by ClassAssociationManager which is
    > derived directly from SOMObject. It has 3 methods:
    >
    > Method Entry point
    > camQueryBecomeableClasses PMWP 03:0001c1dc
    > camBecomeInstanceOf PMWP 03:0001c104
    > camQueryPreviousClass PMWP 03:0001c078


    Much obliged. Is this documented anywhere? How do you work out the parameters
    and the return value? What entrypoint are they in PMWP.DLL?

    (I expect you can find the latter by using DosQueryProcAddr() on all the
    entrypoints in the DLL and finding one that matches the address. More
    sensibly you probably resolve by method name...)

    >> If there was it would be [...]

    >
    > This should be "If there _were_ it would be [...]"


    Yes, I'm well aware of the subjunctive. Like with a lot of modern grammar, the
    rules seem to be irrelevant these days. If I see one more person use "it's"
    instead of "its" for the possessive.....

  6. Re: How to change class of a file object ("Become" page functionality) ?

    On Mon, 23 Jun 2008 12:42:39 UTC, Paul Ratcliffe wrote:
    > On 23 Jun 2008 03:57:51 GMT, Rich Walsh wrote:
    >
    > > This functionality is provided by ClassAssociationManager which is
    > > derived directly from SOMObject. It has 3 methods:
    > >
    > > Method Entry point
    > > camQueryBecomeableClasses PMWP 03:0001c1dc
    > > camBecomeInstanceOf PMWP 03:0001c104
    > > camQueryPreviousClass PMWP 03:0001c078

    >
    > Much obliged. Is this documented anywhere? How do you work out the parameters
    > and the return value? What entrypoint are they in PMWP.DLL?
    >
    > (I expect you can find the latter by using DosQueryProcAddr() on all the
    > entrypoints in the DLL and finding one that matches the address. More
    > sensibly you probably resolve by method name...)


    This comes from RWX which displays the info like this:

    ClassAssociationManager - 3 New methods:

    032 camQueryBecomeableClasses 1f9dc1dc
    033 camBecomeInstanceOf 1f9dc104
    034 camQueryPreviousClass 1f9dc078

    I forget whether RWX resolves methods by name or by looking at the
    static methods table. I made the addresses more generic by looking
    at Theseus and guessing which code segment they were in.

    BTW, Lars...if you have my RWS package, you can use RwsTest to
    invoke these with up to 5 arguments per call. RWS's WPS component
    installs an exception handler before each call, so (hopefully) the
    WPS won't crash if you get them wrong.


    --
    == == almost usable email address: Rich AT E-vertise.Com == ==
    __________________________________________________ _________________
    |
    | DragText v3.9 with NLS support
    Rich Walsh | A Distinctly Different Desktop Enhancement
    Ft Myers, FL | http://e-vertise.com/dragtext/
    __________________________________________________ _________________


  7. Re: How to change class of a file object ("Become" page functionality) ?


    "Paul Ratcliffe" schrieb im Newsbeitrag
    news:slrng5v6hu.5on.abuse@news.pr.network...
    > On 23 Jun 2008 03:57:51 GMT, Rich Walsh wrote:
    >
    >> This functionality is provided by ClassAssociationManager which is
    >> derived directly from SOMObject. It has 3 methods:
    >>
    >> Method Entry point
    >> camQueryBecomeableClasses PMWP 03:0001c1dc
    >> camBecomeInstanceOf PMWP 03:0001c104
    >> camQueryPreviousClass PMWP 03:0001c078

    >
    > Much obliged. Is this documented anywhere? How do you work out the
    > parameters
    > and the return value? What entrypoint are they in PMWP.DLL?


    you work out the parameters by trial and error but I have a fairly good idea
    what they would be.

    I would be much more interested to find out what ordinals go with (as
    PMWP.DLL does not export anything by name) :
    ClassAssociationManagerNewClass
    ClassAssociationManagerClassData
    ClassAssociationManagerCClassData

    They are not listed in somtk.lib but are necessary if you want to statically
    access all those methods through the SOM bindings. I have started to write a
    DSOM application (so that crashes won't hurt) but I cannot use namelookup
    (somLookupMethod, somFindMethod) as DSOM does not support parameter type
    "somID" for proxy/remote invocation (how dull) but I am getting the feeling
    it might in general be easier with Rich's RWS ...

    By the way: how did you find out what routine is what ordinal in your:
    http://home.clara.net/orac/os2/pmwp.htm ?



    Lars



  8. Re: How to change class of a file object ("Become" page functionality) ?

    On Mon, 23 Jun 2008 20:38:59 +0200, Lars Erdmann wrote:

    > I would be much more interested to find out what ordinals go with (as
    > PMWP.DLL does not export anything by name) :
    > ClassAssociationManagerNewClass
    > ClassAssociationManagerClassData
    > ClassAssociationManagerCClassData


    There are no ordinals as those functions are not exported. The only way
    you can resolve them is by SOM name lookup.

    > By the way: how did you find out what routine is what ordinal in your:
    > http://home.clara.net/orac/os2/pmwp.htm ?


    The information was collated from lots of sources. I really can't remember
    now where the PMWP info. came from, but the above is not in there and there
    are no new entrypoints in the DLL.

  9. Re: How to change class of a file object ("Become" page functionality)?

    Paul Ratcliffe schrieb:
    > On Mon, 23 Jun 2008 20:38:59 +0200, Lars Erdmann wrote:
    >
    >> I would be much more interested to find out what ordinals go with (as
    >> PMWP.DLL does not export anything by name) :
    >> ClassAssociationManagerNewClass
    >> ClassAssociationManagerClassData
    >> ClassAssociationManagerCClassData

    >
    > There are no ordinals as those functions are not exported. The only way
    > you can resolve them is by SOM name lookup.


    These are not SOM methods. These are the data structures that allow SOM
    to find the methods and the function that builds the class
    (ClassAssociationManagerNewClass). So I will not be able to find them
    with SOM means ...

    >
    >> By the way: how did you find out what routine is what ordinal in your:
    >> http://home.clara.net/orac/os2/pmwp.htm ?

    >
    > The information was collated from lots of sources.


    So you did not write yourself a utility to somehow parse the DLLs and
    find out (also for all the other DLLs) ? Is there a way this could be done ?

    Lars


  10. Re: How to change class of a file object ("Become" page functionality) ?

    On Tue, 24 Jun 2008 23:56:20 UTC, Lars Erdmann wrote:
    > Paul Ratcliffe schrieb:
    > > On Mon, 23 Jun 2008 20:38:59 +0200, Lars Erdmann wrote:
    > >
    > >> I would be much more interested to find out what ordinals go with (as
    > >> PMWP.DLL does not export anything by name) :
    > >> ClassAssociationManagerNewClass
    > >> ClassAssociationManagerClassData
    > >> ClassAssociationManagerCClassData

    > >
    > > There are no ordinals as those functions are not exported. The only way
    > > you can resolve them is by SOM name lookup.

    >
    > These are not SOM methods. These are the data structures that allow SOM
    > to find the methods and the function that builds the class
    > (ClassAssociationManagerNewClass). So I will not be able to find them
    > with SOM means ...


    Why would you need them? ClassAssociationManager is always loaded and
    available within the WPS process. Of what value is it outside the WPS?

    > >> By the way: how did you find out what routine is what ordinal in your:
    > >> http://home.clara.net/orac/os2/pmwp.htm ?

    > >
    > > The information was collated from lots of sources.

    >
    > So you did not write yourself a utility to somehow parse the DLLs and
    > find out (also for all the other DLLs) ? Is there a way this could be done ?


    Couldn't some of this be gotten from various .sym and trace files?

    BTW... I was able to use RwsTest to call camBecomeInstanceOf and
    camQueryPreviousClass:

    pNewObj = camBecomeInstanceOf( pCamObj, pOldObj, pNewClass);

    fOK = camQueryPreviousClass( pCamObj, pObj, pszClassName);

    I couldn't figure out what all of the arguments for
    camQueryBecomeableClasses might be. It's something like this:

    cntClasses = camQueryBecomeableClasses( pCamObj, pObj, (pBuf?) );
    or
    cntClasses = camQueryBecomeableClasses( pCamObj, pObj, (cbBuf?), (pBuf?) );


    --
    == == almost usable email address: Rich AT E-vertise.Com == ==
    __________________________________________________ _________________
    |
    | DragText v3.9 with NLS support
    Rich Walsh | A Distinctly Different Desktop Enhancement
    Ft Myers, FL | http://e-vertise.com/dragtext/
    __________________________________________________ _________________


  11. Re: How to change class of a file object ("Become" page functionality) ?

    Hallo,

    "Rich Walsh" schrieb im Newsbeitrag
    news:brddYgxvE0gm-pn2-RtPdZcBQrYek@localhost...
    > On Tue, 24 Jun 2008 23:56:20 UTC, Lars Erdmann
    > wrote:
    >> Paul Ratcliffe schrieb:
    >> > On Mon, 23 Jun 2008 20:38:59 +0200, Lars Erdmann
    >> > wrote:
    >> >
    >> >> I would be much more interested to find out what ordinals go with (as
    >> >> PMWP.DLL does not export anything by name) :
    >> >> ClassAssociationManagerNewClass
    >> >> ClassAssociationManagerClassData
    >> >> ClassAssociationManagerCClassData
    >> >
    >> > There are no ordinals as those functions are not exported. The only way
    >> > you can resolve them is by SOM name lookup.

    >>
    >> These are not SOM methods. These are the data structures that allow SOM
    >> to find the methods and the function that builds the class
    >> (ClassAssociationManagerNewClass). So I will not be able to find them
    >> with SOM means ...

    >
    > Why would you need them? ClassAssociationManager is always loaded and
    > available within the WPS process. Of what value is it outside the WPS?


    DSOM requires you to create the class (and all parent classes) in your local
    process even if you want to access a remote class object through
    "somdGetClassObj", that is:

    ClassAssociationManagerNewClass(ClassAssociationMa nager_MajorVersion,ClassAssociationManager_MinorVe rsion)

    has to be called within your process. I am able to create the C/C++ bindings
    (I just hacked an IDL file) but the 3 above variables/routines are expected
    to exist in the class DLL (PMWP.DLL in this case). But somtk.lib does not
    export these symbols ...

    I can get to the class via DSOM but I cannot get an object. I cannot create
    another Cam object either, neither locally ("somNew") nor remote
    ("somdCreateObject").
    But the "cam..." methods only work if I have a Cam object (the class object
    doesn't help).

    >
    >> >> By the way: how did you find out what routine is what ordinal in your:
    >> >> http://home.clara.net/orac/os2/pmwp.htm ?
    >> >
    >> > The information was collated from lots of sources.

    >>
    >> So you did not write yourself a utility to somehow parse the DLLs and
    >> find out (also for all the other DLLs) ? Is there a way this could be
    >> done ?

    >
    > Couldn't some of this be gotten from various .sym and trace files?
    >
    > BTW... I was able to use RwsTest to call camBecomeInstanceOf and
    > camQueryPreviousClass:
    >
    > pNewObj = camBecomeInstanceOf( pCamObj, pOldObj, pNewClass);
    >
    > fOK = camQueryPreviousClass( pCamObj, pObj, pszClassName);
    >
    > I couldn't figure out what all of the arguments for
    > camQueryBecomeableClasses might be. It's something like this:
    >
    > cntClasses = camQueryBecomeableClasses( pCamObj, pObj, (pBuf?) );
    > or
    > cntClasses = camQueryBecomeableClasses( pCamObj, pObj, (cbBuf?),
    > (pBuf?) );


    Thanks very much for that ! Eventually I will move over to RWS. But how did
    YOU get to a Cam object ? Or were you able to create one from the Class
    object (within the WPS process) ?

    Lars



  12. Re: How to change class of a file object ("Become" page functionality) ?

    On Wed, 25 Jun 2008 16:15:28 UTC, "Lars Erdmann" wrote:

    > > BTW... I was able to use RwsTest to call camBecomeInstanceOf and
    > > camQueryPreviousClass:

    >
    > Thanks very much for that ! Eventually I will move over to RWS. But how did
    > YOU get to a Cam object ? Or were you able to create one from the Class
    > object (within the WPS process) ?


    I called somNew on the CAM class object. I had RwsTest return the
    object's pointer, then used that as-is for subsequent calls.


    --
    == == almost usable email address: Rich AT E-vertise.Com == ==
    __________________________________________________ _________________
    |
    | DragText v3.9 with NLS support
    Rich Walsh | A Distinctly Different Desktop Enhancement
    Ft Myers, FL | http://e-vertise.com/dragtext/
    __________________________________________________ _________________


  13. Re: How to change class of a file object ("Become" page functionality)?

    Rich Walsh schrieb:
    > On Wed, 25 Jun 2008 16:15:28 UTC, "Lars Erdmann" wrote:
    >
    >>> BTW... I was able to use RwsTest to call camBecomeInstanceOf and
    >>> camQueryPreviousClass:

    >> Thanks very much for that ! Eventually I will move over to RWS. But how did
    >> YOU get to a Cam object ? Or were you able to create one from the Class
    >> object (within the WPS process) ?

    >
    > I called somNew on the CAM class object. I had RwsTest return the
    > object's pointer, then used that as-is for subsequent calls.
    >
    >

    Sorry to ask again but how did you then get the pointer to the CAM class
    object ?

    Lars

  14. Re: How to change class of a file object ("Become" page functionality) ?

    On Fri, 27 Jun 2008 20:16:41 UTC, Lars Erdmann wrote:
    > Rich Walsh schrieb:
    > > On Wed, 25 Jun 2008 16:15:28 UTC, "Lars Erdmann" wrote:
    > >
    > >>> BTW... I was able to use RwsTest to call camBecomeInstanceOf and
    > >>> camQueryPreviousClass:
    > >> Thanks very much for that ! Eventually I will move over to RWS. But how did
    > >> YOU get to a Cam object ? Or were you able to create one from the Class
    > >> object (within the WPS process) ?

    > >
    > > I called somNew on the CAM class object. I had RwsTest return the
    > > object's pointer, then used that as-is for subsequent calls.
    > >

    > Sorry to ask again but how did you then get the pointer to the CAM class
    > object ?


    Using RwsTest, all I had to do was supply the name of the class
    and identify it as such (i.e. RWSI_CNAME). In effect:
    pObj = somNew( "ClassAssociationManager");

    In the WPS process, RWS turned the name into something usable.
    First it converted the name to a somId, then called somClassFromId
    on the SOMClassMgr object (SOMClassMgrObject is a global variable
    exported by som.dll). Once it had the class object, it invoked the
    requested method and returned the result:
    pObj = somNew( pClass);


    --
    == == almost usable email address: Rich AT E-vertise.Com == ==
    __________________________________________________ _________________
    |
    | DragText v3.9 with NLS support
    Rich Walsh | A Distinctly Different Desktop Enhancement
    Ft Myers, FL | http://e-vertise.com/dragtext/
    __________________________________________________ _________________


  15. Re: How to change class of a file object ("Become" page functionality)?

    Rich Walsh wrote:
    > On Fri, 27 Jun 2008 20:16:41 UTC, Lars Erdmann wrote:
    >> Rich Walsh schrieb:
    >>> On Wed, 25 Jun 2008 16:15:28 UTC, "Lars Erdmann" wrote:
    >>>

    >> Sorry to ask again but how did you then get the pointer to the CAM class
    >> object ?

    >
    > Using RwsTest, all I had to do was supply the name of the class
    > and identify it as such (i.e. RWSI_CNAME). In effect:
    > pObj = somNew( "ClassAssociationManager");
    >
    > In the WPS process, RWS turned the name into something usable.
    > First it converted the name to a somId, then called somClassFromId
    > on the SOMClassMgr object (SOMClassMgrObject is a global variable
    > exported by som.dll). Once it had the class object, it invoked the
    > requested method and returned the result:
    > pObj = somNew( pClass);
    >
    >


    My God, I'm impressed. You've dug into the heart of OS/2 and its WPS,
    and discovered what nobody else new about.

    Thank you!


  16. Re: How to change class of a file object ("Become" page functionality) ?

    Hallo,

    >> Sorry to ask again but how did you then get the pointer to the CAM class
    >> object ?

    >
    > Using RwsTest, all I had to do was supply the name of the class
    > and identify it as such (i.e. RWSI_CNAME). In effect:
    > pObj = somNew( "ClassAssociationManager");
    >
    > In the WPS process, RWS turned the name into something usable.
    > First it converted the name to a somId, then called somClassFromId
    > on the SOMClassMgr object (SOMClassMgrObject is a global variable
    > exported by som.dll). Once it had the class object, it invoked the
    > requested method and returned the result:
    > pObj = somNew( pClass);


    ....which tells me that I have not yet fully understood RWS API. I thought
    even with RWS you always would have to pass an object pointer to ANY wps
    method you are calling as the very first parameter. Obviously not. I'll dig
    into that.

    Thanks a lot.

    Lars



  17. Re: How to change class of a file object ("Become" page functionality)?

    Rich Walsh schrieb:
    > On Fri, 27 Jun 2008 20:16:41 UTC, Lars Erdmann wrote:
    >> Rich Walsh schrieb:
    >>> On Wed, 25 Jun 2008 16:15:28 UTC, "Lars Erdmann" wrote:
    >>>
    >>>>> BTW... I was able to use RwsTest to call camBecomeInstanceOf and
    >>>>> camQueryPreviousClass:
    >>>> Thanks very much for that ! Eventually I will move over to RWS. But how did
    >>>> YOU get to a Cam object ? Or were you able to create one from the Class
    >>>> object (within the WPS process) ?
    >>> I called somNew on the CAM class object. I had RwsTest return the
    >>> object's pointer, then used that as-is for subsequent calls.
    >>>

    >> Sorry to ask again but how did you then get the pointer to the CAM class
    >> object ?

    >
    > Using RwsTest, all I had to do was supply the name of the class
    > and identify it as such (i.e. RWSI_CNAME). In effect:
    > pObj = somNew( "ClassAssociationManager");
    >
    > In the WPS process, RWS turned the name into something usable.
    > First it converted the name to a somId, then called somClassFromId
    > on the SOMClassMgr object (SOMClassMgrObject is a global variable
    > exported by som.dll). Once it had the class object, it invoked the
    > requested method and returned the result:
    > pObj = somNew( pClass);
    >
    >


    Ehmm, could you give me the RWSTEST usage equivalence of:

    get ClassAssociationManager class object clsCAM
    get WPFileSystem class object clsFSys

    ClassAssociationManager *pCAM = clsCAM->somNew();
    WPDataFile *fOld = (WPDataFile
    *)clsFSys->wpclsQueryObjectFromPath("d:\bla\bla test.txt")
    fNew = pCAM->camBecomeInstanceOf(fOld,"IWFProject")
    fOld->wpUnlockObject();
    fNew->wpUnlockObject(); // Is that necessary ? I would guess so ...
    pCAM->somFree();

    So sorry but I have some problems finding my way through the RWS API.
    But I am learning well from examples ...

    Thanks, Lars

  18. Re: How to change class of a file object ("Become" page functionality) ?

    On Sat, 28 Jun 2008 14:06:04 UTC, "Lars Erdmann" wrote:

    > >> Sorry to ask again but how did you then get the pointer to the CAM class
    > >> object ?

    > >
    > > Using RwsTest, all I had to do was supply the name of the class
    > > and identify it as such (i.e. RWSI_CNAME). In effect:
    > > pObj = somNew( "ClassAssociationManager");
    > >
    > > In the WPS process, RWS turned the name into something usable.
    > > First it converted the name to a somId, then called somClassFromId
    > > on the SOMClassMgr object (SOMClassMgrObject is a global variable
    > > exported by som.dll). Once it had the class object, it invoked the
    > > requested method and returned the result:
    > > pObj = somNew( pClass);

    >
    > ...which tells me that I have not yet fully understood RWS API. I thought
    > even with RWS you always would have to pass an object pointer to ANY wps
    > method you are calling as the very first parameter. Obviously not. I'll
    > dig into that.


    Pointers to objects are either not accessible or not useful outside the
    WPS, so RWS converts what you have available on input into an object
    (e.g., a path or a handle or some info from a DRAGITEM structure).
    If requested, it also converts objects into something usable on output
    (e.g. a path, handle, icon, etc.). Of course, RWS doesn't know what
    to do unless you tell it. Consequently, each argument to a method
    requires 3 arguments to RWS: type, size, and value.

    Type identifies the conversion. RWSI_OPATH means "convert this f/q
    path into a file object"; RWSI_CNAME means "convert this class name
    into a class object"; RWSI_ASIS means "pass this value as-is"; etc.

    Size is usually zero because RWS can figure out the size of pointers,
    strings, etc., itself. It's only needed when you want to pass a
    buffer of some arbitrary size. (BTW... in RwsTest, Size is decimal.)

    Value is whatever you're passing in: a string, some hex value, etc.
    If you're passing a buffer that the method will fill (RWSI_PBUF),
    value can be null (or blank in RwsTest) - RWS will init it to zeros.

    This system extends to copying data across process boundaries. If
    some method returns a pointer to a buffer allocated from SOM memory,
    there's a Type to copy the data into shared memory then free the
    SOM buffer. *Any* get or put operation should be possible when RWS
    is called by a C program. RwsTest can be handy for experimenting
    but it isn't quite so flexible (and unlike RWS itself, it has a
    few bugs).

    Overall, RWS _is_ a little clumsy to use at first, but it's really
    not too hard once you get the hang of it.


    --
    == == almost usable email address: Rich AT E-vertise.Com == ==
    __________________________________________________ _________________
    |
    | DragText v3.9 with NLS support
    Rich Walsh | A Distinctly Different Desktop Enhancement
    Ft Myers, FL | http://e-vertise.com/dragtext/
    __________________________________________________ _________________


  19. Re: How to change class of a file object ("Become" page functionality) ?

    On Sat, 28 Jun 2008 15:07:47 UTC, Lars Erdmann wrote:

    > Ehmm, could you give me the RWSTEST usage equivalence of:
    >
    > get ClassAssociationManager class object clsCAM
    > get WPFileSystem class object clsFSys
    >
    > ClassAssociationManager *pCAM = clsCAM->somNew();
    > WPDataFile *fOld = (WPDataFile
    > *)clsFSys->wpclsQueryObjectFromPath("d:\bla\bla test.txt")
    > fNew = pCAM->camBecomeInstanceOf(fOld,"IWFProject")
    > fOld->wpUnlockObject();
    > fNew->wpUnlockObject(); // Is that necessary ? I would guess so ...
    > pCAM->somFree();
    >
    > So sorry but I have some problems finding my way through the RWS API.
    > But I am learning well from examples ...


    Many of the calls shown above aren't needed because RWS performs them
    automatically as it converts, e.g., a path into an object pointer.
    (See my previous post for info about Type, Size, and Value.)


    TYPE SIZE VALUE
    ---- ---- -----
    -> Proc: RWSP_MNAM somNew
    Arg1: RWSI_CNAME 0 ClassAssociationManager
    Return: RWSR_ASIS 0

    In the Result window, you'll see the values used by the method call.
    Arg0 is the return - in this case, a pointer to a C-A-M object.
    You'll copy/paste this into Arg1 in the subsequent calls.


    -> Proc: RWSP_MNAM camBecomeInstanceOf
    Arg1: RWSI_ASIS 0 13bafd8 [ptr to my CAM object]
    Arg2: RWSI_OPATH 0 d:\bla\bla test.txt
    Arg3: RWSI_CNAME 0 IWFProject
    Return: RWSR_ASIS 0

    Arg0 in the Results window is a pointer to the newly created
    object of class IWFProject (AFAIK, the old object is destroyed
    automatically).


    -> Proc: RWSP_MNAM somFree
    Arg1: RWSI_ASIS 0 13bafd8
    Return: RWSR_VOID 0

    RwsTest will display "Error getting result!" for Arg0 but you can
    ignore it - apparently it doesn't handle void returns correctly
    (RWS itself doesn't have this problem).


    -> Proc: RWSP_MNAM wpUnlockObject
    Arg1: RWSI_ASIS 0 45064c4 [ptr to my file object]
    Return: RWSR_ASIS 0

    I have no idea if this is needed or even works. It often seems
    as though objects don't go dormant anymore. (Note: RWS does
    *not* unlock objects on its own because it has no way of knowing
    whether you'll be using them again.)

    If you'd like to see this rendered in C, let me know.


    --
    == == almost usable email address: Rich AT E-vertise.Com == ==
    __________________________________________________ _________________
    |
    | DragText v3.9 with NLS support
    Rich Walsh | A Distinctly Different Desktop Enhancement
    Ft Myers, FL | http://e-vertise.com/dragtext/
    __________________________________________________ _________________


  20. Re: How to change class of a file object ("Become" page functionality) ?

    Hallo,

    I tried to figure out camQueryBecomeableClasses parameters. The RWS
    equivalent of:

    rc = camQueryBecomeableClasses(ClassAssociationManager *pCAM,SOMObject
    *theObj,PVOID pBuf) (rc = BOOL ? or "number of Classes" ?, I don't know).

    returns sucessfully but looking at the buffer pBuf (with Theseus) shows me
    it was not filled with anything (all Zeros).


    As far as I understand RWS can take a buffer
    where the first DWORD in the buffer specifies its length
    (RWSI_PBUFLENGTHFROMULONG or something like that)
    and I would like to try that one out.
    Question is, how do I get this length information into the buffer ? Or does
    RWS copy the "value" field into the buffer as the first DWORD ?
    Question2: Is there any other way to look into the buffer apart form using
    Theseus ?
    I didn't quite catch the conversion (where you do not specify ...MNAME as
    the operation but rather "Conversion").

    Lars


    > Pointers to objects are either not accessible or not useful outside the
    > WPS, so RWS converts what you have available on input into an object
    > (e.g., a path or a handle or some info from a DRAGITEM structure).
    > If requested, it also converts objects into something usable on output
    > (e.g. a path, handle, icon, etc.). Of course, RWS doesn't know what
    > to do unless you tell it. Consequently, each argument to a method
    > requires 3 arguments to RWS: type, size, and value.
    >
    > Type identifies the conversion. RWSI_OPATH means "convert this f/q
    > path into a file object"; RWSI_CNAME means "convert this class name
    > into a class object"; RWSI_ASIS means "pass this value as-is"; etc.
    >
    > Size is usually zero because RWS can figure out the size of pointers,
    > strings, etc., itself. It's only needed when you want to pass a
    > buffer of some arbitrary size. (BTW... in RwsTest, Size is decimal.)
    >
    > Value is whatever you're passing in: a string, some hex value, etc.
    > If you're passing a buffer that the method will fill (RWSI_PBUF),
    > value can be null (or blank in RwsTest) - RWS will init it to zeros.
    >
    > This system extends to copying data across process boundaries. If
    > some method returns a pointer to a buffer allocated from SOM memory,
    > there's a Type to copy the data into shared memory then free the
    > SOM buffer. *Any* get or put operation should be possible when RWS
    > is called by a C program. RwsTest can be handy for experimenting
    > but it isn't quite so flexible (and unlike RWS itself, it has a
    > few bugs).
    >
    > Overall, RWS _is_ a little clumsy to use at first, but it's really
    > not too hard once you get the hang of it.
    >
    >
    > --
    > == == almost usable email address: Rich AT E-vertise.Com == ==
    > __________________________________________________ _________________
    > |
    > | DragText v3.9 with NLS support
    > Rich Walsh | A Distinctly Different Desktop Enhancement
    > Ft Myers, FL | http://e-vertise.com/dragtext/
    > __________________________________________________ _________________
    >




+ Reply to Thread
Page 1 of 2 1 2 LastLast