×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    27

    Unable to open a newly created text file?

    Dear friends,
    I am doing a sample appln like a simple text editor and in this i create new file and after this, if I go to the File Manager, and try to open the created file, I get the following the error message:

    "No Installed Application 'Communicator\Documents\somefile' Cannot open this file"

    Below is my code part where i create newfile:

    void CChattstDocument:oNewFileL(const TFileName& aFileName)
    {
    CFileStore* store=CDirectFileStore::ReplaceLC(Process()->FsSession(),aFileName,EFileShareExclusive);
    //CFileStore* store=CPermanentFileStore::ReplaceLC(Process()->FsSession(),aFileName,EFileShareExclusive);
    TUidType fileUid(KDirectFileStoreLayoutUid,KUidAppDllDoc,Application()->AppDllUid());
    store->SetTypeL(fileUid);
    CStreamDictionary* streamDic=CStreamDictionary::NewL();
    CleanupStack::PushL(streamDic);
    Process()->WriteRootStreamL(*store,*streamDic,*Application());
    store->CommitL();
    CleanupStack::PopAndDestroy(); // streamDic
    NewDocumentL();
    CleanupStack::Pop(); // store
    delete((CEikProcess*)Process())->MainStore(); // remove the [original] store
    ((CEikProcess*)Process())->SetMainStore(store); // set the new file store as the main one.
    Process()->SetMainDocFileName(aFileName);
    SetChanged(EFalse);
    }


    Any help. please suggest.
    Thanks and regards
    Uva

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    55

    RE: Unable to open a newly created text file?

    Hi,

    The file can not be opened automatically if the type of the file is not known. To open the file with your application, you need to register a mime type or file type recognizer for your files.
    This is not an error in the system or in the file creation.
    For more information on mime types or recognizers see the SDK help.

    Brg,
    Szabolcs Tolnai

Posting Permissions

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