×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How to pass a null value to an ActiveX control

How to pass a null value to an ActiveX control

How to pass a null value to an ActiveX control

(OP)
I am messing with the ExpertPDFEditor activex control again (I had a short play a couple of years ago).

I need to pass a null value to a method in the control called getNextObject(), VFP's null is not acceptable it would seem
so I have tried using another function from the activex that should return a null and fed that into the call, to no avail.

I could probably do this in C# and be done with it, but I a stubborn luddite and would like to try it in VFP first.

Any ideas?

Regards

Griff
Keep Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

RE: How to pass a null value to an ActiveX control

In Windows API function calls most often NULL is simply represented as 0.
.NULL should be translated (marshaled) as 9, too, but it may make a difference.
You may try to skip the parameter.

And if nothing like that works, what is the method parameterisation saying, literally? Not just intelisense but instructions/a manual?

Bye, Olaf.

Olaf Doschke Software Engineering
https://www.doschke.name

RE: How to pass a null value to an ActiveX control

(OP)
Thank Olaf,

I had tried leaving it out, that threw an error.

The null parameter is used to get the first object in the PDF, then you pass the object you have to get the next and so forth, so you can move through all the objects in a given page.

I will try the 0 and 9...

There is a help.chm, which is lengthy but sketchy and the examples are mostly in C# and VB and so far have been hard work.

I have not found much about the activex on the web either and very little on the authors web site. As yet!

Regards

Griff
Keep Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

RE: How to pass a null value to an ActiveX control

(OP)
O and 9 don't work either.

Regards

Griff
Keep Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

RE: How to pass a null value to an ActiveX control

Haha, sorry, the 9 was a typo. I meant to say when you specify .NULL. in VFP that's marshaled as 0 by OLE, but sometimes actually passing 0 yourself makes a difference.

If the help file doesn't help... How should I not even knowing anything else?

Of course, I wouldn't expect VFP sample code in general in the help, if someone doesn't specifically target VFP. a C# specification will be better than nothing to ponder on this.

There is no specific "magic" value or data structure or type of OLE-NULL that you can put in. I'm also not surprised you can't forward a NULL at that position you get from the ActiveX from somewhere else, because when it comes in as 0 that's what you put back, a nested call of method like oleobj.method1(oleobj.method2(x),y) where oleobj.method2(x) returns a "NULL" of some kind still goes through VFP and will not act differently than first setting z=oleobj.method2(x) and then doing oleobj.method1(z,y).

Or - in another anology, if a string translation from UTF-8 to ANSI results in a "?" character, that doesn't retranslate back to what it was with the inverse translation from ANSI to UTF-8. And like that, you may have no chance to pass in what the control expects.

It's not by chance an array parameter? VFP7 (I think) introduced COMArray() for specific OLE parameterization problems with arrays.

Did you try passing nothing literally? oleobj.method1(,y) instead of oleobj.method1(NULL,y)?

Bye, Olaf.

Olaf Doschke Software Engineering
https://www.doschke.name

RE: How to pass a null value to an ActiveX control

(OP)
Not tried COMarray, the rest I did experiment with.

Regards

Griff
Keep Smileing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.

RE: How to pass a null value to an ActiveX control

Well, it obviously only makes sense when the parameter in question is an array. I doubt in case of NULL it makes sense to use COMARRAY.

Bye, Olaf.

Olaf Doschke Software Engineering
https://www.doschke.name

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close