Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to pass a null value to an ActiveX control

Status
Not open for further replies.

GriffMG

Programmer
Mar 4, 2002
6,288
1
38
FR
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 [Smile]ing

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.
 
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
 
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 [Smile]ing

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.
 
O and 9 don't work either.

Regards

Griff
Keep [Smile]ing

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.
 
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
 
Not tried COMarray, the rest I did experiment with.

Regards

Griff
Keep [Smile]ing

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.
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top