Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. std::wstring by ref

std::wstring by ref

Scheduled Pinned Locked Moved Managed C++/CLI
c++question
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    wb
    wrote on last edited by
    #1

    is it possible to call a native C++ Method from a Managed(?) C++ DLL and pass a std::wstring by ref? I have a native C++ DLL. This has a static function IServer * CreateServer(); I created a Managed C++ DLL, imported the native DLL and now trying to make it work. .... [DllImport("DoubleFindDll.dll")] extern "C" IServer * CreateServer(); .... IServer srv = CreateServer(); srv->startUp(); std::wstring some_string; srv->FooBar(some_string); //crash here FooBar is defined as: virtual void FooBar(std::wstring & str) = 0; and the string is modified inside the method. Im using VS2005. Thank you for any hint.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups