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!

INstalling an ocx control

Status
Not open for further replies.

Bryan - Gendev

Programmer
Jan 9, 2011
408
0
16
AU
I am not succeeding with my installation of my ocx control.
I may have the inno compiler instruction in error.

I have
Source: C:\mypath\ImageViewer2.OCX; DestDir: "{app}"; Flags: regserver ignoreversion

Is this correct? Or do I have another problem?


Cheers

GenDev

 
Hello,

not sure but I remember that OCX should go to sys
Source: "File.ocx"; DestDir: "{sys}"; Flags: regserver

regards
tom

Do you install as admin ?
 
What OCX is it? If it is they tell

To install .ocx files, place the .ocx in the proper directory.

ocxme said:
Place 64-bit OCX in the '/Windows/System32' directory.
Place 32-bit OCX in the '/Windows/SysWOW64' directory.
Or, place the .OCX in the same location as the .exe

So the app directory is okay. In the end it only matters that an OCX is registered, but it may need to find a runtime.

If you switch (simply to try) to {sys}, remember, VFP executablkes can only use a 32bit OCX and that should go into SysWoW64, not System32. And I don't know how Inno handles that, but in itself it surely creates 64bit setup executables, to which {sys} would mean System32. Even if you're specific about that and guide the 32bit OCX into the SysWow64 directory, I'm not sure how Innno would handle registration goes into the 32bit branch of the registry, i.e. there should be something that's telling Inno it's dealing with a 32bit software setup.


Chriss
 
Chriss,
My two problems with the imageviewer2 OCX are confusing.
. The 'installed' ocx on my dev PC works absolutely correctly with the .imageviewer.licensekey = '12345'showing in the properties.

. The ocx control in the installed app on my laptop does not work - either
1 giving a file selection widget with the ocx file located in the {app} folder. Clicking this gives a not registered type of error. Or
2 trying to put the licensekey in the load event of the form causes their 'This is a demo' message.

Trying to test using their examples - entering the license number with
.imageviewer.licensekey = '12345' on their sample form load event as instructed etc gives a Programm Error nknown member IMAGERVIEWER1. messsage.
So I am querying both the registration of the ocx on the laptop and the licensing information method.

Regards
GenDev
 
Gendev,

what contgrol is it? I asked, if it is the OCX from OCXme, because I think there could be lots of controls called ImageViewer2, it's such a generic name.

gendev said:
unknown member IMAGERVIEWER1. messsage.
Thqat error message comes from the situation the OCX is not registered, then a form will start without that control, and of course you cannot set a property of an unexisting object, whch leads to that error. So you have to focus on the right way to register the OCX with a setup.

Can you simply post your full Inno setup script?

Chriss
 
Here is my (disguised) Inno file
[Setup]
various entries
[Dirs]
Name: {app}
various entries

[Tasks]
Name: desktopicon; Description: Create a &Desktop icon; GroupDescription: Additional icons:
Name: quicklaunchicon; Description: Create a &Quick Launch icon; GroupDescription: Additional icons:

[Files]

Source: U:\Dev\_FoxPro\Dist_Folders\MyApp_Dist\CSV\*.csv; DestDir: {userdocs}\MyApp Reports\CSV ; Flags: ignoreversion
Source: U:\Dev\_FoxPro\Dist_Folders\MyApp_Dist\CSV\*.csv; DestDir: "{app}"; Flags: ignoreversion
Source: U:\DEV\_FoxPro\Dist_Folders\MyApp_Dist\ImageViewer2.OCX; DestDir: "{app}"; Flags: regserver ignoreversion
Source: U:\Dev\_FoxPro\Dist_Folders\MyApp_Dist\*.*; DestDir: "{app}"; Flags: ignoreversion
Source: U:\Dev\_FoxPro\Dist_Folders\MyApp_Dist\Programfull\*.*; DestDir: "{app}"; Flags: ignoreversion
Source: U:\Dev\_FoxPro\Dist_Folders\Runtimes\*.*; DestDir: "{app}"; Flags: ignoreversion
Source:U:\DEV\OCXTest\ImageViewer2.OCX; DestDir: "{app}"; Flags: regserver ignoreversion
Source:U:\DEV\OCXTest\*.* ; DestDir: "{app}"; Flags: ignoreversion
Name: {group}\MyApp; Filename: {app}\MyApp.exe; WorkingDir: {app}
Name: {group}\Uninstall MyApp; Filename: {uninstallexe}
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\MyApp;Filename: {app}\MyApp.exe; IconFilename: {app}\MyApp.ico; WorkingDir: {app};Tasks: quicklaunchicon
Name: {userdesktop}\MyApp; Filename: {app}\MyApp.exe; WorkingDir: {app}; IconFilename: {app}\MyApp.ico; Tasks: desktopicon
[Install]

Type: files; Name: "U:\_OUTPUT\MyAppSetup"
OutputDir=U:\_OUTPUT

Filename: {app}\MyApp.exe; Description: Launch MyApp!; Flags: nowait postinstall skipifsilent
Code:
procedure InitializeWizard();
var
  SplashImage: TBitmapImage;
  SplashForm: TForm;
  SplashFileName: String;
  I : Integer;
begin

  SplashFileName := ExpandConstant('{tmp}\splash2.bmp');

  ExtractTemporaryFile(ExtractFileName(SplashFileName));

  SplashForm := TForm.create(nil);
  with SplashForm do
   begin
    BorderStyle := bsNone;
    Position := poScreenCenter;
    // Adjust the height and width of the SplashForm to the size of your splash image
    ClientWidth := 405;
    ClientHeight := 310;
   end;

  SplashImage := TBitmapImage.Create(SplashForm);
  with SplashImage do
    begin
    Bitmap.LoadFromFile(SplashFileName);
    Stretch := true;
    Align := alClient;
    Parent := SplashForm;
    end;

  with SplashForm do
   begin
     Show;
     Repaint;
     // show for 4 seconds
     for I := 1 to 4 do
      begin
       Sleep(1000);
      end;
     Close;
     Free;

   end;
end;
[Messages]
WizardInfoBefore=

GenDev
 
Thanks,

but for the second time you didn't answer the question, what's your OCX? Is it the one described here?
As you mention your OCX has a licensing scheme, it seems to me, this is not that free OCX, but what is it? We can only guide you more precisely, if we have that information and can read into the documentation of the OCX you actually use.

Chriss
 
Sorry Chriss,

It's Image Viewer CP Pro Active X Control from Viscomsoft

GenDev
 
What files do you have in U:\DEV\OCXTest\?

The OCX installation directory has a REDSIT subfolder with a readme.txt that in all detail lists all files you have to redistribute and under which circumstances you need which additional files for which functionalities.

I think your OCXTest folder does not contain everything you need to redistribute.

Chriss
 
Hi Chriss,

The contents of U:\DEV\OCXTest\ is
-a---- 02/02/2005 17:07 1773568 gdiplus.dll
-a---- 06/11/2007 12:58 1978368 ImageViewer2.OCX
-a---- 08/12/1999 12:00 995383 mfc42.dll
-a---- 23/07/2002 18:05 290869 msvcrt.dll
-a---- 18/06/2011 15:56 30 Serial.txt
-a---- 26/01/2007 13:45 520192 viscompdf.dll
THis is the listin the REDIST folder


1. imageviewer2.ocx (need use regsvr32 command to register this component)
2. gdiplus.dll
3. viscompdf.dll
4. msvcrt.dll
5. mfc42.dll

Regards
GenDev
 
Please read again. You missed at least one remark:

10. Additionally, some files depending of the language of recognition must be accessible.

And I'm not saying this is the last thing missing.

Chriss
 
On top of that, at the beginning of the readme.txt file are listed:

[pre]5. viscomgifenc.dll (same as imageviewer2.ocx folder)
6. viscompsd.dll (same as imageviewer2.ocx folder)
7. viscomdocx.dll (same as imageviewer2.ocx folder)[/pre]
and there's more to it, my readme.txt bullet list goes to position 18.

The numbering of the files don't match yours, so maybe it's because I downloaded a newer version than you have. So could you perhaps post your readme.txt so we can look over it?

Chriss
 
Hi Chriss,

If you create a setup program for your application, you must install another dll files. the table below shows all the

files necessary for Image Viewer CP Pro ActiveX Control to operate properly.

You must ensure that the files exist on your client's machine and they are the proper version. If your client's machine has

older versions of these files, you should update them.


1. imageviewer2.ocx (need use regsvr32 command to register this component)
2. gdiplus.dll
3. viscompdf.dll
4. msvcrt.dll
5. mfc42.dll

GenDev
 
Okay then these w lines of you inoo script provide all the necessary files into the {app} folder:

[pre]Source:U:\DEV\OCXTest\ImageViewer2.OCX; DestDir: "{app}"; Flags: regserver ignoreversion
Source:U:\DEV\OCXTest\*.* ; DestDir: "{app}"; Flags: ignoreversion[/pre]

And the regserver flag registers the ImageViewer2.OCX file. But what if you first have to have all necessary files and can only register successfully when they exist?

So in short: How about swapping these two lines of your setup?

Chriss
 
There's another point: The gdiplus.dll the OCX uses, may differ from the one VFP9 uses. You don't have a problem with vfp9.exe in the IDE and on you development computer, as OCX and vfp9.exe are in separate directories and each finds their own gdiplus.dll. There's a detail problem I think with two gdiplus.dll versions as gdiplus usage needs an initialisation and I wonder what happens if the VFP runtime initialises its dll for its usage and the OCX the other, but we don't have to go down that rabbit hole as the OCX works in your tests on the dev computer, so there's no gdiplus.dll concurrency problem. But it still may pay off to really install the OCX into {sys} or into a subfolder of the {app} folder.

Chriss
 
HI Chriss,
I did this but no change HOWEVER at the top of the WIN dialogue box I see in small print

Locate mscomctl.ocx
Using Wizfile on my dev pc I see that this is in SysWOW64
However I do not see that file on my Laptop -
1 I wonder what I need to do to get it
2 Is it likely to be on my old users PCs

Gendev

 
Well, is that related to the Imageviewer OCX? I thibnk not.

mscomctl.ocx are the Microsoft common controls and VFP has them in it's manifest. It's an optional file for a VFP built exe, if you don't use a common control, like a treeview, a slider and some more controls like that.

like the imageviewer2.ocx, its not standalone, either. But it won't be necessary for the imageviewer2.ocx to work, that's for sure.

Chriss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top