Browse Source

tags/2021-05-28
jules 17 years ago
parent
commit
c6f6576636
4 changed files with 20 additions and 8 deletions
  1. +6
    -0
      build/win32/platform_specific_code/juce_win32_PlatformUtils.cpp
  2. +7
    -6
      juce.h
  3. +2
    -2
      src/juce_appframework/application/juce_Application.cpp
  4. +5
    -0
      src/juce_core/misc/juce_PlatformUtilities.h

+ 6
- 0
build/win32/platform_specific_code/juce_win32_PlatformUtils.cpp View File

@@ -185,6 +185,12 @@ bool juce_IsRunningInWine() throw()
return false;
}
//==============================================================================
const String JUCE_CALLTYPE PlatformUtilities::getCurrentCommandLineParams() throw()
{
return String (::GetCommandLineW());
}
//==============================================================================
static void* currentModuleHandle = 0;


+ 7
- 6
juce.h View File

@@ -186,23 +186,24 @@ END_JUCE_NAMESPACE
#ifdef _CONSOLE
#define START_JUCE_APPLICATION(AppClass) \
int main (int argc, char* argv[]) \
int main (int, char* argv[]) \
{ \
return JUCE_NAMESPACE::JUCEApplication::main (argc, argv, new AppClass()); \
JUCE_NAMESPACE::String commandLineString (JUCE_NAMESPACE::PlatformUtilities::getCurrentCommandLineParams()); \
return JUCE_NAMESPACE::JUCEApplication::main (commandLineString, new AppClass()); \
}
#elif ! defined (_AFXDLL)
#ifdef _WINDOWS_
#define START_JUCE_APPLICATION(AppClass) \
int WINAPI WinMain (HINSTANCE, HINSTANCE, LPSTR commandLine, int) \
int WINAPI WinMain (HINSTANCE, HINSTANCE, LPSTR, int) \
{ \
JUCE_NAMESPACE::String commandLineString (commandLine); \
JUCE_NAMESPACE::String commandLineString (JUCE_NAMESPACE::PlatformUtilities::getCurrentCommandLineParams()); \
return JUCE_NAMESPACE::JUCEApplication::main (commandLineString, new AppClass()); \
}
#else
#define START_JUCE_APPLICATION(AppClass) \
int __stdcall WinMain (int, int, const char* commandLine, int) \
int __stdcall WinMain (int, int, const char*, int) \
{ \
JUCE_NAMESPACE::String commandLineString (commandLine); \
JUCE_NAMESPACE::String commandLineString (JUCE_NAMESPACE::PlatformUtilities::getCurrentCommandLineParams()); \
return JUCE_NAMESPACE::JUCEApplication::main (commandLineString, new AppClass()); \
}
#endif


+ 2
- 2
src/juce_appframework/application/juce_Application.cpp View File

@@ -280,11 +280,11 @@ int JUCEApplication::shutdownAppAndClearUp (const bool useMaximumForce)
int JUCEApplication::main (int argc, char* argv[],
JUCEApplication* const newApp)
{
juce_setCurrentExecutableFileName (argv[0]);
juce_setCurrentExecutableFileName (String::fromUTF8 ((const uint8*) argv[0]));
String cmd;
for (int i = 1; i < argc; ++i)
cmd << argv[i] << T(' ');
cmd << String::fromUTF8 ((const uint8*) argv[i]) << T(' ');
return JUCEApplication::main (cmd, newApp);
}


+ 5
- 0
src/juce_core/misc/juce_PlatformUtilities.h View File

@@ -139,6 +139,11 @@ public:
*/
static void JUCE_CALLTYPE setCurrentModuleInstanceHandle (void* newHandle) throw();
/** WIN32 ONLY - Gets the command-line params as a string.
This is needed to avoid unicode problems with the argc type params.
*/
static const String JUCE_CALLTYPE getCurrentCommandLineParams() throw();
#endif
/** Clears the floating point unit's flags.


Loading…
Cancel
Save