Class: WIN32OLE_PARAM

Inherits:
Object
  • Object
show all
Defined in:
lib/win32ole-pr.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#indexObject

Returns the value of attribute index.



4208
4209
4210
# File 'lib/win32ole-pr.rb', line 4208

def index
  @index
end

#method_indexObject

Returns the value of attribute method_index.



4206
4207
4208
# File 'lib/win32ole-pr.rb', line 4206

def method_index
  @method_index
end

#nameObject Also known as: to_s

Returns the value of attribute name.



4207
4208
4209
# File 'lib/win32ole-pr.rb', line 4207

def name
  @name
end

#pTypeInfoObject

Returns the value of attribute pTypeInfo.



4205
4206
4207
# File 'lib/win32ole-pr.rb', line 4205

def pTypeInfo
  @pTypeInfo
end

Instance Method Details

#defaultObject



4335
4336
4337
# File 'lib/win32ole-pr.rb', line 4335

def default
    ole_param_default(@pTypeInfo,@method_index,@index)
end

#input?Boolean

Returns:

  • (Boolean)


4291
4292
4293
# File 'lib/win32ole-pr.rb', line 4291

def input?
    ole_param_flag_mask(@pTypeInfo,@method_index,@index,PARAMFLAG_FIN)
end

#inspectObject



4339
4340
4341
4342
4343
4344
4345
4346
# File 'lib/win32ole-pr.rb', line 4339

def inspect
    detail = self.detail
    defval = self.default
    if defval
        detail << '=' + defval.inspect
    end
   "#<#{self.class}:#{detail}>"
end

#ole_param_default(pTypeInfo, method_index, index) ⇒ Object



4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
# File 'lib/win32ole-pr.rb', line 4307

def ole_param_default(pTypeInfo,method_index,index)
    mask = PARAMFLAG_FOPT|PARAMFLAG_FHASDEFAULT
    defval = nil
  lpVtbl = 0.chr * 4
  table = 0.chr * 88
  memcpy(lpVtbl,pTypeInfo,4)
  memcpy(table,lpVtbl.unpack('L').first,88)
  table = table.unpack('L*')
  getTypeAttr = Win32::API::Function.new(table[3],'PP','L')
    getFuncDesc = Win32::API::Function.new(table[5],'PLP','L')
  releaseFuncDesc = Win32::API::Function.new(table[20],'PP','L')
  p = 0.chr * 4
    hr = getFuncDesc.call(pTypeInfo, method_index, p)
    return ret if hr != S_OK
    pFuncDesc = p.unpack('L').first
  funcDesc = 0.chr * 52
  memcpy(funcDesc,pFuncDesc,52)
  tdesc = 0.chr * 16
  memcpy(tdest,funcDesc[8,4].unpack('L').first + index*16,16)    
  if (tdesc[12,2].unpack('S').first & mask) == mask
      pParamDescEx = 0.chr * 24
      memcpy(pParamDescEx,tdesc[8,4].unpack('L').first,24)        
      defval = WIN32OLE.ole_variant2val(pParamDescEx[8,16])
   end
    releaseFuncDesc.call(pTypeInfo, pFuncDesc)
    defval 
end

#ole_param_flag_mask(pTypeInfo, method_index, index, mask) ⇒ Object



4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
# File 'lib/win32ole-pr.rb', line 4266

def ole_param_flag_mask(pTypeInfo,method_index,index,mask)
    ret = false
  lpVtbl = 0.chr * 4
  table = 0.chr * 88
  memcpy(lpVtbl,pTypeInfo,4)
  memcpy(table,lpVtbl.unpack('L').first,88)
  table = table.unpack('L*')
  getTypeAttr = Win32::API::Function.new(table[3],'PP','L')
    getFuncDesc = Win32::API::Function.new(table[5],'PLP','L')
  releaseFuncDesc = Win32::API::Function.new(table[20],'PP','L')
  p = 0.chr * 4
    hr = getFuncDesc.call(pTypeInfo, method_index, p)
    return ret if hr != S_OK
    pFuncDesc = p.unpack('L').first
  funcDesc = 0.chr * 52
  memcpy(funcDesc,pFuncDesc,52)
  tdesc = 0.chr * 16
  memcpy(tdesc,funcDesc[8,4].unpack('L').first + index*16,16)    
  if (tdesc[12,2].unpack('S').first & mask) != 0
      ret = true
   end
    releaseFuncDesc.call(pTypeInfo, pFuncDesc)
    ret 
end

#ole_param_ole_type(pTypeInfo, method_index, index) ⇒ Object



4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
# File 'lib/win32ole-pr.rb', line 4212

def ole_param_ole_type(pTypeInfo,method_index,index)
  type = "unknown type"
  lpVtbl = 0.chr * 4
  table = 0.chr * 88
  memcpy(lpVtbl,pTypeInfo,4)
  memcpy(table,lpVtbl.unpack('L').first,88)
  table = table.unpack('L*')
  getTypeAttr = Win32::API::Function.new(table[3],'PP','L')
    getFuncDesc = Win32::API::Function.new(table[5],'PLP','L')
  releaseFuncDesc = Win32::API::Function.new(table[20],'PP','L')
  p = 0.chr * 4
    hr = getFuncDesc.call(pTypeInfo, method_index, p)
    return type if hr != S_OK
    pFuncDesc = p.unpack('L').first
  funcDesc = 0.chr * 52
  memcpy(funcDesc,pFuncDesc,52)
  tdesc = 0.chr * 16
  memcpy(tdesc,funcDesc[8,4].unpack('L').first + index*16,16)    
  type = WIN32OLE_TYPE.ole_typedesc2val(pTypeInfo,tdesc,nil)     
    releaseFuncDesc.call(pTypeInfo, pFuncDesc)
    type 
end

#ole_param_ole_type_detail(pTypeInfo, method_index, index) ⇒ Object



4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
# File 'lib/win32ole-pr.rb', line 4239

def ole_param_ole_type_detail(pTypeInfo,method_index,index)
    typedetail = []
  lpVtbl = 0.chr * 4
  table = 0.chr * 88
  memcpy(lpVtbl,pTypeInfo,4)
  memcpy(table,lpVtbl.unpack('L').first,88)
  table = table.unpack('L*')
  getTypeAttr = Win32::API::Function.new(table[3],'PP','L')
    getFuncDesc = Win32::API::Function.new(table[5],'PLP','L')
  releaseFuncDesc = Win32::API::Function.new(table[20],'PP','L')
  p = 0.chr * 4
    hr = getFuncDesc.call(pTypeInfo, method_index, p)
    return typedetail if hr != S_OK
    pFuncDesc = p.unpack('L').first
  funcDesc = 0.chr * 52
  memcpy(funcDesc,pFuncDesc,52)
  tdesc = 0.chr * 16
  memcpy(tdesc,funcDesc[8,4].unpack('L').first + index*16,16)    
  WIN32OLE_TYPE.ole_typedesc2val(pTypeInfo,tdesc,typedetail)     
    releaseFuncDesc.call(pTypeInfo, pFuncDesc)
    typedetail 
end

#ole_typeObject



4235
4236
4237
# File 'lib/win32ole-pr.rb', line 4235

def ole_type
    ole_param_ole_type(@pTypeInfo,@method_index,@index)
end

#ole_type_detailObject



4262
4263
4264
# File 'lib/win32ole-pr.rb', line 4262

def ole_type_detail
    ole_param_ole_type_detail(@pTypeInfo,@method_index,@index)
end

#optional?Boolean

Returns:

  • (Boolean)


4299
4300
4301
# File 'lib/win32ole-pr.rb', line 4299

def optional?
    ole_param_flag_mask(@pTypeInfo,@method_index,@index,PARAMFLAG_FOPT)
end

#output?Boolean

Returns:

  • (Boolean)


4295
4296
4297
# File 'lib/win32ole-pr.rb', line 4295

def output?
    ole_param_flag_mask(@pTypeInfo,@method_index,@index,PARAMFLAG_FOUT)
end

#retval?Boolean

Returns:

  • (Boolean)


4303
4304
4305
# File 'lib/win32ole-pr.rb', line 4303

def retval?
    ole_param_flag_mask(@pTypeInfo,@method_index,@index,PARAMFLAG_FRETVAL)
end