• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 869
  • Last Modified:

mswinsck.ocx and Make .EXE

Hi,

I'm trying my best to say what I need...Hope you could get my means. Thanks. -->

I have a VB project which required to use mswinsck.ocx

I want to compile this VB project into an EXE file
(I'm using VB 5.0 )

Problems : Can I just distribute a single file (the .EXE file) and don't need to consider that the mswinsck.ocx is already available in the destination PC?
Does the destination will work with my program if that PC doesn't have the mswinsck.ocx ?

*** How can I embed the mswinsck.ocx into the .EXE ?


Thank you.
0
saikit
Asked:
saikit
1 Solution
 
viktornetCommented:
it will not work if they dont have the OCX component.. you can put it in a setup program which will install your program and register the OCX control.... hope this helps...

..-=ViKtOr=-..
0
 
saikitAuthor Commented:
viktornet, thanks for your reply. As I say I only want to distribute the .EXE file only, and I know that the setup wizard will included all required to setup. Hope you understand and allow me to reject this answer by this time, because I want to have more time to collect more suggestion from other users. (I know that it may be not possible, but if I have collected enough information, I'll accept the answer. Thanks.)

Do you think it is possible to distribute a single .EXE file as the above case by using other programming tools? (Such as MS Visual C++, Borland Visual C++ ?)

Thanks.
0
 
saikitAuthor Commented:
If the win95/98 PC have TCP/IP protocol installed, can I assume that the PC have mswinsck.ocx ?

If yes, I may not need to distribute mswinsck.ocx .


If I can know this kind of PC may have mswinsck.ocx, this question will be solved.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
setiawanCommented:
You can't distribute only vb .exe files only
No, You can't assume that if the computer have installed TCP/IP and then It has mswinsck.ocx
VB is different from Delphi, Just keep me inform
0
 
SLECommented:
I had 2 simple applications using the WinSock OXC. I had little hope that I was only to distribute the EXEs, without a full setup. Unfortunately the OCX *IS* required. On PC's with the VB IDE: no problem of course. But I've tried to run my EXEs on machines on which VC++ has been installed: no luck...

Suggestion:

Maybe you could distribute the EXEs along with the OCX and register the OCX once at start-up of your apps.
0
 
DefTonesCommented:
i want to do the same thing as you, so i did this

open mswinsock.ocx for binary and read all the data into a textbox
put alll this data youve just got into a file so u can refer to it late on
when your read to compile your app, goto this file(say youve put all this binary data into a text file) and copy all the data, add another mystery form that the user has NO WAY of accessing
put this data into the text box

so when your app starts it already has this binary data from mswinsock.ocx in a textbox

then do this
open app.path & "\mswinsock.ocx" for binary access write as #1
put #1,,textboxthathasbinarydatainit.text
close #1

when you copy files from one place to another,windows copies the binary data from
the file you want to copy,then puts it in a virtual buffer,then takes it from this buffer and writes it to this new destination

Deftones
0
 
DefTonesCommented:
i want to do the same thing as you, so i did this

open mswinsock.ocx for binary and read all the data into a textbox
put alll this data youve just got into a file so u can refer to it late on
when your read to compile your app, goto this file(say youve put all this binary data into a text file) and copy all the data, add another mystery form that the user has NO WAY of accessing
put this data into the text box

so when your app starts it already has this binary data from mswinsock.ocx in a textbox

then do this
open app.path & "\mswinsock.ocx" for binary access write as #1
put #1,,textboxthathasbinarydatainit.text
close #1

when you copy files from one place to another,windows copies the binary data from
the file you want to copy,then puts it in a virtual buffer,then takes it from this buffer and writes it to this new destination

Deftones
0
 
saikitAuthor Commented:
Deftones,

Would you please also show me that how to write the mswinsock.ocx binary into a textbox and save it in the form?

Thanks.
0
 
saikitAuthor Commented:
Deftones,

It's should be a very good idea, but I can save the binary data into the textbox.
0
 
saikitAuthor Commented:
Correction of last comment....Thx  :)
*****************************************************
Deftones,

It's should be a very good idea, but I CANNOT save the binary data into the textbox.
0
 
DefTonesCommented:
have you tried just experimenting with binary files a bit like reading from them and placing that data in a textbox like

get #1,,buffer$
text1.text = text1.text & buffer$

you should get alotta characters
tell me if this works
0
 
saikitAuthor Commented:
DefTones,

It may not work... Below is the failed coding:
---------------------------
Sub ReadBin()

Open "c:\windows\system\mswinsck.ocx" For Binary Access Read As #1
Get #1, , buffer$
Debug.Print LOF(1)
Text1.Text = Text1.Text & buffer$
Close #1

End Sub
--------------------------

The debug window displayed 101648 (the file size), but nothing in Text1.Text or buffer$.

Pls help. Thx.
0
 
DefTonesCommented:
I see whats wrong with your code, take a look at this:

your buffer variable = ""

when it reads ? bytes into buffer$, buffer$ is equal to "" therefore it reads 0 bytes into buffer:::::and you are only reading it once...

try

Sub ReadBin()

dim buffer as string


      Open "c:\windows\system\mswinsck.ocx" For Binary            Access Read As #1
       
      buffer = string(20000," ") 'fills 20000 spaces in                                      'buffer,set 20000 to one
                                 'would take longer but
                                 'would be better
do while not eof(1)
      Get #1, , buffer
      Debug.Print LOF(1)
      Text1.Text = Text1.Text & buffer
      Close #1
loop


end sub


hey by matter of interest how old are you?

0
 
sennaspyCommented:
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now