-
Aug 9th, 2017, 10:57 PM
#1
Thread Starter
New Member
Hi friends
Someone knows, how I can register the controls ocx in syswow64 without using cmd?
-
Aug 10th, 2017, 12:17 AM
#2
Re: Hi friends
Did you copy them manually??
-
Aug 10th, 2017, 05:36 AM
#3
Re: Hi friends
Originally Posted by Andy Master
Someone knows, how I can register the controls ocx in syswow64 without using cmd?
You could put the command in a .bat file and register it by shelling it.
Please remember next time...elections matter!
-
Aug 10th, 2017, 09:34 AM
#4
Addicted Member
Last edited by Inside; Aug 10th, 2017 at 09:36 AM.
Reason: Add date of 1st program:
Programmers are very patient people....while programming....but don't expect them to be patient all the time
-
Aug 10th, 2017, 10:03 AM
#5
Re: Hi friends
Normally you don't need to register a component which is located in syswow64. :-/
-
Aug 10th, 2017, 10:42 AM
#6
Re: Hi friends
Originally Posted by Arnoutdv
Normally you don't need to register a component which is located in syswow64. :-/
That depends on how it got there.
Please remember next time...elections matter!
-
Aug 10th, 2017, 05:02 PM
#7
Thread Starter
New Member
Re: Hi friends
Thanks friends, I really have used CMD, but it takes long time....
I have Windows 10 64 bits, in cmd, it takes a lot of time listing to give permissions, I do not know if there is any other way, other than using cmd, I takes one minute but in other pcs, could be takes more...
My recent code in vb6 with cmd for to do it is this...
Code:
Public Function RegistrarOcxDllWin64(ByVal Hwnd As Long, Optional ByRef DireccionD As Variant) As Boolean
On Error Resume Next
If Not EsMatriz(DireccionD) Then
If DireccionD = "" Then GoSub AgregarDD
End If
Dim C As String
Dim Direccion As String, I As Long, NR As Integer
SendMessage Hwnd, BCM_SETSHIELD, 0&, 1&
'Concatenar C, "/Q", True
Concatenar C, "@echo off", True
Concatenar C, "IF ERRORLEVEL 2 GOTO ERROR", True
Concatenar C, "takeown /f " & LeerRutaEspecial(WindowsCarpetaIni, True, "SysWOW64") & " /r /d s", True
Concatenar C, "icacls " & LeerRutaEspecial(WindowsCarpetaIni, True, "SysWOW64") & " /grant Administradores:F /t", True
If EsMatriz(DireccionD) Then
For I = LBound(DireccionD) To UBound(DireccionD)
If DireccionD(I) = "" Then GoTo S1
Direccion = DireccionD(I)
GoSub AgregarC
SumVar NR
S1:
Next I
Else
If Direccion = "" Then GoTo S2
Direccion = CStr(DireccionD)
GoSub AgregarC
SumVar NR
S2:
End If
If NR < 1 Then Exit Function
Concatenar C, "CD " & LeerRutaEspecial(WindowsCarpetaIni, True, "System32\"), True
If EsMatriz(DireccionD) Then
For I = LBound(DireccionD) To UBound(DireccionD)
Direccion = DireccionD(I)
GoSub AgregarR
Next I
Else
Direccion = DireccionD
GoSub AgregarR
End If
Concatenar C, "EXIT", True
Concatenar C, ":ERROR", True
EscribirArchivo C, DirAct(True) & "ACMDExt.bat"
Dim H2 As Long
H2 = ShellExecute(Hwnd, "runas", DirAct(True) & "ACMDExt.bat", "", CurDir$(), vbHide)
I = 0
Do While ExisteProceso("CMD.EXE")
Sleep 1000
SumVar I
If I >= 120 Then Exit Do
Loop
Dim NC As Long ' Numero de Comprobaciones
If EsMatriz(DireccionD) Then
For I = LBound(DireccionD) To UBound(DireccionD)
Direccion = DireccionD(I)
If ExisteAC(LeerRutaEspecial(WindowsCarpetaIni, True, "SysWOW64\") & SNA(Direccion)) Then SumVar NC
Next I
Else
Direccion = DireccionD
If ExisteAC(LeerRutaEspecial(WindowsCarpetaIni, True, "SysWOW64\") & SNA(Direccion)) Then SumVar NC
End If
If NR = NC Then RegistrarOcxDllWin64 = True
EliminarArchivo DirAct(True) & "ACMDExt.bat", True
Exit Function
AgregarC:
Concatenar C, "CD " & SoloPath(Direccion), True
Concatenar C, "Copy " & SNA(Direccion) & " " & LeerRutaEspecial(WindowsCarpetaIni, True, "SysWOW64\ /Y"), True
Return
AgregarR:
Concatenar C, "regsvr32.exe /S " & LeerRutaEspecial(WindowsCarpetaIni, True, "SysWOW64\" & SNA(Direccion)), True
Return
AgregarDD:
Dim UDD As Long
UDD = -1
Agregar:
GoSub AgregarDDD
DireccionD(UDD) = OpenDialog(, "Ocx o Dll|*.Ocx;*.Dll", "Registrar ocx o dll")
If DireccionD(UDD) = "" And UDD < 1 Then Exit Function
If DireccionD(UDD) = "" Then
ReDim Preserve DireccionD(UDD - 1): SumVar UDD, -1
Else
If Msg("¿Quiere agregar otra ocx o dll a registrar?", vbQuestion + vbYesNo, "Agregar otra dll u ocx") = vbYes Then GoTo Agregar
End If
Ya:
Return
AgregarDDD:
If UBound(DireccionD) < 0 Then
ReDim DireccionD(0)
Else
ReDim Preserve DireccionD(UDD + 1)
End If
UDD = UBound(DireccionD)
Return
End Function
I have made other functions like Concatenar, SumVar, Leerrutaespecial, many months ago...
But I need to know, how to register the ocx with admin permissions with vb6 only
I hope that my code helps you understand me, and if it works for you, I would like that too.
Sorry for my English
Greetings.
-
Aug 11th, 2017, 02:38 AM
#8
Addicted Member
Re: Hi friends
The register Control program I written yesterday, here it is in after I modified it a bit:
!Control Register JJ.zip
Last edited by Inside; Aug 11th, 2017 at 02:39 AM.
Reason: Twiddle mouse clicks go wrong :D
Programmers are very patient people....while programming....but don't expect them to be patient all the time
-
Aug 11th, 2017, 02:44 AM
#9
Re: Hi friends
@Andy Master, why not use a normal installer instead of copying and registering OCX files yourself?
This can really mess up someones installation.
-
Aug 12th, 2017, 12:25 AM
#10
Thread Starter
New Member
Re: Hi friends
Thanks Inside, but it doesn't work in my windows 10 64 bits, but I appreciate your help.
In previous versions of windows this worked fine.
I have a PC with WinXP and this one with Win10.
I am seeing many changes now with this windows 10, since I had always used windows xp, but I will have to keep investigating until I find a faster solution.
Thanks a lot again.
-
Aug 12th, 2017, 12:27 AM
#11
Thread Starter
New Member
Re: Hi friends
Hi Arnoutdv.
I do not know how to use the msi installer with my programs, if you can explain how to do it I would greatly appreciate it.
-
Aug 12th, 2017, 02:21 AM
#12
Addicted Member
Re: Hi friends
Originally Posted by Andy Master
Thanks Inside, but it doesn't work in my windows 10 64 bits, but I appreciate your help.
Strange... I only use windows 10 64...
You can:
[folder where VB6 is installed]\VB6.EXE RClick and set Properties:
Last edited by Inside; Aug 12th, 2017 at 02:24 AM.
Programmers are very patient people....while programming....but don't expect them to be patient all the time
-
Aug 12th, 2017, 01:36 PM
#13
Re: Hi friends
I assume it's not for your own PC, so you really should use an installer or switch to Side-by-Side installations.
Otherwise you are going to ruin some windows installations
-
Aug 12th, 2017, 11:51 PM
#14
Thread Starter
New Member
-
Aug 13th, 2017, 01:14 AM
#15
Re: Hi friends
Use the Package & Deployment Wizard which comes with VB6
-
Aug 13th, 2017, 02:49 PM
#16
Thread Starter
New Member
Re: Hi friends
Hi Arnoutdv, I used it, but error again , Do you have an idea of why this happens?
-
Aug 14th, 2017, 12:30 AM
#17
Re: Hi friends
Are you somehow using controls in your project which are not registered on your computer??
-
Aug 14th, 2017, 11:20 PM
#18
Addicted Member
Re: Hi friends
Something strange with my program:
It does not register some controls when I run it while it's compiled, but register all controls so far when I only run it from the VB design "RUN" / F5.
Why? I do not know...
Programmers are very patient people....while programming....but don't expect them to be patient all the time
-
Aug 15th, 2017, 12:15 AM
#19
Re: Hi friends
I think your IDE is running with elevated rights and the created executable is not.
-
Aug 15th, 2017, 12:29 AM
#20
Thread Starter
New Member
Re: Hi friends
Hi Arnoutdv and Inside, I guess the control is registered by this...
But then I see that the control is not found automatically in syswow64...
I don't understand well...
-
Aug 15th, 2017, 02:28 AM
#21
Re: Hi friends
I think you already have a messed up system.
Having the control in multiple folders is not okay.
The C:\Windows\SysWow64\mscomctl.ocx looks the like the valid location and is the registered version.
Where does the second screenshot (with the OCX located in ..\Documents\..) come from?
Is it a different project??
-
Aug 15th, 2017, 02:33 AM
#22
Thread Starter
New Member
Re: Hi friends
Yes it is different project, but I thought that was automatic detection of the only registered mscomctl.ocx
-
Aug 15th, 2017, 02:34 AM
#23
Thread Starter
New Member
Re: Hi friends
One project was from "Inside" and the other is "my project"
-
Aug 15th, 2017, 03:23 AM
#24
Re: Hi friends
The you really should not touch the version in ..\documents\.. , you are really going to ruin your system!
-
Aug 15th, 2017, 03:52 AM
#25
Thread Starter
New Member
Re: Hi friends
Yes I understand you, that is why I copied the ocx files to SysWOW64 for to register them, like said that page...
https://support.microsoft.com/es-mx/...error-messages
-
Aug 15th, 2017, 03:54 AM
#26
Thread Starter
New Member
Re: Hi friends
also that is why, I don't understand it:
-
Aug 15th, 2017, 06:18 AM
#27
Re: Hi friends
If you installed VB6 property then there is already a correct and registered version of MSCOMCTL.OCX in the correct location.
What are you doing with these system OCX files that you are copying them around??
-
Aug 15th, 2017, 06:58 AM
#28
Re: Hi friends
If MSComCtl.ocx is to be successfully installed, it must be installed into C:\Windows\System32 though if your system root is different it might be another drive letter and "Windows" could be named something else.
This is spelled out in MSComCtl.dep:
Code:
; Dependency file for setup wizards.
[Version]
Version=6.1.97.82
; Dependencies for MSComCtl.ocx
; Default Dependencies ----------------------------------------------
[MSComCtl.ocx]
Dest=$(WinSysPath)
Register=$(DLLSelfRegister)
Version=6.1.97.82
Uses1=ComCat.dll
Uses2=
CABFileName=MSComCtl.cab
CABDefaultURL=http://activex.microsoft.com/controls/vb6
CABINFFile=MSComCtl.inf
[ComCat.dll]
Dest=$(WinSysPathSysFile)
Register=$(DLLSelfRegister)
Uses1=
:
:
Any 32-bit installer, whether a PDW Setup or an Installer MSI package, will automatically deal with Win64 issues via the file redirection (Wow64FsRedirection) feature in Windows.
The installer must run elevated, and it should be responsible for registering an installed OCX. Registry redirection takes care of any x64 issues here as well.
Trying to stuff these kinds of files onto a non-system drive (much less a network share - I cringe at the thought) is a recipe for disaster even if you somehow manage to get it to work. That isn't a supported configuration even when using Activation Context manifests unless each such file has been marked to run from swap memory, and even then it is only meant for something like an installer. But if you try to register such files in a funky location you do indeed risk breaking other applications.
You are breaking too many rules and it has bit you in the rear. People got themselves into deep trouble trying tricks like always logging on as an Administrators or Power Users user so they could pretend they were still on Windows 95. This left machines very insecure, so after XP we got UAC and the elimination of Power Users to help secure PCs for people who have these bad habits.
It sounds like you have now managed to break your development PC as well.
Trying to go from 2001's Windows XP used in "pretend we still use Windows 95 mode" to 2015's Windows 10 in one jump was bound to give you fits. You are trying to program from a perspective that is now over 20 years behind the times. You have a lot of bad habits to unlearn, and some 20 years of changes to learn.
I just don't know how we can help you. You have pulled out onto a freeway in a horse-drawn carriage. VB6 is not a "beginner's language" but a tool for professionals. That is exactly why after such a very bad experience with VB5 Microsoft eliminated the "Standard Edition" previously sold to hobby users.
Last edited by dilettante; Aug 15th, 2017 at 07:02 AM.
-
Aug 15th, 2017, 02:18 PM
#29
Thread Starter
New Member
Re: Hi friends
If I understand those bad habits for that very reason I want to correctly register the activex controls in their correct folders, but it turns out that when I wanted to run a program made in vb6 here in Windows 10, this one did not run and I did not know how to do an installer, it is So I asked for help to be told how to do a normal installer too.
-
Aug 15th, 2017, 02:44 PM
#30
Re: Hi friends
Then why do you try to register the OCX from such a strange location?
Based on your IDE screenshot the control is already registered from within the correct location.
-
Aug 15th, 2017, 08:28 PM
#31
Thread Starter
New Member
Re: Hi friends
No!, I have never registered that control in this location, but I thinking why it takes this location....
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|