|
-
Dec 23rd, 2004, 03:40 PM
#1
Thread Starter
Addicted Member
OCX registeration[Solved]
I want to register "MSINET.OCX" and "MSWINSCK.OCX"(not on my computer)...... I've tried the following codes (in a friend's computer) but they all gave the same error, "system error &h8007007e (-2147024770). The specified module could not be fonund." . The codes are:
VB Code:
Public Function RegisterServer(hWnd As Long, DllServerPath As String, bRegister As Boolean)
On Error Resume Next
'KPD-Team 2000
'URL: [url]http://www.allapi.net/[/url]
'We're going to call an API-function, without declaring it!
' Modified by G. Kleijer
' going to call the DllRegisterServer/DllUnRegisterServer API of the specified library.
' there's no need to use the Regsvr32.exe anymore.
' Make sure the path is correct and that the file exists, otherwise VB will crash.
Dim lb As Long, pa As Long
lb = LoadLibrary(DllServerPath)
If bRegister Then
pa = GetProcAddress(lb, "DllRegisterServer")
Else
pa = GetProcAddress(lb, "DllUnregisterServer")
End If
If CallWindowProc(pa, hWnd, ByVal 0&, ByVal 0&, ByVal 0&) = ERROR_SUCCESS Then
MsgBox IIf(bRegister = True, "Registration", "Unregistration") + " Successful"
Else
MsgBox IIf(bRegister = True, "Registration", "Unregistration") + " Unsuccessful"
End If
'unmap the library's address
FreeLibrary lb
End Function
VB Code:
Public Sub RegComponent(ByVal ComName As String, ByVal sRegister As String)
Shell ("Regsvr32 " & ComName & sRegister)
End Sub
VB Code:
Dim rc As Double
rc = Shell("regsvr32 " & App.Path & "\MSINET.ocx", vbNormalFocus)
rc = Shell("regsvr32 " & App.Path & "\MSWINSCK.ocx", vbNormalFocus)
VB Code:
Shell (regsvr32 & "c:\windows\MSINET.OCX /s")
Shell (regsvr32 & "c:\windows\MSWINSCK.OCX /s")
I called those functions.... But they all gave the same error....
Any help will be appreciated....
Last edited by kill_bill_gates; Dec 31st, 2004 at 01:52 PM.
"Quis custodiet ipsos custodes?"
Juvenal
Mete the Hun wanted to live in peace with the Chinese. So he gave the Chinese Emperor his favorite horse, best swords in his armory, and lots of other cool stuff. But then the Chinese Emperor asked for one thing. A useless land through the north. It was a small, useless, unproductive, uninhabited piece of land. But Mete the Hun's answer was certain:
I gave you horses, weapons and much more which belonged to me. But the lands are not mine, it's my nation's and I'm ready to fight, kill and die for just an inch my country
-=Joey Jordison R0CKS!! =-
-
Dec 23rd, 2004, 03:47 PM
#2
Re: OCX registeration
the one you have from allapi.net should work (i think I recommended this method to you a week ago or so)
maybe take off the on error resume next and see where its failing.. because I have used that exact function and had it work just fine... so its probably failing based on one of the params you passed in, but you dont know because it doesnt break on errors
-
Dec 24th, 2004, 03:30 PM
#3
Thread Starter
Addicted Member
Re: OCX registeration
do i have to have anything(an ocx,dll,etc) for the code from allapi to work?
"Quis custodiet ipsos custodes?"
Juvenal
Mete the Hun wanted to live in peace with the Chinese. So he gave the Chinese Emperor his favorite horse, best swords in his armory, and lots of other cool stuff. But then the Chinese Emperor asked for one thing. A useless land through the north. It was a small, useless, unproductive, uninhabited piece of land. But Mete the Hun's answer was certain:
I gave you horses, weapons and much more which belonged to me. But the lands are not mine, it's my nation's and I'm ready to fight, kill and die for just an inch my country
-=Joey Jordison R0CKS!! =-
-
Dec 25th, 2004, 01:21 AM
#4
Re: OCX registeration
Did you copy the files to the correct location? Because in one code you use c:\windows, and in the other App.Path...
-
Dec 28th, 2004, 11:43 AM
#5
Thread Starter
Addicted Member
Re: OCX registeration
in the c:\windows one i did, since i dont kno whether i need to copy them to system32 in order to make regsvr32 work properly..
Last edited by kill_bill_gates; Dec 28th, 2004 at 11:48 AM.
"Quis custodiet ipsos custodes?"
Juvenal
Mete the Hun wanted to live in peace with the Chinese. So he gave the Chinese Emperor his favorite horse, best swords in his armory, and lots of other cool stuff. But then the Chinese Emperor asked for one thing. A useless land through the north. It was a small, useless, unproductive, uninhabited piece of land. But Mete the Hun's answer was certain:
I gave you horses, weapons and much more which belonged to me. But the lands are not mine, it's my nation's and I'm ready to fight, kill and die for just an inch my country
-=Joey Jordison R0CKS!! =-
-
Dec 28th, 2004, 11:45 AM
#6
Thread Starter
Addicted Member
Re: OCX registeration
Well cant just somebody give me an example code for this(to register any of the components)?
"Quis custodiet ipsos custodes?"
Juvenal
Mete the Hun wanted to live in peace with the Chinese. So he gave the Chinese Emperor his favorite horse, best swords in his armory, and lots of other cool stuff. But then the Chinese Emperor asked for one thing. A useless land through the north. It was a small, useless, unproductive, uninhabited piece of land. But Mete the Hun's answer was certain:
I gave you horses, weapons and much more which belonged to me. But the lands are not mine, it's my nation's and I'm ready to fight, kill and die for just an inch my country
-=Joey Jordison R0CKS!! =-
-
Dec 31st, 2004, 01:08 PM
#7
Thread Starter
Addicted Member
Re: OCX registeration
i think i just figured out my mistakes....
Now I'm using the following code after checking if MSINET.OCX and/or MSWINSCK.OCX is present in the "c:\windows\system32\" dir:
VB Code:
If Exists("c:\WINDOWS\system32\MSINET.OCX") = False Then FileCopy App.Path & "\MSINET.OCX", "c:\windows\system32\MSINET.OCX"
If Exists("c:\WINDOWS\system32\MSWINSCK.OCX") = False Then FileCopy App.Path & "\MSWINSCK.OCX", "c:\windows\system32\MSWINSCK.OCX"
'Exists is a stupid buggy piece of function i wrote because i dont know, memorize and remember that one string code to check existence
Shell("c:\windows\system32\regsvr32 MSINET.OCX /s")
Shell("c:\windows\system32\regsvr32 MSWINSCK.OCX /s")
now the first problem was:
I used
VB Code:
Shell("c:\windows\system32\regsvr32 " & app.path & "\MSINET.OCX")
The problem is, the shell function launches regsvr32 and then sends it dos commands... But my app was in "C:\program files\blablabla...." and when regsvr sees the blank between program and files it thinks "C:\Program" is our specified module and "Files\blablabla...." is another command. So now,i copy it to system32 first.....
Another mistake:
Ive chosen Winsock and Inet as components in the program in which i was also trying to register them. But I understood that VB first looks for the module so it gave the error "Specified module could not be found". So now i register it in a different app.
Thanks to everybody for their interest in my problem
"Quis custodiet ipsos custodes?"
Juvenal
Mete the Hun wanted to live in peace with the Chinese. So he gave the Chinese Emperor his favorite horse, best swords in his armory, and lots of other cool stuff. But then the Chinese Emperor asked for one thing. A useless land through the north. It was a small, useless, unproductive, uninhabited piece of land. But Mete the Hun's answer was certain:
I gave you horses, weapons and much more which belonged to me. But the lands are not mine, it's my nation's and I'm ready to fight, kill and die for just an inch my country
-=Joey Jordison R0CKS!! =-
-
Dec 31st, 2004, 01:13 PM
#8
Banned
Re: OCX registeration
Shell("c:\windows\system32\regsvr32 """ & app.path & "\MSINET.OCX""")
-
Dec 31st, 2004, 01:26 PM
#9
Thread Starter
Addicted Member
Re: OCX registeration
it really works . BUT WHY??
"Quis custodiet ipsos custodes?"
Juvenal
Mete the Hun wanted to live in peace with the Chinese. So he gave the Chinese Emperor his favorite horse, best swords in his armory, and lots of other cool stuff. But then the Chinese Emperor asked for one thing. A useless land through the north. It was a small, useless, unproductive, uninhabited piece of land. But Mete the Hun's answer was certain:
I gave you horses, weapons and much more which belonged to me. But the lands are not mine, it's my nation's and I'm ready to fight, kill and die for just an inch my country
-=Joey Jordison R0CKS!! =-
-
Dec 31st, 2004, 01:50 PM
#10
Re: OCX registeration
 Originally Posted by kill_bill_gates
it really works  . BUT WHY??
Because dll/ocx name mst be enclosed in a quotes (I personally like using Chr(34) instead of multiple quotes in the syntax as it's a lot more explicit and allows you visualize what's issing):
VB Code:
Shell "c:\windows\system32\regsvr32 " & Chr(34) & app.path & "\MSINET.OCX" & Chr(34)
-
Dec 31st, 2004, 01:51 PM
#11
Thread Starter
Addicted Member
Re: OCX registeration
Thanks
Good to know
"Quis custodiet ipsos custodes?"
Juvenal
Mete the Hun wanted to live in peace with the Chinese. So he gave the Chinese Emperor his favorite horse, best swords in his armory, and lots of other cool stuff. But then the Chinese Emperor asked for one thing. A useless land through the north. It was a small, useless, unproductive, uninhabited piece of land. But Mete the Hun's answer was certain:
I gave you horses, weapons and much more which belonged to me. But the lands are not mine, it's my nation's and I'm ready to fight, kill and die for just an inch my country
-=Joey Jordison R0CKS!! =-
-
Dec 31st, 2004, 01:53 PM
#12
Re: OCX registeration
you know you should really make an installation package for your app to distribute dll and ocx files...
when I used the AllAPI code, it was when i worked at a company doing internal software, and it was a way to update custom dlls i had written that needed to be installed on the client machines
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
|