Author Topic: Slick crashes if I call createExtension with existing langid  (Read 2464 times)

AGodfrey

  • Junior Community Member
  • Posts: 7
  • Hero Points: 0
I am trying to automate my settings, but this one (associating 'cmd' file extensions with the 'bat' language) crashes SlickEdit. I don't mean a Slick-C stack, I mean the app crashes.
Any tips on what I'm doing wrong?

This code crashes 100% for me (SlickEdit Pro 2014 (v19.0.2.5 64-bit)):


#require "se/lang/api/ExtensionSettings.e"

using namespace se.lang.api;

defmain()
{
   ExtensionSettings.createExtension('cmd', 'bat');
}


Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3794
  • Hero Points: 497
Re: Slick crashes if I call createExtension with existing langid
« Reply #1 on: July 18, 2016, 03:55:24 pm »
Try using _CreateExtension instead of the language API.  The bug causing the crash will be fixed in the next release.

Code: [Select]
#include "slick.sh"

defmain()
{
   _CreateExtension("cmd", "bat");
}

AGodfrey

  • Junior Community Member
  • Posts: 7
  • Hero Points: 0
Re: Slick crashes if I call createExtension with existing langid
« Reply #2 on: July 19, 2016, 03:14:53 pm »
Thanks, that works!

Which API is more "recommended"?
I only used the one I did because it's the first one I found (not realizing there are 2).

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3794
  • Hero Points: 497
Re: Slick crashes if I call createExtension with existing langid
« Reply #3 on: July 20, 2016, 04:20:24 pm »
Either is fine.  The object-oriented API calls the other API under the hood anyway.