On Sunday, 6 December 2020 at 05:04:35 UTC, tsbockman wrote:
On Sunday, 6 December 2020 at 02:07:10 UTC, Jack wrote:
On Saturday, 5 December 2020 at 23:31:31 UTC, tsbockman wrote:
On Saturday, 5 December 2020 at 21:55:13 UTC, Jack wrote:
[...]
`ws.length` is the length in `wchar`s, but `
On Sunday, 6 December 2020 at 04:41:56 UTC, Виталий Фадеев wrote:
On Saturday, 5 December 2020 at 19:51:14 UTC, Jack wrote:
So in D I have a struct like this:
struct ProcessResult
{
string[] output;
bool ok;
}
in order to use output from C WINAPI with unicode, I need to
conv
On Sunday, 6 December 2020 at 02:07:10 UTC, Jack wrote:
On Saturday, 5 December 2020 at 23:31:31 UTC, tsbockman wrote:
On Saturday, 5 December 2020 at 21:55:13 UTC, Jack wrote:
wstring ws;
transcode(output[i], ws);
auto s = malloc(ws.length + 1);
if(!s) {
onOutOfMemoryEr
On Saturday, 5 December 2020 at 19:51:14 UTC, Jack wrote:
So in D I have a struct like this:
struct ProcessResult
{
string[] output;
bool ok;
}
in order to use output from C WINAPI with unicode, I need to
convert each string to wchar* so that i can acess it from C
with wchar
On Saturday, 5 December 2020 at 23:31:31 UTC, tsbockman wrote:
On Saturday, 5 December 2020 at 21:55:13 UTC, Jack wrote:
my code now look like this, still there's a memory corrupt.
Could anyone help point out where is it?
...
foreach(i; 0..output.length) {
wstring ws;
transcode(outpu
On Saturday, 5 December 2020 at 21:55:13 UTC, Jack wrote:
my code now look like this, still there's a memory corrupt.
Could anyone help point out where is it?
...
foreach(i; 0..output.length) {
wstring ws;
transcode(output[i], ws);
auto s = malloc(ws.length + 1);
if(!s) {
I totally forget to malloc() the strings and array. I don't do C
has been a while and totally forget this, thank you so much guys
for your answer.
my code now look like this, still there's a memory corrupt. Could
anyone help point out where is it?
struct ProcessResult
{
string[] out
On Saturday, 5 December 2020 at 19:51:14 UTC, Jack wrote:
version(Windows) extern(C) export
struct C_ProcessResult
{
wchar*[] output;
In D, `T[]` (where T is some element type, `wchar*` in this case)
is a slice structure that bundles a length and a pointer
together. It is NOT the same
On Saturday, 5 December 2020 at 20:12:52 UTC, IGotD- wrote:
On Saturday, 5 December 2020 at 19:51:14 UTC, Jack wrote:
So in D I have a struct like this:
struct ProcessResult
{
string[] output;
bool ok;
}
in order to use output from C WINAPI with unicode, I need to
convert ea
On Saturday, 5 December 2020 at 19:51:14 UTC, Jack wrote:
So in D I have a struct like this:
struct ProcessResult
{
string[] output;
bool ok;
}
in order to use output from C WINAPI with unicode, I need to
convert each string to wchar* so that i can acess it from C
with wchar
So in D I have a struct like this:
struct ProcessResult
{
string[] output;
bool ok;
}
in order to use output from C WINAPI with unicode, I need to
convert each string to wchar* so that i can acess it from C with
wchar_t*. Is that right or am I missing anything?
struct Pro
11 matches
Mail list logo