Solved

transfer data via modem with mscomm32

Posted on 2003-12-01
5
1,132 Views
Last Modified: 2013-11-13
HI
I have problem with transfer data via modem in VB .I can send & receive textfile but i can't send & receive pics or exe file. I use from mscomm and my input mode propert set to text
and i read & write  binary from a file .but i have a problem with send & receive pics & exe file.
my receive file can' t run and my picture is damage.
pleas help me
thanks
0
Comment
Question by:anooshe
  • 2
  • 2
5 Comments
 
LVL 1

Expert Comment

by:jcaceres
ID: 9850297
You could use microsoft winsock control to achieve this. There is one good code sample in this url http://www.a1vbcode.com/coderedirect.asp?type=application&ID=341

should work for u.

cheers.
0
 
LVL 4

Accepted Solution

by:
1mak earned 30 total points
ID: 9850637
You need to send/receive binary data to transfer pics and exe files.

Set your InputMode to comInputModeBinary. And then pass Byte arrays to the Output method, and also use a Byte array when calling Input in your receiver application.

0
 

Author Comment

by:anooshe
ID: 9856449
Hi 1mak
I write codef for every operation ,when i send text in textbox i send "#@" & text and another PC recognize i send a text and show it in texttbox.and when i send "#@" & filenname &filesize &file another PC recognize that send a file. my Input mode set to text and i can recognize this code and file name and size but when I set it to Binary I can't recognize my code and filename an my receive procedure will be fail. if you have possible for you send me a source code for this. or guide me in my project.
thanks
0
 
LVL 4

Expert Comment

by:1mak
ID: 9856770
So....

You're saying that you want to send the name of the file & the size of the file as a header prior to actually sending the file itself?
How about you send that in text mode, and then, once you get a response from the client that it's received the header, switch both server and client to binary, and then push the file itself?


0
 

Author Comment

by:anooshe
ID: 9858214
hi
thanks for replay .
but when I set my property to text in Client & Server I can't  sned and receive data because my Header that is "#@" & filename ,... don't recognize in binary mode.
Good Luck
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Magic Software info 18 125
PHP question(s) about order of output 9 57
recursion example 16 111
Java Loop 6 49
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

920 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now