| Author |
Topic  |
|
|
harshal_in
Aged Yak Warrior
India
633 Posts |
Posted - 10/31/2003 : 07:56:56
|
I have to call a dll ,the function in the dll expects two input parameters and there is one output parameter. when I try to call the dll it gives me the following error: sp_OAMethod usage: ObjPointer int IN, MethodName varchar IN [, @returnval <any> OUT [, additional IN, OUT, or BOTH params]]
here is my code: alter procedure calldll as begin declare @hr int declare @object int declare @return varchar(255) declare @productid int declare @@delaylength datetime declare @padurl varchar(100) declare @src int declare @desc varchar(1000)
DECLARE @@RETURNINFO varchar(255) BEGIN set @@returninfo='0:0:30' END
declare user_cursor cursor for (select top 1 productid,padurl from tblproddetails where padurl is not null and padmaincat is null) open user_cursor
fetch next from user_cursor into @productid,@padurl
while @@fetch_status=0 begin exec @hr=sp_oacreate 'CPollXML.clspollfile' ,@object out exec sp_oageterrorinfo @object,@src out,@desc out SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc IF @hr <> 0 select 'can not create object' exec @hr= sp_oamethod @object,'cpoll.StorePAD' ,'http://www.deskshare.com/sev.xml', '120' EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc IF @hr <> 0 BEGIN select 'harshal' EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc end --
WAITFOR DELAY @@DELAYLENGTH exec @hr=sp_oadestroy @object fetch next from user_cursor into @productid,@padurl end close user_cursor deallocate user_cursor end go -----------
I am not able to find what is wrong please help. regards, harshal.
The Judgement of the Judge is as good as the Judge. |
|
|
ehorn
Flowing Fount of Yak Knowledge
USA
1629 Posts |
|
|
harshal_in
Aged Yak Warrior
India
633 Posts |
Posted - 10/31/2003 : 08:14:15
|
could you please elaborate more ,I tried it but did not work
The Judgement of the Judge is as good as the Judge. |
 |
|
|
ehorn
Flowing Fount of Yak Knowledge
USA
1629 Posts |
Posted - 10/31/2003 : 08:16:25
|
| If your method is expecting an output param you must store it in a local variable (ie. @int) otherwise just use null. |
 |
|
|
harshal_in
Aged Yak Warrior
India
633 Posts |
Posted - 10/31/2003 : 08:29:09
|
thanks null was the solution thanks a lot ehorn.
The Judgement of the Judge is as good as the Judge. |
 |
|
| |
Topic  |
|
|
|