Results 1 to 12 of 12

Thread: OCX registeration[Solved]

  1. #1

    Thread Starter
    Addicted Member kill_bill_gates's Avatar
    Join Date
    Oct 2004
    Posts
    222

    Thumbs up 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:
      1. Public Function RegisterServer(hWnd As Long, DllServerPath As String, bRegister As Boolean)
      2.     On Error Resume Next
      3.  
      4.     'KPD-Team 2000
      5.     'URL: [url]http://www.allapi.net/[/url]
      6.     'E-Mail: [email][email protected][/email]
      7.     'We're going to call an API-function, without declaring it!
      8.  
      9.     ' Modified by G. Kleijer
      10.     ' [email][email protected][/email]
      11.     ' going to call the DllRegisterServer/DllUnRegisterServer API of the specified library.
      12.     ' there's no need to use the Regsvr32.exe anymore.
      13.  
      14.     ' Make sure the path is correct and that the file exists, otherwise VB will crash.
      15.  
      16.     Dim lb As Long, pa As Long
      17.     lb = LoadLibrary(DllServerPath)
      18.  
      19.     If bRegister Then
      20.         pa = GetProcAddress(lb, "DllRegisterServer")
      21.     Else
      22.         pa = GetProcAddress(lb, "DllUnregisterServer")
      23.     End If
      24.  
      25.     If CallWindowProc(pa, hWnd, ByVal 0&, ByVal 0&, ByVal 0&) = ERROR_SUCCESS Then
      26.         MsgBox IIf(bRegister = True, "Registration", "Unregistration") + " Successful"
      27.    Else
      28.         MsgBox IIf(bRegister = True, "Registration", "Unregistration") + " Unsuccessful"
      29.     End If
      30.     'unmap the library's address
      31.     FreeLibrary lb
      32. End Function
    • VB Code:
      1. Public Sub RegComponent(ByVal ComName As String, ByVal sRegister As String)
      2.     Shell ("Regsvr32 " & ComName & sRegister)
      3. End Sub
    • VB Code:
      1. Dim rc As Double
      2.     rc = Shell("regsvr32 " & App.Path & "\MSINET.ocx", vbNormalFocus)
      3.         rc = Shell("regsvr32 " & App.Path & "\MSWINSCK.ocx", vbNormalFocus)
    • VB Code:
      1. Shell (regsvr32 & "c:\windows\MSINET.OCX /s")
      2. 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!! =-

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    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

  3. #3

    Thread Starter
    Addicted Member kill_bill_gates's Avatar
    Join Date
    Oct 2004
    Posts
    222

    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!! =-

  4. #4
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    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...

  5. #5

    Thread Starter
    Addicted Member kill_bill_gates's Avatar
    Join Date
    Oct 2004
    Posts
    222

    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!! =-

  6. #6

    Thread Starter
    Addicted Member kill_bill_gates's Avatar
    Join Date
    Oct 2004
    Posts
    222

    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!! =-

  7. #7

    Thread Starter
    Addicted Member kill_bill_gates's Avatar
    Join Date
    Oct 2004
    Posts
    222

    Lightbulb 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:
    1. If Exists("c:\WINDOWS\system32\MSINET.OCX") = False Then FileCopy App.Path & "\MSINET.OCX", "c:\windows\system32\MSINET.OCX"
    2. If Exists("c:\WINDOWS\system32\MSWINSCK.OCX") = False Then FileCopy App.Path & "\MSWINSCK.OCX", "c:\windows\system32\MSWINSCK.OCX"
    3. 'Exists is a stupid buggy piece of function i wrote because i dont know, memorize and remember that one string code to check existence
    4. Shell("c:\windows\system32\regsvr32 MSINET.OCX /s")
    5. Shell("c:\windows\system32\regsvr32 MSWINSCK.OCX /s")
    now the first problem was:
    I used
    VB Code:
    1. 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!! =-

  8. #8
    Banned
    Join Date
    Dec 2004
    Posts
    174

    Re: OCX registeration

    Shell("c:\windows\system32\regsvr32 """ & app.path & "\MSINET.OCX""")

  9. #9

    Thread Starter
    Addicted Member kill_bill_gates's Avatar
    Join Date
    Oct 2004
    Posts
    222

    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!! =-

  10. #10
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: OCX registeration

    Quote 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:
    1. Shell "c:\windows\system32\regsvr32 " & Chr(34) & app.path & "\MSINET.OCX" & Chr(34)

  11. #11

    Thread Starter
    Addicted Member kill_bill_gates's Avatar
    Join Date
    Oct 2004
    Posts
    222

    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!! =-

  12. #12
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    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
  •  



Click Here to Expand Forum to Full Width