From: Jeff Mitchell Date: 2004-07-02T14:31:31+09:00 Subject: Re: curious behavior with StringValuePtr() --- Daniel Berger wrote: > > lpSourceName = (LPCTSTR)StringValuePtr(rb_iv_get(self,"@source")); > > I get this error: > > eventlog.c(554) : error C2102: '&' requires l-value > eventlog.c(554) : error C2198: 'rb_string_value_ptr' : too few actual > parameters I had the same experience. Unfortunately StringValue*() is not a direct replacement for STR2CSTR, as it takes the address of the parameter, #define StringValue(v) rb_string_value(&(v)) #define StringValuePtr(v) rb_string_value_ptr(&(v)) #define StringValueCStr(v) rb_string_value_cstr(&(v)) My solution was VALUE tmp = rb_iv_get(self,"@source"); lpSourceName = (LPCTSTR)StringValuePtr(tmp); __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail