Skip to content
Discussion options

You must be logged in to vote

You can create a PCWSTR based on a string like this:

unsafe
{
    string message = "Hello World";
    fixed (char* pMessage = message)
    {
        PCWSTR pcwstr = new PCWSTR(pMessage);
        // use PCWSTR within the fixed block.
    }
}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@myokeeh
Comment options

@domenic
Comment options

Answer selected by AArnott
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
bug Something isn't working
3 participants
Converted from issue

This discussion was converted from issue #911 on April 11, 2023 12:28.