CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 15
  1. #1
    Join Date
    Jul 2009
    Location
    Kuwait
    Posts
    170

    [RESOLVED] File transfer through MODEM and MSCOMM

    Hi all,
    Using Modem and MSCOMM, I dialed a computer from another computer. I am able to send some text messages. Also i read from a text file and has send the data to the another computer, where it is collected to a text file.
    My problem is, I want to send a file, like zip file from one computer and receive it in another computer with same name ,through MSCOMM and MODEM. What should be the starting point for this ?

  2. #2
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: File transfer through MODEM and MSCOMM

    You will need to send the filename to the other computer and then the file. Like was mentioned use binary access and read it in blocks. Send each block in order and then put them back together again on the target system.

  3. #3
    Join Date
    Jul 2009
    Location
    Kuwait
    Posts
    170

    Post Re: File transfer through MODEM and MSCOMM

    What are the handshaking protocols which i can use in MSCOMM. Is something like Data fax protocol can be used along with MSCOMM

  4. #4
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: File transfer through MODEM and MSCOMM

    You can use various protocols but they are not included in MSComm. You will have to either use a different tool, find some source code or write it yourself.

    I use Sax Comm, and have used PDQ Comm, both work very well and include a terminal program as well as several major protocols.

    Using MSComm you can simply read a block from the file using binary access and send that block to the remote which should then write it to the target file, appending each new chunk as it arrives. The problem is that sometimes you may get an interuption or noise on the line which can cause the block to be different than the original.

  5. #5
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: File transfer through MODEM and MSCOMM

    Maybe this little thing I wrote recently will help understand file transfer via MSComm.
    It is a combined sender/receiver, to be run on two connected computers.
    It works with a timer. It first sends the filename and the file size, waits a short time and then sends the complete file.
    The receiver saves the incoming date under this name.
    It is quite simple and can give you some ideas of how to implement it.
    Sending the filesize, too, gives the receiver an idea how many bytes are to be expected. So it is a very simple protocol, but it might help implementing a better one.

    You can fill the list with more tna one filename and then click send.
    If you uncheck the "Name" box, no name and no filesize are sent. This is only for test purposes.
    Attached Files Attached Files

  6. #6
    Join Date
    Jul 2009
    Location
    Kuwait
    Posts
    170

    Re: File transfer through MODEM and MSCOMM

    Thanks for the code. I will work on it.

  7. #7
    Join Date
    Nov 2019
    Posts
    5

    Re: File transfer through MODEM and MSCOMM

    Hi. Do you still have the MSCommFIleTransfer.zip available? I cant download it

  8. #8
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,395

    Re: File transfer through MODEM and MSCOMM

    Quote Originally Posted by greenelephant View Post
    Hi. Do you still have the MSCommFIleTransfer.zip available? I cant download it
    Why do you need it?
    Victor Nijegorodov

  9. #9
    Join Date
    Nov 2019
    Posts
    5

    Re: [RESOLVED] File transfer through MODEM and MSCOMM

    I am new to MSCOMM coding in VB6 and this thread contains the same exact task I am trying to do (IE file transfer using MSCOMM) and I see WoF has kindly donated code to do this. Thats why I am asking

  10. #10
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,395

    Re: [RESOLVED] File transfer through MODEM and MSCOMM

    Are you also new to coding in VB6?
    And why not using VB.Net or C#?
    Victor Nijegorodov

  11. #11
    Join Date
    Nov 2019
    Posts
    5

    Re: [RESOLVED] File transfer through MODEM and MSCOMM

    I am more familiar with VB6. Also as this thread is in the Visual basic 6 section of the forum I thought it wouldnt be a problem to ask for it (as the URL link doesnt work)

  12. #12
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,395

    Re: [RESOLVED] File transfer through MODEM and MSCOMM

    Quote Originally Posted by greenelephant View Post
    I am more familiar with VB6. ...
    then it's time to learn the modern technologies!
    Victor Nijegorodov

  13. #13
    Join Date
    Nov 2019
    Posts
    5

    Re: [RESOLVED] File transfer through MODEM and MSCOMM

    I understand where you are coming from but I wish retrieve the code for this particular project. I dont have the time to relearn a new programming language for the sake of 1 project. Can you help me out or not please?

  14. #14
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,395

    Re: [RESOLVED] File transfer through MODEM and MSCOMM

    Quote Originally Posted by greenelephant View Post
    ... Can you help me out or not please?
    No, I cannot help you with using MSCOMM.
    MSCOMM worked well in time of Win16.

    But then in a real world beginning of Win32 it just sucks.
    Victor Nijegorodov

  15. #15
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: [RESOLVED] File transfer through MODEM and MSCOMM

    MSComm actually works fine in Win32. VB5 and 6 are both 32 bit and create 32bit executables, OCX files are 32 bit so this is intended to work under Win32 and does not work under older versions of Windows.

    As for file transfer while it can be done with MSComm it is much easier to use a tool that includes file transfer protocols like Z-Modem for example but even then serial file transfer is pretty much a thing of the past I would use it only if I had to opting for TCP transfer instead as that is much much faster and requires less code.
    Always use [code][/code] tags when posting code.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured