How to installl on the ActiveX computer?

This forum is for eXpress++ general support.
Message
Author
Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: How to installl on the ActiveX computer?

#11 Post by Cliff Wiernik »

No, I was not talking about a 64 bit ocx. For example, the GDPicturePro 5.x OCX is a 32 bit ocx used for com communications from visual basic 6 and accessible from Xbase++ via activeX. Use it for TIF file display in a document viewer.

It is installed on WinXP machines in the folder c:\windows\system32. Try to to than in C:\windows\system32 on a Windows 7 machine and OCX will not register (even as an administrator). Copy the file to c:\windows\syswow64 and the OCX can be registered using the exact same command.

I did a install of the entire GDPicturePro5 software library tool on a windows 7 machine and indeed that is where it was installed. Our procedures tried to use the same location as for winXP machines and it did not work. Needed to be in syswow64.

Cliff

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: How to installl on the ActiveX computer?

#12 Post by Eugene Lutsenko »

I tried to establish ActiveX RMChart.ocx programmatically that it was more convenient to the user.
Team: RunShell("","c:\Windows\System32\regsvr32.exe RMChart.ocx",.F.)
gives an error of execution, and
team: Run("c:\Windows\System32\regsvr32.exe RMChart.ocx")
comes to the end normally and the message on a successful conclusion of operation is issued too, but at execution the window with the black background, similar to a dos-window opens.

How to execute this team by means of RunShell?
Last edited by Eugene Lutsenko on Sat Mar 16, 2013 8:57 pm, edited 1 time in total.

Wolfgang Ciriack
Posts: 479
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: How to installl on the ActiveX computer?

#13 Post by Wolfgang Ciriack »

You can use this code, f.e.

Code: Select all

   if !RegisterServer(".\Codejock.Controls.v13.0.0.ocx", .T.,5000)
      DC_WinAlert(" Codejock.Controls.v13.0.0.ocx registration error !")
      return NIL
   else
      DC_WinAlert("Codejock.Controls.v13.0.0.ocx registration ok !")
   endif

Code: Select all

#define WAIT_ABANDONED            0x80
#define WAIT_FAILED               0xFFFFFFFF
#define WAIT_OBJECT_0             0x0
#define WAIT_TIMEOUT              0x102
#define INFINITE                  0xFFFF

DLLFUNCTION LoadLibraryA(cFileName) USING STDCALL from kernel32.dll
DLLFUNCTION FreeLibrary(hModule) USING STDCALL from kernel32.dll
DLLFUNCTION GetProcAddress(hModule, ProcedureName) USING STDCALL from kernel32.dll
DLLFUNCTION CreateThread(ThreadAttributes, nStackSize, nStartAddress, nParameter, nCreationFlags, nThreadID) USING STDCALL from kernel32.dll
DLLFUNCTION GetExitCodeThread(hThread, @nExitCode) USING STDCALL from kernel32.dll
DLLFUNCTION WaitForSingleObject(hObject, nTimeOut) USING STDCALL from kernel32.dll
DLLFUNCTION CloseHandle(hObject) USING STDCALL from kernel32.dll

function RegisterServer(cPathToFile, lRegister, nTimeOut)
local hModule, lProcAddress, hThread
local nThreadID,  lResult, nExitCode := 0, lRet := .f.

  if valtype(lRegister) # "L"
    lRegister := .t.
  endif

  if valtype(nTimeOut) # "N"
    nTimeOut := 5000
  endif

  hModule := LoadLibraryA(cPathToFile)
  If hModule == 0
    return .f.
  Endif

  lProcAddress := GetProcAddress(hModule, IIf(lRegister, "DllRegisterServer", "DllUnregisterServer"))
  If lProcAddress == 0
    FreeLibrary(hModule)
    return .f.
  Endif

  hThread := CreateThread(NIL, 0, lProcAddress, 0, 0, nThreadID)
  If hThread == 0
    FreeLibrary(hModule)
    return .f.
  Endif

  lResult := WaitForSingleObject(hThread, nTimeOut)

  If lResult = WAIT_OBJECT_0
    GetExitCodeThread(hThread, @nExitCode)
    If nExitCode == 0
      lRet := .t.
    EndIf
  EndIf

  CloseHandle(hThread)
  FreeLibrary(hModule) 
return lRet
_______________________
Best Regards
Wolfgang

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: How to installl on the ActiveX computer?

#14 Post by Eugene Lutsenko »

In attempt to load ActiveX into Windows 7 there is a mistake:


http://disk.yandex.ru/public/?hash=mMHc ... VkzsgSo%3D


What to do?

Wolfgang Ciriack
Posts: 479
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: How to installl on the ActiveX computer?

#15 Post by Wolfgang Ciriack »

Try to run cmd as Administrator.
_______________________
Best Regards
Wolfgang

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: How to installl on the ActiveX computer?

#16 Post by Eugene Lutsenko »

Yes, thank you very much! When the error message should be in the window: <Control Panel - User Accounts and Family Safety - User Accounts - Change User Account Control Settings> move the slider all the way down to "Never notify ..." and reboot

User avatar
unixkd
Posts: 565
Joined: Thu Feb 11, 2010 1:39 pm

Re: How to installl on the ActiveX computer?

#17 Post by unixkd »

There is program called MoleBox Virtualization Solution. It works well. Combine all your DLLs/OCX etc into a single executable file. So you distribute just one file and your Data folder. Check www.molebox.com. It registers ACTIVEX components AUTOMATICALLY without changing the setting of the target machine - VIRTUALIZATION.

Joe.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: How to installl on the ActiveX computer?

#18 Post by Eugene Lutsenko »

Thank you! It looks like this is what I need and that improves Alaska. I will surely try!

Post Reply