views:

47

answers:

0

I am using wxruby's StyledTextCtrl. I want to get direct function and pointer from the handle so that I can reuse some old codes written in C.

But the output of the following code is "0, 0", which means send_msg() returns nothing but 0.

require 'wx'
module Wx
  App.run do
    frame = Frame.new nil, :title => "stc"
    stc = StyledTextCtrl.new frame, -1
    # see also http://www.scintilla.org/Steps.html
    fn  = stc.send_msg 2184, 0, 0 # SCI_GETDIRECTFUNCTION
    ptr = stc.send_msg 2185, 0, 0 # SCI_GETDIRECTPOINTER
    puts "#{fn}, #{ptr}" #=> "0, 0" ?
    frame.show
  end
end

Why ? My environments: Windows7, wxruby-ruby19(2.0.1)

I also tried stc.get_handle() and passed the handle to C, but still got no response.