Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Deployment Foxpro application
#1
We have an existing Foxpro application where we are looking to replace the oleWebbowser that is packaged with vfp with Antview. We have established that it provides the functionality that we require however I am having an issue with its installation on client machines.

I have the 32 bit antview.ocx  on my development machine under C:\Program Files (x86)\AntView\Win32.

For our client machines we have number of ActiveX controls, therefore using a well know Installation builder we have them all installed and registered in a folder C:\Program Files (x86)\Common Files\ ... \Components.

I have therefore updated the installer project to put the AntView.ocx in this folder and am putting the WebviewLoader.dll in same folder as our exe.

I have verified that the antview.ocx is installed on the clients machine and that it has been registered correctly, and that WebviewLoader.dll  is in the folder of the exe,  however when I launch a formhat has the antview control on it I get the message cannot find C:\Program Files (x86)\AntView\Win32.ocx.

If I  copy the antview.ocx from the location it has been installed C:\Program Files (x86)\Common Files\ ... \Components to the a location that I have created which matches its location on my development machine  C:\Program Files (x86)\AntView\Win32. The form displays corrected and allows me to view the required webpage.

Since the antview control has been registered to the location  folder C:\Program Files (x86)\Common Files\ ... \Components, I am confused why the form is looking for the ocx in the location  C:\Program Files (x86)\AntView\Win32.

I realise that this is the location stored in the form ( when the control is added to the form during development) , but looking  at forms with other ActiveX controls, they also have the location of the control on the development machine, but use the location of the registered control on the clients machine.
I am wondering if there are  any suggestions / solutions for this issue
Reply
#2
Hello Richard,

Thank you for your question.

Quote:however when I launch a formhat has the antview control on it I get the message cannot find C:\Program Files (x86)\AntView\Win32.ocx.

The control itself does not have an error like that, at least we never put one in. Also not sure how it could tell that it can't find itself if it was not found in the first place.
This makes me think that the error comes from the FoxPro runtime.

That by itself means that at one time the control was registered at that particular location. This normally only happens if someone has run the Developer install that you can download from the antview.dev website.

Putting the control in a common folder is fine, but you have to register it in that location (from an elevated command prompt run the regsvr32 command from that folder location as: "regsvr32 -i AntView.ocx".
Optionally you can add the path.

Another way to diagnose this issue is to grab the "RegisterAssistant.exe" binary from a AntView 2.0 install at the Win32 folder (released earlier this week). The RegisterAssistant application shows both AntView 1.1 as well as AntView 2.0.
If you put that application in the Common folder than you can use that to register the AntView.ocx in that folder.
The application has no dependencies.

It also shows if the AntView control is registered and from at what path it is registered. It does this by instantiating the control via late binding and then returning the version number. As that loads the dll/ocx we can then simply check from what path it was loaded. That information is then returned in the application.

Hope this helps,
--
Wil
Reply
#3
Thanks for the Quick reply.
I established that the control was being registered to the components location using the RegisterAssitant.

I then realised that the error that I am getting is because the avdctrl.prg has an absolute path to C:\Program Files (x86)\AntView\Win32\AntView.ocx".

Where we have created dotnet com classes for use our foxpro applications  we are able to specify the "Implements xx IN " using the registered class name rather than a path to the dll/ocx, is this possible with the Antview event interface
Reply
#4
Hello Richard,

Good detective work. 
Yes, having the hard coded path there throwing that error makes perfect sense.

The question about if you can use IMPLEMENTS with a class name is more of a VFP question than an AntView one and I'm not a VFP expert. Having said that, the documentation suggests this should work for ActiveX controls and AntView is an ActiveX control, so yes I'd say that should work.

I tried the following in the new examples and the code still works.

Code:
    IMPLEMENTS IAntViewDocumentEvents IN "AntViewAx.AntViewDocument"

So I guess that means yes.

Note that the latest release introduced a function to return the path of where the control is registered (RegisteredPath). But that info is likely to late for your code to be able to use it as you first need to instantiate the control to use it.

--
Wil
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)