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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MsComCt2.ocx installation

Status
Not open for further replies.

TheBulldog

Programmer
Nov 29, 2001
11
US
I have a client using VFP 9.0 SP2 who has written a custom Date picker based upon _datetime.vcx. I want to avoid any of the issues alluded to in a Google search with Office versions from 2003 - 2010 (assume 2013 w.b a problem, too). Can we copy this file to the application's folder where we copy the VFP runtime files instead of installing it in the Windows/System32 folder?

TIA!

Mike
 
Yes, you can copy it there. You may still need to register it though.
Here's a way that may work for you. You can put this code in the startup app. The first time it is run, it will offer up a dialog to 'Run As', giving you the chance to run as administrator. It then creates a flag file if the ocx has been registered so it won't try to run again.

Code:
DECLARE INTEGER ShellExecute IN shell32.DLL ;
   INTEGER hndWin, ;
   STRING cAction, ;
   STRING cFileName, ;
   STRING cParams, ;
   STRING cDir, ;
   INTEGER nShowWin

IF !FILE("MsComCt2.flg")
   STORE ADDBS(SYS(5) + SYS(2003)) TO cCurrentPath
   IF ShellExecute(0, "runas", "regsvr32", cCurrentPath + "MsComCt2.OCX", "", 1) > 32
      MESSAGEBOX("MsComCt2.OCX registered.", 64, "Good to go.")
      STRTOFILE("Success", "MsComCt2.flg", 0)
   ELSE
      MESSAGEBOX("MsComCt2.OCX failed to register.", 16, "Control will need to be registered")
   ENDIF
ENDIF


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top