Link to home
Start Free TrialLog in
Avatar of saikit
saikit

asked on

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.
Avatar of viktornet
viktornet
Flag of United States of America image

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=-..
Avatar of saikit
saikit

ASKER

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.
Avatar of saikit

ASKER

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.
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
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.
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
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
Avatar of saikit

ASKER

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.
Avatar of saikit

ASKER

Deftones,

It's should be a very good idea, but I can save the binary data into the textbox.
Avatar of saikit

ASKER

Correction of last comment....Thx  :)
*****************************************************
Deftones,

It's should be a very good idea, but I CANNOT save the binary data into the textbox.
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
Avatar of saikit

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of DefTones
DefTones

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial