
Object variable or With block variable not set when calling COM Dll
I think we need to see the code for DoSomething. Right now you are passing in IsAnswer but it is set to Nothing, so if you are trying to access any properties
it will give you a nullref exception. Also, is IsAnswer passed Byval or Byref? It might work if you used ByRef.
Thanks,
Adam Braden, VB Team
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
Quote:
>Subject: Re: Object variable or With block variable not set when calling COM Dll
>Date: Thu, 10 Apr 2003 12:40:23 +0200
>Lines: 42
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
>Newsgroups: microsoft.public.dotnet.framework,microsoft.public.dotnet.framework.aspnet,microsoft.public.dotnet.languages.vb
>NNTP-Posting-Host: bzq-160-185.dsl.bezeqint.net 62.219.160.185
>Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:136712 microsoft.public.dotnet.languages.vb:101178
microsoft.public.dotnet.framework:41687
Quote:
>X-Tomcat-NG: microsoft.public.dotnet.languages.vb
>The DoSomething function gets a string and an object by reference (lsAnswer)
>and it should return a value in that object.
>Can someone help?
>Thanks
>> > I am calling a COM Dll from ASP.Net and I am getting this error:
>> > "Object variable or With block variable not set" on the calling the
>> > DoSomething function.
>> > My code is listed below:
>> > Dim lsAnswer As Object
>> > Dim lbResult As Boolean
>> > Dim loLaHttp5 As New LaHttp5.Commands()
>> > lbResult = loLaHttp5.DoSomething("Hello World", lsAnswer)
>> > loLaHttp5 = Nothing
>> > Can anyone help ?
>> > Thanks
>> What does DoSomething do? What type of object is it expecting as its
>> arguments? lsAnswer is not set to an instance of anything.
>> Chris
>> --
>> If you don't like lunchmeat, please remove it from my e-mail address to
>> send me an e-mail
--