PDA

View Full Version : مشکل class not register



Rain_Saeid
پنج شنبه 25 مهر 1392, 07:20 صبح
با سلام
دوستان و اساتید من بعد از ایجاد برنامه exe و ساخت Setup با برنامه Setup Factory وقتی برنامه رو روی سیستم دیگه نصب و اجرا میکنم ، این ارور رو میده و Ok میخواد.. ولی بعدش برنامه اجرا میشه

ولی روی سیستم خودم که برنامه VB6 نصب هست ، مشکلی پیش نمیاد..
میشه بفرمایید مشکل چیه؟
Class not registered. Looking for object with CLSID {00000010-0000-0010-8000-00AA006D

ممنون میشم که راهنمایی بفرمایید

با تشکر

محسن واژدی
پنج شنبه 25 مهر 1392, 12:24 عصر
سلام علیکم
با استفاده از برنامه هایی مانند Package & Deployment Wizard پروژه را کامپایل و بسته بندی کنید تا کلیه کامپوننت های مورد نیاز برنامه جمع آوری و بهمراه پروژه توزیع بشن

موفق باشید

Rain_Saeid
پنج شنبه 25 مهر 1392, 12:49 عصر
با تشکر از پاسخ شما
آیا منظورتون همون Package & Deployment Wizard خود VB6 هست؟ یا برنامه خاصی مد نظرتون بود؟
چون بنده با Package & Deployment Wizard وی بی کامپایل و بسته بندی کردم..

davidrobert
پنج شنبه 25 مهر 1392, 13:14 عصر
بفرمایید این هم کامپوننت ها http://uplod.ir/lf5mju2cvtll/CodeJock.zip.htm

Rain_Saeid
سه شنبه 30 مهر 1392, 22:47 عصر
دوستان عزیز مشکل رو دقیقا فهمیدم چیه..
فقط عزیزان کمک کنند که بتونم حلش کنم..

مشکل بنده ی فایل OCX بوده که رجیستر نمیشده.. حتی با Package & Deployment Wizard بسته بندی کردم و حتی با برنامه Setup ساز تبدیل به Exe کردم .. ولی بازم همون ارور رو میده..
ی جا تیکه برنامه پیدا کردم که برای رجیستر کردن از داخل برنامه کد نویسی داده بود که به شرح زیر هست :

Create a new Standard Exe project in Visual Basic.
Add a Module (Module1) to the project.
Add the following code to the General Declarations section of Module1:


Public Declare Function RegComCtl32 Lib "ComCtl32.OCX" _
Alias "DllRegisterServer" () As Long

Public Declare Function UnRegComCtl32 Lib "ComCtl32.OCX" _
Alias "DllUnregisterServer" () As Long

Public Const S_OK = &H0

Sub RegisterComCtl32()
On Error GoTo Err_Registration_Failed
If RegComCtl32 = S_OK Then
MsgBox "Registered Successfully"
Else
MsgBox "Not Registered"
End If
Exit Sub
Err_Registration_Failed:
MsgBox "Error: " & Err.Number & " " & Err.Description
End Sub

Sub UnRegisterComCtl32()
On Error GoTo Err_Unregistration_Failed
If UnRegComCtl32 = S_OK Then
MsgBox "Unregistered Successfully"
Else
MsgBox "Not Unregistered"
End If
Exit Sub
Err_Unregistration_Failed:
MsgBox "Error: " & Err.Number & " " & Err.Description
End Sub



4- View the Immediate Window (CTRL+G) and type:
UnRegisterComCtl32
Press the ENTER key to unregister ComCtl32.OCX, and then type:
RegisterComCtl32
and press the ENTER key to register the control.

These functions can now be called to register and unregister the ActiveX control, programmatically providing functionality similar to that of RegSvr32.EXE. You can test these functions by right-clicking on the ToolBox and selecting Components from the pop-up menu. An entry for the Microsoft Windows Common Controls 5.0 will be displayed on the Controls tab of the Components dialog if ComCtl32.OCX is registered and no entry will be displayed if ComCtl32.OCX is not registered

منبع : http://support.microsoft.com/kb/173091



ممنون میشم از شما دوستان واساتید که بنده را راهنمایی بفرمایید تا چگونه این فایل OCX رو با این تیکه برنامه یا حالا هر قلق یا راه حلی بتونم حلش کنم
تشکر

m.4.r.m
سه شنبه 30 مهر 1392, 22:52 عصر
مشکل شما فقط تو فایل Codejock هست ؟

mehran901
سه شنبه 30 مهر 1392, 22:54 عصر
سلام
میتونید از نمونه کد زیر برای رجیستر کردن dll && ocx ها استفاده کنید


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

Rain_Saeid
چهارشنبه 01 آبان 1392, 15:45 عصر
مشکل شما فقط تو فایل Codejock هست ؟

نه دوست عزیز..
یه فایل OCX هست که tiny نام داره و اصلا بصورت اتوماتیک رجیستر نمیشه