Visual Foxpro VFP and Variant Structure

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

bigdadxxl
User
Posts: 5
Joined: Wed Dec 19, 2007 3:00 pm

Visual Foxpro VFP and Variant Structure

Post by bigdadxxl »

Hi,
we recently bought the PDF- XChange ViewerSDK and PDF - Xchange Viewer SDK.
We are using the PDF-Viewer ActiveX; everything is fine except we can't retrieve any properties. ( b.e. GetDocumentProperty(), ... ) since we don't know how to pass the "variant structure".
To be onest - we don't know what that means.

We would really apprecitate any help. Thanks
Tracker - Clarion Support
Site Admin
Posts: 64
Joined: Wed Jun 30, 2004 4:45 pm
Location: Maryland, USA

Post by Tracker - Clarion Support »

Hi bigdadxxl!

VARIANT is a datatype used to pass "typed" information between Windows modules (exe's and dll's usually) in a relatively safe manner.

It's often used within classes and objects. Visual Foxpro 9.0 supports it, for definition see:

http://msdn2.microsoft.com/en-us/librar ... S.80).aspx

I also suggest looking at the Viewer Visual Basic (VB) examples as they should be close to what you will need.
Craig Ransom
Tracker Software - Clarion Support
http://www.tracker-software.com
bigdadxxl
User
Posts: 5
Joined: Wed Dec 19, 2007 3:00 pm

Post by bigdadxxl »

Hello Craig,

we already tried this:

LOCAL vData AS VARIANT
vData = ""
oPDFV.pdfviewer.GetProperty("General.ApplicationTitle",@vData,0)

We also tried out all other DataTypes with no result.
Other Functions like "GetActiveDocument" works well.

We also use several other ActiveX- Components in our application and since yet there are no problems retrieving data in that way.

We was confused about the variant "structure"; does the function "GetProperty" expect a special datatype or something like a null-terminated String ? ( we tried out this, too )

We also checked out the VBNet Samples; everything is fine there.

Since we are already working a long time on that problem , we appreciate your help.

Wolfgang Michelfelder
ids-software Ltd. & Co. KG ( Germany )
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom

Post by John - Tracker Supp »

Hi Wolfgang,

I am afraid we have no experience with VFP specifically - so we are shooting in the dark - however, I suspect its this line you need to look at and replicate as closely as possible from the VB example :

Dim vDataOut As Variant
Call CoPDFXCview1.GetProperty("General.ApplicationTitle", vDataOut, 0)

Hope that helps
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com
bigdadxxl
User
Posts: 5
Joined: Wed Dec 19, 2007 3:00 pm

Post by bigdadxxl »

Hi,

we are still working on that problem - without a solution.
Could you please post these lines of your source code which recieve the variant structure value ? We assume that we have to initalisize the variable in VFP in a different way so your function can handle it.

Thanks in award

Wolfgang Michelfelder
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom

Post by John - Tracker Supp »

Hi Wolfgang,

the easiest way I tink to resolve this is if you supply a complete - simple VFP project which inlcudes what you need (even if it does not work fully) and we will install VFP 9.x here and try and debug/correct for you.

Please supply all project files and any other files required - so we can compile and test/debug here - please ZIP and do not inlcude any license info in your source.

Many thanks.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com
bigdadxxl
User
Posts: 5
Joined: Wed Dec 19, 2007 3:00 pm

Post by bigdadxxl »

Hello,

thanks for your help. Here's a simple prg- file which contains all necessary coding.

Regards
You do not have the required permissions to view the files attached to this post.
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3556
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada

Post by Ivan - Tracker Software »

Solution for you:

Please replace the code

Code: Select all

oPDFViewer.pdfviewer.Property("General.ApplicationTitle", @vData, 0)
with

Code: Select all

vData = oPDFViewer.pdfviewer.Property("General.ApplicationTitle", 0)
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.
bigdadxxl
User
Posts: 5
Joined: Wed Dec 19, 2007 3:00 pm

Post by bigdadxxl »

Thanks !!

We changed from GetProperty(... ) to Property() ... it works! :D
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom

Post by John - Tracker Supp »

Excellent - looks like there is an issue in VFP you might want to pass back to MS.

:)
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com