Object variable or With block variable not set when calling COM Dll 
Author Message
 Object variable or With block variable not set when calling COM Dll

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



Sun, 25 Sep 2005 18:10:58 GMT  
 Object variable or With block variable not set when calling COM Dll
It's seems to me that itdoesn't look like you are instantiating lsAnswer
because is an object, needs to be instantiated

Francisco


Quote:
> 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




Sun, 25 Sep 2005 18:29:24 GMT  
 Object variable or With block variable not set when calling COM Dll
It does not work also if I do:
Dim lsAnswer As New Object = ""

Any help ?


Quote:
> It's seems to me that itdoesn't look like you are instantiating lsAnswer
> because is an object, needs to be instantiated

> Francisco



> > 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




Sun, 25 Sep 2005 20:08:14 GMT  
 Object variable or With block variable not set when calling COM Dll
in which line u got error
it seems that in "Dim lsAnswer As Object"

can u say error line?

-mani


Quote:
> 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




Sun, 25 Sep 2005 19:34:33 GMT  
 Object variable or With block variable not set when calling COM Dll

Quote:
> 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



Sun, 25 Sep 2005 21:23:31 GMT  
 Object variable or With block variable not set when calling COM Dll
The error is on that line:
lbResult = loLaHttp5.DoSomething("Hello World", lsAnswer)

Any idea ?


Quote:
> in which line u got error
> it seems that in "Dim lsAnswer As Object"

> can u say error line?

> -mani



> > 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




Mon, 26 Sep 2005 18:38:26 GMT  
 Object variable or With block variable not set when calling COM Dll
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


Quote:


> > 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



Mon, 26 Sep 2005 18:40:23 GMT  
 Object variable or With block variable not set when calling COM Dll


Quote:
> The DoSomething function gets a string and an object by reference

Inside DoSomething do you use Set to assign a value to lsAnswer?  Does the
error occur inside DoSomething?

--
If you don't like lunchmeat, please remove it from my e-mail address to
send me an e-mail



Mon, 26 Sep 2005 21:15:45 GMT  
 Object variable or With block variable not set when calling COM Dll


Ignore the part about Set in that last post.  My brain was set on VB6 and
not VB.Net.  But is lsAnswer being initialized to something inside
DoSomething?  Can you show us the code for DoSomething?

--
If you don't like lunchmeat, please remove it from my e-mail address to
send me an e-mail



Mon, 26 Sep 2005 21:17:22 GMT  
 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

--


Mon, 03 Oct 2005 05:18:41 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. Error msg: Object variable or With block variable not set

2. Object variable or With block variable not set (Error 91)

3. Object variable or With Block variable not set

4. error 91 Object Variable o on with block variable is not set

5. Object variable or With block variable not set

6. ADO recordset: Object variable or with block variable not set

7. Runtime error 91/Object variable or With block variable not set problems

8. Object variable or With block variable not set

9. Object variable or with block variable not set

10. Object variable or With block variable not set error in Class

11. runtime error: 91 Object variable or with block variable not set

12. Object variable or With block variable not set when using simple class example

 

 
Powered by phpBB® Forum Software