Staredit Network > Forums > Modding Assistance > Topic: [GPTP] TerminatePlugin()?
[GPTP] TerminatePlugin()?
Aug 13 2012, 10:11 am
By: Sand Wraith  

Aug 13 2012, 10:11 am Sand Wraith Post #1



Does anyone know if this function actually works or anything?

EDIT:

(Actually, I'm fairly certain this function /is/ called and /does/ work. I can write code to crash SC as it exits, but see below.)

I've also tried writing a test file in this function, but it either does not work or it is appearing somewhere I do not expect it to. (Not in any of my StarCraft directories - maybe a system one?)

qdp.cpp
Code
 BOOL WINAPI TerminatePlugin() {
   //Called when starcraft closes

     // BROKEN AS FUCK, I DON'T EVEN KNOW IF IT IS CALLED

    std::ofstream musicCheckEnd("music", ios::in);
    if(musicCheckEnd.is_open()) // music was enabled
    {
        // perform cleanup
        std::ofstream musicExit("exit", ios::out);
        musicExit.close();
    }
    musicCheckEnd.close();

   return true;
 }


EDIT2:

Clarification. If I place the file "music" in either my SCBW main directory where the SC EXE is or where the mod's EXE is, it doesn't work. I don't know where else it could be reading/writing to, though.

Post has been edited 1 time(s), last time on Aug 13 2012, 10:44 am by Sand Wraith.




Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[03:45 am]
lil-Inferno -- :)
[2026-10-19. : 12:48 am]
Symmetry -- I added a couple more screenshots :)
[2026-10-18. : 9:35 pm]
Symmetry -- hopefully I can provide an awesome map!
[2026-10-18. : 9:26 pm]
Butch -- sounds effing awesome
[2026-10-18. : 8:56 pm]
Symmetry -- I need some more concrete ideas for episode 3. My idea is that you're an emerging consciousness in a Flat Earth experiment trying to escape the cruel grip of science.
[2026-10-18. : 8:53 pm]
Symmetry -- I promise it's moderately fun :hurr:
[2026-10-18. : 5:37 am]
Ultraviolet -- :lol:
[2026-10-18. : 4:11 am]
l)ark_ssj9kevin -- You got me at Rizzagal
[2026-10-18. : 1:22 am]
Symmetry -- https://staredit.net/topic/18946/ <- Look
[2026-10-17. : 2:31 am]
Symmetry -- ...you know what nevermind we're cool
Please log in to shout.


Members Online: lifebot, lil-Inferno, NudeRaider