Forums > Dev

saveasdialog_extended quits max

June 7, 2013 | 7:51 am

Hello,

I’m having a problem very similar to the one discussed in this thread: http://cycling74.com/forums/topic/alternative-to-saveasdialog_extendedfilename-path-outtype-filetype-1/

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!

Joe


June 8, 2013 | 4: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}



MIB
June 20, 2013 | 12:47 pm

Thanks! That fixed one of my issues!!
For now I am still getting files that are 0 bytes large… baby steps ;)


June 20, 2013 | 2: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?

Joe


Viewing 4 posts - 1 through 4 (of 4 total)