Jump to content

Argv[0] is empty when ran from editor.


reepblue
 Share

Go to solution Solved by Josh,

Recommended Posts

If you run this application from the editor, the argv[0] variable will be empty. When running it outside of the editor, the value will be the name/path of the application.

I need this to work to get the name of the application to create the settings file. I can work around this, but I thought I should let you know.

#include "UltraEngine.h"

using namespace UltraEngine;

int main(int argc, const char* argv[])
{
	auto name = WString(argv[0]);
	if (name.empty())
	{
		Print("Application name is empty.")
	}
	return 0;
}

 

Cyclone - Ultra Game System - Component PreprocessorTex2TGA - Darkness Awaits Template (Leadwerks)

If you like my work, consider supporting me on Patreon!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...