Thursday, March 22, 2012

Marshal in Asp.Net

Hi

I developed a component using 'Queue', it works fine at a Windows application, but i call it at the Asp .Net and return the error 'System.Runtime.InteropServices.COMException

Can I use the Marshal object at Asp .Net? If not what can i do to do some background process

I call at this way

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Clic
Dim Batch As BatchBR.IExport = Nothin
Dim Arg as Strin
Tr
Batch = CType(Marshal.BindToMoniker("queue:/new:BatchBR.Export"), IExport
Catch l As Exceptio
Console.WriteLine("Caught Exception: " & l.Message
End Tr
Batch.Process(Arg
Marshal.ReleaseComObject(Batch
End Su

Thank

Eltonmake sure aspcompat is set to true for you form this sets up some plumbing
in order for a webpage to call into a COM interface

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Elton Rabello" <anonymous@.discussions.microsoft.com> wrote in message
news:83995961-19F8-4658-A527-A85E6ADC94CE@.microsoft.com...
> Hi,
> I developed a component using 'Queue', it works fine at a Windows
application, but i call it at the Asp .Net and return the error
'System.Runtime.InteropServices.COMException'
> Can I use the Marshal object at Asp .Net? If not what can i do to do some
background process?
> I call at this way:
> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
> Dim Batch As BatchBR.IExport = Nothing
> Dim Arg as String
> Try
> Batch =
CType(Marshal.BindToMoniker("queue:/new:BatchBR.Export"), IExport)
> Catch l As Exception
> Console.WriteLine("Caught Exception: " & l.Message)
> End Try
> Batch.Process(Arg)
> Marshal.ReleaseComObject(Batch)
> End Sub
> Thanks
> Elton
Thanks, but i have a bigger problem, sometimes it works, sometimes not. Sometime is appears running at "Execution Process" at "Component Services", sometimes it don′t cause any error and not run at "Exectuion Process"

Thanks agai

Elton Rabello

0 comments:

Post a Comment