Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. struct Config
  2. {
  3. std::string aye;
  4. std::string bee;
  5. std::string sea;
  6. };
  7.  
  8. extern "C" __declspec(dllexport) BridgeBase_I* __stdcall Bridge_GetConfiguredDefaultsImplementationPointer(
  9. const std::vector<Config> & newConfigs, /**< new configurations to apply **/
  10. std::string configFolderPath, /**< folder to write config files in **/
  11. std::string defaultConfigFolderPath, /**< folder to find default config files in **/
  12. std::string & status /**< output status of config parse **/
  13. );
  14.  
  15. GatewayWrapper::Config bridge;
  16. std::string configPath("./config");
  17. std::string defaultPath("./config/default");
  18. GatewayWrapper::Config gwtransport;
  19. bridge.aye = "bridged.dll";
  20. bridge.bee = "1.0";
  21. bridge.sea = "";
  22. configs.push_back(bridge);
  23. _bridge = GatewayWrapper::Bridge_GetConfiguredDefaultsImplementationPointer(configs, configPath, defaultPath, status);
  24.  
  25. System::String^ temp
  26. List<CConfig^>^ configs = gcnew List<CConfig ^>((INT32)newConfigs.size());
  27. for( int i = 0; i< newConfigs.size(); i++)
  28. {
  29. std::cout << newConfigs[i].aye<< std::flush; // prints
  30. std::cout << newConfigs[i].aye.c_str() << std::flush; // prints
  31. temp = gcnew System::String(newConfigs[i].aye.c_str());
  32. System::Console::WriteLine(temp); // prints
  33. std::cout << "Testing string creation" << std::endl; // prints
  34. std::cout << newConfigs[i].bee << std::flush; // crashes here
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement