Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to transfer a file to an ActiveX EXE server

Status
Not open for further replies.

RHill

Programmer
Sep 18, 2001
3
CA
I am using DCOM for the first time and as I am developing the app I have found a need to transfer a file directly from the client to the remote ActiveX EXE server. I am using VB6. I have scoured the net and am a little confused. I keep hitting upon binary transfers through a variant?!?! I have read the MSDN article on passing a picture object but this has done little to help. Thoughts? Suggestions? Code snippets? I guess I could just map a drive and copy the file but that's not too sexy.

Thanks in advance
 
binary transfers through a variant is do-able. You'd just open the file in binary mode on the source machine for reading, and open the file in binary mode on the destination machine for writing. Then make as many DCOM calls as needed to transfer the contents.

You'll need to also pass some flow control info along with the data. Stuff like "Here's the filename", "Here's the length & create date", "Here's a data block", "Transfer complete", etc.

Chip H.
 
Why a variant?

What am I missing?

Wouldn't it make more sense to just use a dynamic byte array as the data parameter, with a separate enum parameter for control or else three methods like...

SendStart(ByVal strFileName, ByVal dtCreation, ByVal lLength),
SendChunk(ByVal bytChunk()), and
SendComplete(ByVal lCheckSum) ?

Again, what am I missing? I know I'm probably being dense here.
 
Dilettante,
When I started to research this problem, I found article Q180714 in MSDN which stated that using a variant caused less network traffic. I also found examples on the net where byte arrays were packed in a variant data type and unpacked by the remote server. I was a little confused by this method. Your method sounds simpler. Have you done this before? What is the transfer speed like?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top