Class: Dde::DdeString
- Inherits:
-
String
- Object
- String
- Dde::DdeString
- Includes:
- Win::Dde
- Defined in:
- lib/dde/dde_string.rb
Overview
Class encapsulates DDE string. In addition to normal string behavior, it also has handle that can be passed to dde functions
Instance Attribute Summary collapse
-
#code_page ⇒ Object
string handle passable to DDEML functions.
-
#handle ⇒ Object
string handle passable to DDEML functions.
-
#instance_id ⇒ Object
string handle passable to DDEML functions.
-
#name ⇒ Object
string handle passable to DDEML functions.
Instance Method Summary collapse
-
#initialize(instance_id, string_or_handle, code_page = CP_WINANSI) ⇒ DdeString
constructor
Given the DDE application instance_id, you cane create DdeStrings either from regular string or from known DdeString handle.
Constructor Details
#initialize(instance_id, string_or_handle, code_page = CP_WINANSI) ⇒ DdeString
Given the DDE application instance_id, you cane create DdeStrings either from regular string or from known DdeString handle
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/dde/dde_string.rb', line 15 def initialize(instance_id, string_or_handle, code_page=CP_WINANSI) @instance_id = instance_id @code_page = code_page begin if string_or_handle.is_a? String @name = string_or_handle error unless @handle = dde_create_string_handle(@instance_id, @name, @code_page) else @handle = string_or_handle error unless @name = dde_query_string(@instance_id, @handle, @code_page) end rescue => e end raise Dde::Errors::StringError, "Failed to initialize DDE string: #{e} #{e.backtrace.join("\n")}" unless @handle && @name && !e super @name end |
Instance Attribute Details
#code_page ⇒ Object
string handle passable to DDEML functions
8 9 10 |
# File 'lib/dde/dde_string.rb', line 8 def code_page @code_page end |
#handle ⇒ Object
string handle passable to DDEML functions
8 9 10 |
# File 'lib/dde/dde_string.rb', line 8 def handle @handle end |
#instance_id ⇒ Object
string handle passable to DDEML functions
8 9 10 |
# File 'lib/dde/dde_string.rb', line 8 def instance_id @instance_id end |
#name ⇒ Object
string handle passable to DDEML functions
8 9 10 |
# File 'lib/dde/dde_string.rb', line 8 def name @name end |