Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

mswinsck.ocx and Make .EXE

Posted on 1999-06-28
14
Medium Priority
?
863 Views
Last Modified: 2012-05-04
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
Comment
Question by:saikit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
14 Comments
 
LVL 10

Expert Comment

by:viktornet
ID: 1520405
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
 

Author Comment

by:saikit
ID: 1520406
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
 

Author Comment

by:saikit
ID: 1520407
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 6

Expert Comment

by:setiawan
ID: 1520408
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
 
LVL 2

Expert Comment

by:SLE
ID: 1520409
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
 
LVL 1

Expert Comment

by:DefTones
ID: 1520410
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
 
LVL 1

Expert Comment

by:DefTones
ID: 1520411
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
 

Author Comment

by:saikit
ID: 1520412
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
 

Author Comment

by:saikit
ID: 1520413
Deftones,

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

Author Comment

by:saikit
ID: 1520414
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
 
LVL 1

Expert Comment

by:DefTones
ID: 1520415
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
 

Author Comment

by:saikit
ID: 1520416
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
 
LVL 1

Accepted Solution

by:
DefTones earned 200 total points
ID: 1520417
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
 
LVL 3

Expert Comment

by:sennaspy
ID: 1520418
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question