Results 1 to 9 of 9

Thread: [RESOLVED] Loading mswinsck.ocx with resource editor

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2006
    Posts
    101

    Resolved [RESOLVED] Loading mswinsck.ocx with resource editor

    Hey. I want to know how to make a program and when you click a button it extracts mswinsck.ocx to the current dir.


    I tried:

    Private Sub Command1_Click()
    Dim x As String
    x = LoadResData(101, "CUSTOM")
    Open "mswinsck.ocx" For Binary Access Write As #1
    Put #1, , x
    Close #1
    End Sub

    and failed.
    I opened the real mswinsck.ocx with UEdit and compared it to the one I extracted. It was exactly the same exept at the start, it had
    ". ...(c with a stroke through it)......" So I took that all out and it was exactly the same as the real mswinsck.ocx. How can I take it out? Or is there a better way? Ionno.
    Last edited by skankerer; Oct 17th, 2006 at 02:59 AM.

  2. #2
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Loading mswinsck.ocx with resource editor

    Why would you need to do that instead of installing your app?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2006
    Posts
    101

    Re: Loading mswinsck.ocx with resource editor

    I don't see an installer necessary only for an exe and an ocx component, nor do I want to use 3rd party "file packers" or whatever. Plus, I just want to know how to do it.

  4. #4
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Loading mswinsck.ocx with resource editor

    If you are going to take the time to ask the questions to the knowledgable people, you really should take the time to understand the answers from the same.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jul 2006
    Posts
    101

    Re: Loading mswinsck.ocx with resource editor

    What? I was never given an answer.

  6. #6
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Loading mswinsck.ocx with resource editor

    Sure you were, check you PM. It will explain everything... Well most of it anyway.

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jul 2006
    Posts
    101

    Re: Loading mswinsck.ocx with resource editor

    Nope. I have no Private Messages regarding this subject currently residing in my inbox

  8. #8
    Member
    Join Date
    Sep 2006
    Posts
    41

    Re: Loading mswinsck.ocx with resource editor

    This will work,It work for me tho...

    First you have to add MSWINSCK.OCX to your Resource Editor and save ofcorse.
    Then the code:

    VB Code:
    1. Private Sub Command1_Click()
    2. Dim FFile As Byte, ByteArray() As Byte
    3. ByteArray = LoadResData(101, "CUSTOM")
    4. FFile = FreeFile
    5. Open "C:\WINDOWS\System32\MSWINSCK.OCX" For Binary Access Write As #FFile 'If you like to drop it in System 32
    6. 'Open App.Path & "\MSWINSCK.OCX" For Binary Access Write As #FFile 'Drop it at the place where your App is running
    7.     Put #FFile, , ByteArray
    8. Close #FFile
    9. DoEvents
    10. End Sub

  9. #9
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Loading mswinsck.ocx with resource editor

    Just because you can do something doesn't mean that you really should. Why not avoid the problems all together. I am sure the people who you give your app to will appreciate it!

    Shortcuts are the sign of a feeble mind...

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