CommFlashF.cpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //---------------------------------------------------------------------------
  2. #pragma hdrstop
  3. #include "CommFlashF.h"
  4. //---------------------------------------------------------------------------
  5. #pragma package(smart_init)
  6. TCommFlash::TCommFlash()
  7. {
  8. }
  9. //---------------------------------------------------------------------------
  10. TCommFlash::~TCommFlash()
  11. {
  12. }
  13. //---------------------------------------------------------------------------
  14. bool TCommFlash::CallFunc(TShockwaveFlashEx *ShockwaveFlash1, String AFuncName, String AArgs)
  15. {
  16. try
  17. {
  18. String sCommand;
  19. sCommand.sprintf((L"<invoke name=\"%s\"><arguments><string>%s</string></arguments></invoke>"), AFuncName, AArgs);
  20. ShockwaveFlash1->CallFunction(sCommand);
  21. }
  22. catch (Exception &exception)
  23. {
  24. //throw Exception(String(exception.ClassName()) + exception.Message);
  25. return false;
  26. }
  27. return true;
  28. }
  29. //---------------------------------------------------------------------------
  30. String TCommFlash::ReplaceName(String AName)
  31. {
  32. String sReturn;
  33. sReturn = StringReplace(AName, "<", "[", TReplaceFlags() << rfReplaceAll);
  34. sReturn = StringReplace(sReturn, ">", "]", TReplaceFlags() << rfReplaceAll);
  35. sReturn = StringReplace(sReturn, ",", "^", TReplaceFlags() << rfReplaceAll);
  36. sReturn = StringReplace(sReturn, "$", "^", TReplaceFlags() << rfReplaceAll);
  37. return sReturn;
  38. }
  39. //---------------------------------------------------------------------------