byref boolean parameter problems 
Author Message
 byref boolean parameter problems

Hi,

I am having trouble with a boolean byref parameter in a
component I am writing for use with both VB apps and vb
script i.e ASP.  

The component work fine in VB but in vb script I get a
type mismatch error.  If I place a CBool around the
parameter the error goes away but the value of the
parameter after the call is always wrong.  

I tried changing the parameter type to variant in the
component and it now works ok.  Does anyone know why it
doesn't work when it's a boolean parameter but does when
it is a variant.

Thanks

Mike Towers



Tue, 31 May 2005 21:38:23 GMT  
 byref boolean parameter problems

Quote:
> I tried changing the parameter type to variant in the
> component and it now works ok.  Does anyone know why it
> doesn't work when it's a boolean parameter but does when
> it is a variant.

Scripts use only Variants and you can't pass a Variant to a ByRef parameter
that is not a Variant (in this case Boolean). If you don't really need it to
be ByRef then use ByVal and won't be any problem in passing the Variant to
the function.

--
Eduardo A. Morcillo [MS MVP VB]
http://www.domaindlx.com/e_morcillo



Wed, 01 Jun 2005 00:11:53 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Problem of Passing Boolean Parameter to CR8.0

2. SQL doesnt accept boolean parameters !!!

3. call com object with byref byte parameters in vb.net

4. call com object with byref byte parameters in vb.net

5. ByRef parameter, simple questions..

6. > passing vb6 optional byref parameter into c#

7. Creating constructors with byref parameters

8. ByRef Parameters in Subs

9. Passing Parameters - A ByRef vs ByVal Question

10. Boolean parameters for Word Automation

11. Help, OA ByRef parameters not passed correctly

12. passing ByRef parameters

 

 
Powered by phpBB® Forum Software