[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.
Re: Loading mswinsck.ocx with resource editor
Why would you need to do that instead of installing your app?
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.
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.
Re: Loading mswinsck.ocx with resource editor
What? I was never given an answer.
Re: Loading mswinsck.ocx with resource editor
Sure you were, check you PM. It will explain everything... Well most of it anyway.
Re: Loading mswinsck.ocx with resource editor
Nope. I have no Private Messages regarding this subject currently residing in my inbox
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:
Private Sub Command1_Click()
Dim FFile As Byte, ByteArray() As Byte
ByteArray = LoadResData(101, "CUSTOM")
FFile = FreeFile
Open "C:\WINDOWS\System32\MSWINSCK.OCX" For Binary Access Write As #FFile 'If you like to drop it in System 32
'Open App.Path & "\MSWINSCK.OCX" For Binary Access Write As #FFile 'Drop it at the place where your App is running
Put #FFile, , ByteArray
Close #FFile
DoEvents
End Sub
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... :p