"String Marshalling Example"

[DllImport(NATIVE_DLL_NAME, CallingConvention = InteropUtils.DEFAULT_CALLING_CONVENTION,
    EntryPoint = "WindowFactory_SetWindowTitle")]
public static extern InteropBool WindowFactory_SetWindowTitle(
    WindowHandle windowHandle,
    [MarshalAs(InteropUtils.INTEROP_STRING_TYPE)] string windowTitle
);


Code snippet taken from "P/Invoke Tips".