View Full Version : رجیستری کردن فایل های OCX
siyn71
جمعه 13 اردیبهشت 1392, 13:40 عصر
سلام..من میخوام ocx های برناممو رجیستری کنم..
تو نت که میچرخیدم گفتن این دستورو regsvr32 comdlg32.ocx تو یه نوت پد نوشته و به فرمت bat ذخیره کرده و با اجرای این فایل ؛ ocx هات رجیستری میشن..
خوب این کار عملی میشه و انجام میده ؛ اما من میخوام این کارو خوده برنامم انجام بده و بیاد فایل هارو رجیستری کنه..
دوستان کسی بلده که چطوری این دستور رو (regsvr32 comdlg32.ocx) بجای نوشتن تو نوت پد ؛ توی وی بی به کار برد و فایلارو رجیستری کرد؟
saeedhord
شنبه 14 اردیبهشت 1392, 03:12 صبح
با سلام من یه برنامه دارم واسه ریجستر کردن فایل ها فقط کافیه اونو داخل فولدر System 32 فرار بدی و اجرا کنی خودش همرو ریجستر میکنه
دانلود (http://s4.picofile.com/file/7749774301/Registrator.exe.html)
موفق باشید :چشمک:
alipoor2009
جمعه 31 خرداد 1392, 03:05 صبح
تو Run اینو بنویس:
regsvr32 "Adress OCX"
mehran901
شنبه 01 تیر 1392, 11:04 صبح
البته تو ویندوز سون ی سوئیچ اضافه واسه رجیستر کردن نیازه
regsvr32.exe /s ocxpath
از طریق Api هم میتونی :
Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long
Private Declare Function LoadLibrary _
Lib "kernel32" Alias "LoadLibraryA" _
(ByVal lpLibFileName As String) As Long
Private Declare Function CreateThread Lib "kernel32" _
(lpThreadAttributes As Long, ByVal dwStackSize As Long, _
lpStartAddress As Long, lpParameter As Any, ByVal dwCreationFlags As Long, _
lpThreadId As Long) As Long
Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Private Declare Function GetExitCodeThread Lib "kernel32" (ByVal hThread As Long, lpExitCode As Long) As Long
Private Declare Sub ExitThread Lib "kernel32" (ByVal dwExitCode As Long)
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long
Function VBRegSvr32(ByVal sServerPath As String, _
Optional fRegister = True) As Boolean
Dim hMod As Long ' module handle
Dim lpfn As Long ' reg/unreg function address
Dim lpThreadId As Long ' dummy var that get's filled
Dim hThread As Long ' thread handle
Dim fSuccess As Boolean ' if things worked
Dim dwExitCode As Long ' thread's exit code if it doesn't finish
Screen.MousePointer = vbHourglass
' Load the server into memeory
hMod = LoadLibrary(sServerPath)
' Get the specified function's address and our msgbox string.
If fRegister Then
lpfn = GetProcAddress(hMod, "DllRegisterServer")
Else
lpfn = GetProcAddress(hMod, "DllUnregisterServer")
End If
' If we got a function address...
If lpfn Then
' Create an alive thread and execute the function.
hThread = CreateThread(ByVal 0, 0, ByVal lpfn, ByVal 0, 0, lpThreadId)
' If we got the thread handle...
If hThread Then
' Wait 10 secs for the thread to finish (the function may take a while...)
fSuccess = (WaitForSingleObject(hThread, 10000) = WAIT_OBJECT_0)
' If it didn't finish in 5 seconds...
If Not fSuccess Then
' Something unlikely happened, lose the thread.
Call GetExitCodeThread(hThread, dwExitCode)
Call ExitThread(dwExitCode)
End If
' Lose the thread handle
Call CloseHandle(hThread)
End If ' hThread
End If ' lpfn
' Free server if we loaded it.
If hMod Then Call FreeLibrary(hMod)
Screen.MousePointer = vbDefault
If fSuccess Then
VBRegSvr32 = True
Else
MsgBox ("Error: " & sServerPath)
VBRegSvr32 = False
End If
End Function
Private Sub Command1_Click()
If Dir("C:\windows\system32\xinput1_3.dll") = "xinput1_3.dll" Then
MsgBox "Exist": VBRegSvr32 "C:\windows\system32\xinput1_3.dll"
Else
MsgBox " does n't exitst"
End If
End Sub
محسن واژدی
شنبه 01 تیر 1392, 11:25 صبح
البته تو ویندوز سون ی سوئیچ اضافه واسه رجیستر کردن نیازه
regsvr32.exe /s ocxpath
سلام علیکم
پارامترهای regsvr32 در سون هم مثل xp اختیاری هستن:
regsvr32 /?
موفق باشید
vBulletin® v4.2.5, Copyright ©2000-1404, Jelsoft Enterprises Ltd.