save document

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 05/02/2003 at 16:12, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   8.012 
Platform:   Windows  ; Mac  ;  Mac OSX  ; 
Language(s) :     C++  ;

---------
Save Document doesn´t work for me somehow. 😕 It just won´t save.

    
    
    BaseDocument* doc = BaseDocument::Alloc(); if(!doc) return FALSE;  
     BaseObject*clone = (BaseObject* )leaf->GetClone(NULL,FALSE); if(!clone) return FALSE;  
     doc->InsertObject(clone,NULL,NULL,FALSE);  
     if(!SaveDocument(doc, fn, FALSE,FORMAT_C4DEXPORT)) {BaseDocument::Free(doc);return FALSE;}

Everything works fine, till I want to save. I am using FileSelect save dialog so the user can set a file directory and name. I am checking then with content if filename is filled. Everythings fine...
Is it buggy? 😞
Thanks
Samir

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 06/02/2003 at 10:33, xxxxxxxx wrote:

Could anybody reproduce/confirm that and/or has a workaround?
Thanks
Samir

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 06/02/2003 at 11:30, xxxxxxxx wrote:

Looks like a bug, the document path/file is not getting set in the API function, add:

    
    
      
    doc->SetDocumentPath(fn.GetDirectory());  
    doc->SetDocumentName(fn.GetFile());  
    

Just before the SaveDocument. This will be corrected in the next API update.

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 06/02/2003 at 11:37, xxxxxxxx wrote:

Thanks. Works now.