Hello George,

That is strange, if I try the line 

Msgbox typename(vbNullPtr) & " " & vbNullPtr

in eVB and run the code I get an error that variable vbNullPtr is not
defined. But then when I use the vbNullPtr in a declared function
call, it works ! I have triple-checked and did not make a writing mistake.

It looks like eVB is only accepting this constant as a parameter for
declared functions.

What I am trying to do is to use the Resco ZIP DLL, here is the sample
code (NS Basic) :

Option Explicit

Declare "Sub RZipInit Lib ""RZip.dll"" (ByVal uCode As Long, ByRef
lpCallbackFunc As Long)"

Call RZipInit (57236465, vbNullPtr)

This code works fine in eVB but NS Basic gives me an error that
vbNullPtr is not defined. 

I have then done further testing in eVB and NS Basic and found that I
cannot substitute vbNullPtr with anything else, i.e. Null, nothing,
vbNull, 0, vbNullString, vbNullChar. In that case the code runs but
the function fails. ONLY vbNullPtr works. I guess that is the reason
why Microsoft added the vbNullPtr in the first place.

It looks like the code in the RZipInit dll checks this parameter for
NULL (as in C++), i.e. 
if (param2 == NULL) DoSomething
The dll call obviously converts anything except vbNullPtr to something
else than NULL (as defined in C)


Then... is there any way to use or substitute vbNullPtr in NS Basic or
any other trick to make this work ?

Thanks for your help.




--- In [email protected], "George Henne" <g...@...> wrote:
>
> My copy of eVB has decided it does not want to work anymore, so I can't
> try this here at the moment.
> 
> Write a short eVB program that does
> 
> Msgbox typename(vbNullPtr) & " " & vbNullPtr
> 
> Hopefully, that will give the answer. Let us know, so we can add this to
> the Tech Note.
> 
> >Hi,
> >
> >I need to call an function in a dll with a vbNullPtr (this is
> >pre-defined in eVB) value in a parameter. What is the substitute for
> >vbNullPtr in NS Basic ? I tried Null but that did not work.
> >
> >Thanks !
> >
> >
> >------------------------------------
> >
> >Yahoo! Groups Links
> >
> >
> >
>



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nsb-ce" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nsb-ce?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to