×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    35

    Problems with the Content Listing Framework

    Did anyone have any success with using the Content Listing Framework ? I'm getting a KERN EXEC-3 panic when trying it in the emulator, and Code Warrior wouldn't reveal the call stack.

    I also want to question the design of this API. First off, ContentListingFactory provides only functions ending in LC, which are only suitable if you store the resulted pointers as automatic variables on the stack. If you want to store those as member variables of a C-class, the only way to do it is to explicitly pop (but not destroy) the result off the cleanup stack.

    Another oddity is that the factory functions return M-classes. E.g. "static IMPORT_C MCLFContentListingEngine * ContentListingFactory::NewContentListingEngineLC()". If you push an M-class pointer on the cleanup stack, like this does, and later try to pop and destroy it with validity checking, you'll get a panic.

    E.g.

    MCLFContentListingEngine* engine = ContentListingFactory::NewContentListingEngineLC();

    CleanupStack::PopAndDestroy(engine); // Will panic

    So clearly returning pointers to M-classes from a factory function is not a good idea. This aside, the next issue arise.

    MCLFItemListModel::RefreshL() is an asynchronous function that completes through a callback part of MCLFOperationObserver, not through the usual TRequestStatus. Getting an instance of MCLFItemListModel is through "MCLFItemListModel* MCLFContentListingEngine::CreateListModelLC(MCLFOperationObserver & aObserver)". If really the purpose of providing LC factories was to force people to use automatic variables for holding the results, then by the time the call to RefreshL completes asynchronously, those automatic variables would be gone, because the call stack would have unwound. This is I believe a conceptual mismatch in the design of the API. One could perhaps employ a nested scheduler to prolong the life of those automatic variables until the callback returns, but that would be overly complex.

    An easier approach is to store the result of CreateListModelLC in a member variable of a C-class that stays alive until the callback finishes. Doing that causes a KERN EXEC-3 panic even before the callback gets called.

    For me this API seems totally unusable, I wonder if others had better luck.

  2. #2
    Registered User
    Join Date
    Feb 2005
    Posts
    35

    Re: Problems with the Content Listing Framework

    It seems that my earlier KERN EXEC-3 panic was due to a build error. I had different versions of the SDK installed on my computer, mapped to different drives, and I had separate versions of the same project on different drives, using the same folder name. Well, Code Warrior was picking the .cpp from one drive and the .h from another drive when building. That's insane. The workaround was to rename the folders so they are unique.

    Anyway, now I can get the list of content items, so the framework is somehow usable. Still I maintain my previous comments about getting a USER-CBase 90 panic when you try to pop a M-class off the cleanup stack. To work around that, one could use CleanupStack::Pop(), instead of CleanupStack::Pop(engine).

Similar Threads

  1. installing content files
    By davidmaxwaterman in forum Streaming and Video
    Replies: 12
    Last Post: 2008-10-06, 11:46
  2. missing content in MM7 request
    By astrograph in forum General Messaging
    Replies: 0
    Last Post: 2004-11-25, 14:06
  3. Problems in Content Download and OMA Forward-Lock Examples 1.0
    By venusliong in forum Digital Rights Management & Content Downloading
    Replies: 2
    Last Post: 2003-08-27, 08:45

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×