about win32ole problem

  • Thread starter Kernzhang Kernzhang
  • Start date
K

Kernzhang Kernzhang

I use win32ole function call testdirector client api in ruby.system show
error,but it's correct when i use the same function in vbscripts.please
help me check it!Thanks a Lot!

[vbscripts]
Private Function SendAttachment(item,attfile)
Set bgf=td.BugFactory
Set bg=bgf.item(item)
Set attf=bg.Attachments
Set att=attf.AddItem(Null)
att.FileName= attfile
'att.FileSize=359
att.Type=1
att.Post
End Function

[ruby]
def addAttachment(id,file1)
[email protected]
mybug=bugfactory.item(id)
attf=mybug.Attachments
att=attf.AddItem(nil)
att.invoke('FileName','d:\tmp\ruby.txt')
att.Description="zhangb"
mybug.post
end
when ruby call attf.AddItem(nil),system show the error
AddItem
OLE error code:80070057 in <Unknown>
<No Description>
HRESULT error code:0x80020009
å‘生æ„外。

TestDirector API introduce

FUNC DISPATCH AddItem
Dispatch ID : 3
DESCRIPTION : Create new item object in TD Project DB
arg1 - VARIANT ItemData []
 
G

Gerard Oneill

att=attf.AddItem(nil)

I am eagerly awaiting an answer or an update, since I have a problem
with ADO objects and nils.

I suspect that would be the only thing holding you up; If you try to
make that item something other than nil you might find it work.

Ger.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,072
Latest member
trafficcone

Latest Threads

Top