VC++, Win32: Setting VLC_PLUGIN_PATH programmatically
Posted: 29 May 2012 12:42
Hello.
(Another) question about VLC_PLUGIN_PATH:
It seems to me that it is not possible to set this variable on a Win32 System programmatically in a way that it can be used by libVlc: If I set up VLC_PLUGIN_PATH as an environment variable using control-panel -> Advanced -> Environment variables -> etc.. things work fine with libVLC (Defining it to something like C:\myplugins)
If I set them from within my program before calling new_libvlc for the first time, the variable is set within my program, but not within the process/thread where VLC runs. For example the following will not work:
All this makes sense as libVLc probably does not use the CreateProcess function of the win32 api and therefore the thread does not inherit the environment, but gets a new one.
Is there any known work-around simpler than the one mentioned here: http://permalink.gmane.org/gmane.comp.v ... evel/86757? I'm not so happy with having a folder named 'plugin' (VlcPlugins would be nice ) or having to modify the environment. Or do I get things totally wrong?
(Another) question about VLC_PLUGIN_PATH:
It seems to me that it is not possible to set this variable on a Win32 System programmatically in a way that it can be used by libVlc: If I set up VLC_PLUGIN_PATH as an environment variable using control-panel -> Advanced -> Environment variables -> etc.. things work fine with libVLC (Defining it to something like C:\myplugins)
If I set them from within my program before calling new_libvlc for the first time, the variable is set within my program, but not within the process/thread where VLC runs. For example the following will not work:
Code: Select all
wstring vlcPluginDirectory = L"C:\\myplugins";
::SetEnvironmentVariable(L"VLC_PLUGIN_PATH", vlcPluginDirectory.c_str());
m_pVlcInstance = libvlc_new(0, NULL);
Is there any known work-around simpler than the one mentioned here: http://permalink.gmane.org/gmane.comp.v ... evel/86757? I'm not so happy with having a folder named 'plugin' (VlcPlugins would be nice ) or having to modify the environment. Or do I get things totally wrong?