Displaying 12 results from an estimated 12 matches for "str2cstr".
2007 Jan 23
0
[853] trunk/wxruby2/swig: Replace deprecated STR2CSTR with StringValuePtr
...:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[853] trunk/wxruby2/swig: Replace deprecated STR2CSTR with StringValuePtr</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd>853</dd>
<dt>Author</dt> <dd>brokentoy</dd>
<dt>Date</dt> <dd>2007-01-23 16:23:36 -0500 (Tue, 23 Jan 2007)&...
2004 Feb 25
5
Wide strings and LPCTSTR types
All,
I was experimenting with converting LPCTSTR strings to wide strings with
something like this:
// Converts a Ruby string to a LPWSTR
LPCTSTR AllocWideLString(VALUE rbString){
char* str = STR2CSTR(rbString);
int length = (strlen(str)+1) * sizeof(WCHAR);
LPCTSTR lpStr = (LPCTSTR)malloc(length);
MultiByteToWideChar(
CP_ACP,
0,
str,
strlen(str)+1,
(LPWSTR)lpStr,
length
);
return lpStr;
}
But, that didn''t seem to work very well in t...
2005 Jul 24
2
Fwd: fix Choice.cpp unicode string
...laces that missed UTF8 convertion.
--- swig/classes/Choice.i 31 Jan 2005 04:18:52 -0000 1.2
+++ swig/classes/Choice.i 24 Jul 2005 19:18:55 -0000
@@ -14,7 +14,7 @@
for(int i=0; i < $1; ++i)
{
VALUE thisItem = rb_ary_entry($input, i);
- $2[i] = (wxChar *)STR2CSTR(thisItem);
+ $2[i] = wxConvUTF8.cMB2WC(STR2CSTR(thisItem));
}
}
There''s another I think UTF8 problem: The onAbout dialog in caret.rb
uses the (c) character so the string is not shown.
Jani
2005 Oct 09
0
[Fwd: Re: [Swig] Re: Object return problem]
...out the answer. wxWindow uses directors (as almost all
our wxruby classes do), and the swig error message hints at the problem.
We need to use directorout typemaps, rather than just plain "out". I
inserted this, and it seemed to work:
%typemap(directorout) wxString {
$result = wxString(STR2CSTR($1), wxConvUTF8);
}
Typemaps are sure a confusing feature. They''re great, and powerful. But
I hope for SWIG v3 they can be completely overhauled to be more
consistent and straightforward.
I''ll forward this message to the wxruby list, too.
Kevin
Charlie Savage wrote:
> Hi R...
2005 Oct 06
9
Grid.GetTextExtent
Wow. Look what SWIG does to GetTextExtent in Grid.cpp:
void SwigDirector_wxGrid::GetTextExtent(wxString const &string, int *x,
int *y, int *descent, int *externalLeading, wxFont const *font) const {
...
if (swig_get_up()) {
wxWindow::GetTextExtent(string,x,y,descent,externalLeading,font);
return;
}
obj0 = rb_str_new2((const char *)(&string)->mb_str());
2004 Feb 25
1
More on etc and other stuff
I seem to have gotten the bugs worked out of win32-etc. It seems it had
to do with using WCHAR vs LPWSTR. Once I used AllocWideLString() vs
AllocWideString() everything seemed to work ok.
One question I have now is this - should I always use AllocWideLString()
instead of casting like (LPCWSTR)STR2CSTR(rbVal); ? It would seem so,
but I''m not sure.
Also, I''ve committed the "add_group" function, but on my box at home I
got "access denied" when I tried to actually add a group. Any help on
that appreciated.
One final note - I''ve started cleaning up t...
2004 Jul 02
0
win32-eventlog-0.2.2 released
Hi all,
I''ve released 0.2.2 of win32-eventlog. There was a
rather nasty bug in the read() method I hadn''t noticed
before - it wasn''t reading all the records!
In addition, this package officially requires Ruby
1.8.0 or later, as I have replaced the STR2CSTR()
functions with StringValuePtr().
Let me know if you find any bugs. Thanks.
Dan
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail
2004 Jul 14
0
New allocation framework and other stuff
Hi all,
To be fully "1.8 compliant" I''ve been updating some of
the packages recently as you may have noticed. Mostly
this has been a matter of replacing STR2CSTR() with
StringValuePtr().
I''d also like to start using the new allocation
framework where relevant, too. I didn''t use this for
a long time because we were using 1.6.8 at work, but
that''s not an issue any more.
I''ve modified win32-ipc and checked in the changes...
2005 Aug 02
1
Latest tarball
The latest tarball won''t compile on Windows:
src/Functions.cpp(582) : error C2664: ''wxLogWarning'' : cannot convert
parameter 1 from ''const class wxWCharBuffer'' to ''const char *''
No user-defined-conversion operator available that can perform
this conversion, or the operator cannot be called
src/Functions.cpp(592) : error
2007 Mar 09
0
[877] trunk/wxruby2/Changelog: Update with 0.0.39 changes; correct last version number
...ed by regression from SWIG upgrade (Alex Fenton)
+- Documentation for FontDialog (Alex Fenton)
+- Test for suitable version (==2.6.3) of wxWidgets (Alex Fenton)
+- Fix Window compile error (Roy Sutton)
+- Added GridBagSizer and supporting classes (Alex Fenton)
+- Update deprecated Ruby API calls to STR2CSTR (Alex Fenton)
+- Fix various crashers in samples (Alex Fenton)
+- Fix crasher with item data in virtual ListCtrl (Alex Fenton)
+- Added RefreshItem(s) methods for virtual ListCtrl (Alex Fenton)
+- Added useful links in documentation main page (Hawley Waldman)
+- Added IconBundle class (Alex Fenton)...
2004 Mar 01
0
RE: win32etc test failure
For delete_user, try this patch:
etc.c, line 639:
- lpHost = (LPCWSTR)STR2CSTR(rbHost);
+lpHost = AllocWideLString(rbHost);
Lemme know how it goes.
Dan
-----Original Message-----
From: win32utils-devel-bounces@rubyforge.org
[mailto:win32utils-devel-bounces@rubyforge.org] On Behalf Of
win32utils-devel@rubyforge.org
Sent: Monday, March 01, 2004 10:02 AM
To: Date, Shashank...
2004 Mar 01
0
RE: win32etc test failure
...al Message-----
From: Berger, Daniel [mailto:djberge@qwest.com]
Sent: Monday, March 01, 2004 11:11 AM
To: win32utils-devel@rubyforge.org; Date, Shashank [Non-Employee]
Subject: RE: [Win32utils-devel] RE: win32etc test failure
For delete_user, try this patch:
etc.c, line 639:
- lpHost = (LPCWSTR)STR2CSTR(rbHost);
+lpHost = AllocWideLString(rbHost);
Lemme know how it goes.
Dan
-----Original Message-----
From: win32utils-devel-bounces@rubyforge.org
[mailto:win32utils-devel-bounces@rubyforge.org] On Behalf Of
win32utils-devel@rubyforge.org
Sent: Monday, March 01, 2004 10:02 AM
To: Date, Shashank...