Max SDK: Create objects with dots in name?

Joe Kaplan's icon

Joe Kaplan

11月 08 2023 | 10:42 午後

Greetings, I would like to use Max SDK to create a family of objects with the naming convention MyFamily.MyName.

Similar to the zl family, or the dict family, etc.

This convention appears to be the default for Min Devkit. But for these objects I need to do some UI things that I don't believe are currently possible with MIN (as far as I can tell). I believe it is possible to use this naming convention with Max SDK as well because I have seen it in some of the packages availabel in the package manager.

However, I can't seem to figure out how to do it. The object gets it's name from the filename of the .c file, but within the c file we have to define a struct, msg handlers, etc., that all require the name of the object as well. But these cannot have periods in them.

Can anyone provide any guidance on how this naming convention can be achieved?

boilerplate for max SDK object requires objectname, which cannot have dots.

Joe Kaplan's icon

Joe Kaplan

11月 08 2023 | 11:01 午後

Okay, i found some examples of this in the gl folder of the MaxSDK examples. It looks like they are using underscores in place of periods in the .c file. I tried doing a find replace to do that throughout my file, and it's still not working. Curious if anybody is aware of any gotchas that I might be missing here.

Joe Kaplan's icon

Joe Kaplan

11月 08 2023 | 11:10 午後

hey, i figured it out.

It turns out when you're declaring the new class you use a string that has to match the filename. Everywhere else, you can use any value you want as long as it's consistent. Progress. Yay!

11OLSEN's icon

11OLSEN

11月 08 2023 | 11:13 午後

You should be good if folder/filename and the actual class name in class_new() in your main method are matching. Your function names and so on do not have to match exactly.

Iain Duncan's icon

Iain Duncan

11月 10 2023 | 4:06 午前

Oh man I was pulling out my hair on this with bloody XCode for so long... lol