saveasdialog_extended quits max

    Jun 07 2013 | 2:51 pm
    I'm having a problem very similar to the one discussed in this thread:
    The first time I send a 'write' message, the dialog opens normally.  The second time I send a write message, Max just quits somewhere inside of saveasdialog_extended (note: doesn't crash, exits normally).
    I've tried replacing defer with defer_low, which solved the problem in the thread referenced above, but this has no effect for me.
    Has no one else had this problem?
    I'm using OS X 10.7.5, Max 6.1.2, MaxSDK-6.1.1.  Code is copied directly from page 62 of MaxAPI-6.1.1.pdf.
    Thanks for any help anyone can provide!

    • Jun 08 2013 | 11:20 am
      In the SDK, the char "filename" is not initialised, I think that is the reason for the crashes, the code below works for me. cheers, Thomas
      t_fourcc filetype = 'TEXT', outtype; short path; char filename[MAX_FILENAME_CHARS]; strcpy(filename, "untitled.txt");
      if (saveasdialog_extended(filename, &path, &outtype, &filetype, 1)) // non-zero: user cancelled {//do something}
      else {//something}
    • Jun 20 2013 | 7:47 pm
      Thanks! That fixed one of my issues!! For now I am still getting files that are 0 bytes large... baby steps ;)
    • Jun 20 2013 | 9:10 pm
      thank you, thomas! sorry for the late reply. I've been away from this project for a bit.
      Regarding the 0 byte files, I also had this problem. sysfile_writetextfile() actually needs a t_handle as the second parameter (char ** won't work).
      does this help you at all?
    • Jul 01 2015 | 3:36 pm
      thanks for the filename initialization tip! was wracking my brain for an hour before i found this... the SDK should be updated accordingly I think.