[CS3 Win] Doc-Observer, new architecture

Hi all,<br /><br />so I finally get around to port stuff to CS3. While things have gone smoothly until now, I'm obviously getting to the tougher part now: the new command-architecture.<br />I've written a command to import text from a file. I guess I don't really need my own command here, but in CS2 I could do all the stuff needed at undo in the Undo()-Method of my command. Needless to say that this is obsolete now. So I figured I'd just broadcast changes on my own PMIID in the commands DoNotify() and use a doc-observer with LazyUpdate(), since that'll tell me of changes not only at Do() but also at Undo()/Redo() - I hope so at least. Unfortunately attaching the observer according to the porting-guide/API-reference crashes InDesign.<br />Now, here's some code, I've stripped it of nil-pointer checks for breviety:<br /><br />from the DoNotify():<br /><br />IDocument* doc = Utils<ILayoutUIUtils>()->GetFrontDocument();<br />InterfacePtr<IMCMImportTextData> importData(this, UseDefaultIID());<br />InterfacePtr<ISubject> docSubject(doc, UseDefaultIID());<br />ListLazyNotificationData<PMString>* lnData = new ListLazyNotificationData<PMString>;<br />lnData->ItemChanged(importData->GetPath());<br />docSubject->ModelChange(kMCMImportTextCmdBoss, IID_IMCMIMPORTTEXTDATA, this, lnData);<br /><br />IMCMImportTextData ist an interface aggregated on my CmdBoss to allow for Data-Exchange, in this case it's a path to file, still need to change that to an IDFile due to the changes to PMString. Seems to work ...<br /><br />Now the attach-method on my doc-observer - at which point ID crashes when opening the doc:<br /><br />InterfacePtr<ISubject> iDocSubject(iDocument, UseDefaultIID());<br />if (!iDocSubject->IsAttached(this, IID_IMCMIMPORTTEXTDATA, ISubject::kRegularAttachment)){<br />iDocSubject->AttachObserver(this, IID_IMCMIMPORTTEXTDATA, ISubject::kRegularAttachment);<br />}<br />if (!iDocSubject->IsAttached(this, IID_IHIERARCHY, ISubject::kRegularAttachment)){<br />iDocSubject->AttachObserver(this, IID_IHIERARCHY, ISubject::kRegularAttachment);<br />}<br /><br />iDocument is an IDocument* passed as a parameter, I've also tried the various AttachmentTypes. If I do it the "old-fashioned-way" (iDocSubject->AttachObserver(this, IID_IMCMIMPORTTEXTDATA, IID_MCMDOCOBSERVER)) it works, but obviously only Update() will be called, not UpdateLazy() which I'll prefer and need. I used IID_IHIERARCHY for test-purposes, commenting out my own IID - unfortunately with the same result.<br />Now I'm stuck - I'm not sure whether I'm missing something basic here, if I just didn't get the documentation or I don't know what.<br /><br />Thanks in advance for any help,<br /><br />Bernt

The selection filter was mentioned for a very specific use case - Jelle had to notify an external application. For details see that other thread, but for you that approach is probably wrong anyway.
Typically you follow the selection in order to update a widget - if not, please explain.
For that case you would aggregate a selection observer (e.g. derived from ActiveSelectionObserver* ) on your widget or its parent panel. In the observer, you would _not_ override Update(), instead use the various Handle() methods.
That notification should be sufficient for simple selection changes on page items, the selection should not need to follow multiple protocols. If there is a deeper sense behind your quoted enormous collection of protocols, then you might need a Suite with SelectionExt* which would preprocess all those notifications and reduce them to a single custom protocol. You'll probably need a Suite anyway unless you can reuse an existing one, to obtain a value for your widget.
In other words, all the _DOCUMENT are not related to the selection, they are just side effects. IID_ISELECTIONFILTER makes no sense. All those PATHSELECTION are only relevant if you want to watch every change to shapes. The reference point again is a sideeffect - I think of scrolling / active spread, it is very unlikely that you really need that notification.
Btw, do not check for IsAttached() during AutoAttach. It just suppresses an ASSERT, better fix the reason (unbalanced Attach / Detach).
* = search the SDK.
Dirk

Similar Messages

  • Dreamweaver CS3 website docs onto new computer

    Have website docs in Dreamweaver CS3 on a computer that's crashed and need to get them on new laptop.  Dreamweaver CS3 has been activated on new computer, however, how do I retrieve docs from the old computer and get them onto the new one? 

    If your sites are online, and the hard drive is complete toast, you can create a new site on the new computer and then use the "Get" command in DW to download the entire thing.
    1. Create a new site on the new computer using Site > New Site
    2. Click the Advanced tab, click Local Info to set the root folder to a new empty folder, then Remote Info to add in your FTP info
    3. Click OK
    4. From the files window of the new (empty) site, click the connect button (plug in icon)
    5. Click the Get button (down arrow) in the Files window
    DW should ask if you'd like to "Get the entire site?" click Yes. Everything in your site's root folder on the server will download to the new site folder created in step 1.

  • 2504 with new-architecture enabled breaks MAC auth for guest access

    Hello,
    We have (2) 2504 WLC running version 7.6.120. WLC1 is the local controller and WLC2 is an achor controller for guest-access. We need to incorporate a 3850 for use with the WLC2 anchor. The guest access is currently working with Mac-Auth and Mac-Auth-Fail to Web-Auth.
    When converged access is enabled on the WLC1 and WLC2, the MAc-Auth no longer works. That is, the previously authenticated user is now redirected to the Web-Auth page. The local controller shows the user as authenticated but the Anchor controller shows the state as WEb-Auth-REQD.
    Rolling back using "config mobility new-architecture disable" and rebooting resolves the issue.
    Does anyone what changes from the old to the new that would break this mac-auth/web-auth configuration?

    You should reach TAC for these sort of issues. Not many people deploying this CA setup yet & you may not get direct feedback immediately.
    HTH
    Rasika

  • MS Office 365 fails to install in default on Win 8.1 new laptop S75-A7221

    Hello,
    New license MS Office 365 fails to install in default on Win 8.1 new laptop S75-A7221.
    I downloaded software from Microsoft MS Office 365 site.
    What is the contact for helpdesk in India for quick resolution?
    Thanks,
    Miroslaw

    Run Microsoft FixIt in the following link to check the result.
    http://support.microsoft.com/kb/2822317
    If your Office installation problem continues to occur, try to perform the steps provided by the same link for general troubleshooting.
    Tony Chen
    TechNet Community Support

  • How do I download my CS3 PhotoShop to my new Apple MacBook Air

    How do I download my CS3 PhotoShop to my new Apple MacBook Air

    Copy the installers to a USB stick, run the install from there.
    Mylenium

  • I want to transfer my Adobe CS3 licence to my new Laptop. Please help me for Deactivate Adobe CS3 licence from old Laptop

    I want to transfer my Adobe CS3 licence to my new Laptop.
    Please help me for Deactivate Adobe CS3 licence from old Laptop

    Hi sanket chalke,
    I'm not sure what Adobe product you need help with, but you might want to start with this document, which has deactivation information: Activation & Deactivation Help
    Please let us know how it goes.
    Best,
    Sara

  • When I open an old pages doc in new pages 5.0 objects in table cells are removed. how can I stop this?

    When I open an old pages doc with new pages 5.0 - objects, specifically pictures, in table cells are removed. Is there a way I can stop this?

    nigel32,
    Gavin is right.  You are bound to lose images in tables of docs made in previous versions.  If you wish to continue using Pages 5.0 to edit docs from previous versions, you can try re-inserting your images using the following method:
    1.  Click on the cell you want to insert to.
    2.  Select CELL on the right contextual menu.
    4.  Click on FILL and select IMAGE FILL.
    5.  Click CHOOSE then select the image you need from Finder.
    6.  Tweak the appearance using the SCALE slider or drop down menu.

  • Error message on convert files to win doc. chrome

    convert to adove files to win doc I have two files that i get an error message when aent to adobe. Nothing else just an error message sayity it failed. What am i doing incorrect as the other 40 loaded fine.
    Thanks
    smrtommy

    http://forums.adobe.com/community/exportpdf

  • I have used Illustrator CS3 on my two try or three previous computers. Now I try to install Illustrator CS3 on a my new (4 weeks old) computer. Adobe does not allow me, but demands me to proof myself being an owner of Illustrator CS2 or older. I don't man

    I have used Illustrator CS3 on my two try or three previous computers. Now I try to install Illustrator CS3 on a my new (4 weeks old) computer. Adobe does not allow me, but demands me to proof myself being an owner of Illustrator CS2 or older. I don't manage to speak English on phone, bad hearing, to fast spoken, odd expressions.What can I do? Is there a possibility to write a complain?

    You can use online chat to talk with Adobe.  For the link below click the Still Need Help? option in the blue area at the bottom and choose the chat option...
    Serial number and activation chat support (non-CC)
    http://helpx.adobe.com/x-productkb/global/service1.html ( http://adobe.ly/1aYjbSC )

  • Upgrade from CS3 Win to CS5 Mac is possible?

    Quite a simple question:
    Is it possible to make upgrade from CS3 Win to CS5 Mac?
    If "yes", which are the steps I'll have to follow?
    I would like to mention that I'll buy the upgrade software
    in Romania, so I'll have to deal with a Romanian Adobe
    software distributor.
    Thank you!

    All right. Thank you!
    Which of the following numbers should I call?
    Software activation
    866-772-3623
    Available 24/7
    Licensing, registration, web subscription services
    800-833-6687
    7 days a week, 5am–7pm PST

  • What is the best, cheapest way to upgrade from CS3 MAC to a newer CS for PC

    What is the best, cheapest way to upgrade from CS3 MAC to a newer CS for PC? I do graphic desing mostly print and some web and want to get into ebooks and more web graphics?

    Hi riverwalk2,
    I have check & found Design Standard CS3 that you have might be eligible for few special offer for the latest version of Adobe Creative Cloud which is independent of Operationg systems.
    Please choose the best option in http://www.adobe.com/products/discount-software-coupons.html?promoid=KAWQR
    Hope it helps you,
    Regards,
    Rajshree

  • Carry forward the PR/PO doc in new fiscal year?

    hi dear all,
    How to carry forward the PR/PO doc in new fiscal year?
    upesh

    Hi,
    This error comes from FI side. For the Account assigned PRs, POs should be carry forwarded in new budget
    Refer this error to your FI guys, they'll make relevant settings
    Umakanth

  • I need CS3 to update on new computer running mavericks. How?

    I need CS3 to update on new computer running mavericks. How?  I keep getting a message that the updater quit, but the installation went well.  No photoshop file opens correctly... there are just a lot of colored lines. But I cannot afford a new Photoshop suite at this time.  Any ideas?

    The new Sync version uses the Firefox account and stores the login data (username/email and password) under the https://accounts.firefox.com site heading in the Password Manager and use the signedInUser.json file in the profile folder to store the credentials once connected to the account to avoid having to enter the master password on each start.

  • Why can't I activate my Dreamweaver CS3 program on my new computer?

    Why can't I activate my Dreamweaver CS3 program on my new computer?

    After 4 hours of searching on internet and trying to be in contact with Adobe support, I found this forum with people with the same problem i have.
    I need to deactivate Acrobat Web Premium CS3 on an older XP machine and activate it on a new Win7 Enterprise.
    The application is on both machines successfully installed/registered and I can continue to click on Help | activate/deactivate (On both machines activate and deactivate is not greyed out),
    but I’m receiving the message Activation - No Connection
    I’ve checked the internet connection, proxy server  and host file, all are correct.

  • CS3 / Win: Observe copy/paste action of a page item

    Hi
    I like to observe the manual copy and paste of a page item.
    How can I do that?
    What do I have to attach to the observer?
    I get the action kAddToHierarchyCmdBoss and kNewPageItemCmdBoss when I copy and paste a page item. this works.
    Now the problem:
    In the text story of my page item there is a table. I can get the number of tables and the ITableModel of the text story in my application, thats not a problem. But I can't get the ITableModel in my observer (kAddToHierarchyCmdBoss ) if I paste the page item. The interface is always nil. I don't know why and I am looking for a solution.
    Maybe the text story is not finished when I get the kAddToHierarchyCmdBoss.
    Is it possible to observe if a text story is finished? I mean the copy of a text story is finished.
    Thanks a lot.
    Kind regard
    Hans

    I am checking in myDocObserver cmd->GetCommandState() == ICommand::kDone?

Maybe you are looking for