Re: [PythonCE] pass Python string to C char *

2008-08-22 Thread Alexandre Delattre
> Well, it works! I realised I had not updated the DLL on my device (that's > what comes of working late). Just for the record, I have tested two methods, > and both work fine to pass a string to a C dll requiring a char * input: 1. use mystr1=c_char_p("mystring") 2. use mystr2=create_string_bu

Re: [PythonCE] pass Python string to C char *

2008-08-20 Thread Adam Walley
Well, it works! I realised I had not updated the DLL on my device (that's what comes of working late). Just for the record, I have tested two methods, and both work fine to pass a string to a C dll requiring a char * input: 1. use mystr1=c_char_p("mystring") 2. use mystr2=create_string_buffer("mys

Re: [PythonCE] pass Python string to C char *

2008-08-19 Thread Adam Walley
Hi, Jared. Thanks for the tip. I came across c_char_p("mystring"), but have not been able to get it working. I also attempted a create_string_buffer("mystring"), but also without success. I have not checked this fully yet, so may still get it working... Adam. On 19/08/2008, Jared Forsyth <[EMAI

[PythonCE] pass Python string to C char *

2008-08-19 Thread Adam Walley
Hi, All. This question has probably been resolved many times over on various forums, but I was wondering what the best way is to pass a Python string (in my case a file path) to a DLL written in C that expects a char* input? Any suggestions? Adam ___ P