Solved

transfer data via modem with mscomm32

Posted on 2003-12-01
5
1,123 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
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…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

747 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

14 Experts available now in Live!

Get 1:1 Help Now