中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-10-31 11:09
47,815 topics / 349,930 posts / today 0 new / 48,290 members
DOS开发编程 & 发展交流 (开发室) » Help: Can't connect to the WattCP connection library with Borland C 3.1?
Printable Version  8,145 / 36
Floor16 戴眼镜的马 Posted 2003-07-05 00:00
初级用户 Posts 13 Credits 126
to->>Qiuchan
Received your email, I replied, but it was returned. Is your email broken?

I'm from Hangzhou, working in a research institute. It's about real-time control.

to->>glinda
Thank you for your guidance. May I ask, in the project file of BC31, how to use the *.lib file? Do I just use the Add Item menu to insert WATTCPLG.lib into the project? I actually tried this method, but it didn't work.
Floor17 秋蝉 Posted 2003-07-05 00:00
初级用户 Posts 19 Credits 152
1. http://www.jkmicro.com/documentation/pdf/borland.pdf has detailed descriptions of the project environment definition for connecting WattCP with BC4.5 (I haven't verified it)

2. If you want make to connect successfully, you don't need BC4.5: The batch for application compilation and linking is as follows
bcc -c -mh -r- -v- -IE:\borlandc\include -LE:\borlandc\include FC2000.CPP
bcc -c -mh -r- -v- -IE:\borlandc\include -LE:\borlandc\include FCCALC.CPP
bcc -c -mh -r- -v- -IE:\borlandc\include -LE:\borlandc\include FCHIS.CPP
bcc -c -mh -r- -v- -IE:\borlandc\include -LE:\borlandc\include FCINIT.CPP
bcc -c -mh -r- -v- -IE:\borlandc\include -LE:\borlandc\include FCSET.CPP
bcc -c -mh -r- -v- -IE:\borlandc\include -LE:\borlandc\include FCSETSYS.CPP
bcc -c -mh -r- -v- -IE:\borlandc\include -LE:\borlandc\include FCSHOW.CPP
bcc -c -mh -r- -v- -IE:\borlandc\include -LE:\borlandc\include IPX.CPP
bcc -c -mh -r- -v- -IE:\borlandc\include -LE:\borlandc\include KB_MQ.CPP
bcc -c -mh -r- -v- -IE:\borlandc\include -LE:\borlandc\include KB_TRQ.CPP
bcc -c -mh -r- -v- -IE:\borlandc\include -LE:\borlandc\include WJ_ZQ.CPP
tlink c0h FC2000 FCCALC FCHIS FCINIT FCSET FCSETSYS FCSHOW IPX KB_MQ KB_TRQ WJ_ZQ DLD16C,Fc2000,,wattcphg graphics fp87 mathh ch,

3. After installing the network card driver, why does it still say "NO PACKET DRVER FOUND" when running his example program? Can it work for you?
Floor18 秋蝉 Posted 2003-07-05 00:00
初级用户 Posts 19 Credits 152
It's different from the msclient driver.

Floor19 秋蝉 Posted 2003-07-05 00:00
初级用户 Posts 19 Credits 152

Floor20 戴眼镜的马 Posted 2003-07-06 00:00
初级用户 Posts 13 Credits 126
After using make here, the connection to the *.exe runs without problems. However, from the lights of the 8019 single-chip microcomputer received, the interval of the sent data is incorrect. I have used delay(30), in this case, the light of the 8019 on the receiving end should also light up once every 30ms. But it seems not right. I tracked the data step by step on the 8019 side and found that the data sent over seems to be correct. Why do I have to add *.lib in BC31? The reason is very simple, because I want to step through my own c file. But it's still not working now. The following is the.c source code that I modified after referring to the original \apps\tcptack in the DOS application WATTCP, and it sends 514 bytes over the network. The first 2 bytes represent that the length of the subsequent data packet is 512 bytes. The connection is successful through make. Please refer to and correct it. The fact shows that there is a problem with the interval of data sent by this code.

#include
#include
#include
#include
#include
#include

#define LIGHT_PORT 12345


int main(int argc, char *argv)
{
longword remoteip;
static tcp_Socket s;
char *host;
unsigned char inbuf,outbuf;
sock_init();
remoteip = inet_addr( "192.168.0.10" );

if ( !tcp_open( &s, 0, remoteip, LIGHT_PORT, NULL )) {
cputs("Unable to open connection.";
exit( 1 );
}
printf("Connect..Sucess\n";
// sock_wait_established( &s, sock_delay,NULL, &status);
// sock_puts( &s, inet_ntoa(buffer,gethostid()));
// sock_puts( &s, user );
// sock_wait_input( &s, sock_delay, NULL, &status );

// sock_gets( &s, buffer, sizeof( buffer ));

/* we are connected */

while ( 1 ) {
// if (sock_dataready( &s )) {
// sock_gets( &s, rbuffer, sizeof( rbuffer ));
// add_msg( remoteuser, rbuffer );
// sock_read( &s, inbuf, 5140 );
// }
*(unsigned int*)outbuf = (unsigned int)512;
outbuf = 1;outbuf = 2;
sock_write( &s, outbuf,514 );
delay(30);
printf("Out data Over \n";
if( kbhit() )
break;
}
exit( 0 );
return (0); /* not reached */
}
Floor21 戴眼镜的马 Posted 2003-07-06 00:00
初级用户 Posts 13 Credits 126
to-》》1.ttp://www.jkmicro.com/documentation/pdf/borland.pdf This address only shows how to create a *.prj and add a *.cpp file, but it doesn't say how to add a *.lib. Please verify it again.
Floor22 LanE Posted 2003-07-06 00:00
银牌会员 Posts 648 Credits 1,835
I haven't programmed about networks, and I haven't added LIBs to PRJ...
Can't help much...

Floor23 glinda Posted 2003-07-07 00:00
初级用户 Posts 15 Credits 144
to Qiuchan, that address can't be connected. Can you send me a copy? Thanks!
[email protected]
Floor24 glinda Posted 2003-07-07 00:00
初级用户 Posts 15 Credits 144
To 戴眼镜的马 In BC, the way to use the lib file is like this. But you should first delete the source files that are included in the library in the project file.
Floor25 戴眼镜的马 Posted 2003-07-07 00:00
初级用户 Posts 13 Credits 126
to-->>glindaExcuse me: How exactly to use it?

Can you send me a *.prj that has passed compilation in BC31, and there are library files .lib included in the .prj.

Thanks.
Floor26 glinda Posted 2003-07-07 00:00
初级用户 Posts 15 Credits 144
Just add the lib file directly, what you did should be correct.
I also tried to create a prj file and add the wattcp library, but it didn't work. Do we not need to regenerate its library?

Also, I have another silly question. How do I use the written makefile file? : ) Thanks!

Floor27 戴眼镜的马 Posted 2003-07-07 00:00
初级用户 Posts 13 Credits 126
to-->>glinda
How to generate the wattcp library? Hehe, it would be great if it can be generated.

The makefile is written, and run the make.exe program in the current directory. This make program is in the \borlandc\bin directory. So you need to set the Dos path, set path=c:\borlandc\bin, and it should be okay. The above make is for BC3.1.
Floor28 glinda Posted 2003-07-08 00:00
初级用户 Posts 15 Credits 144
I also want to ask, does a makefile have the same function as compiling an engineering project in a compiler?
Floor29 戴眼镜的马 Posted 2003-07-08 00:00
初级用户 Posts 13 Credits 126
to->>glinda

Yes. The role of the makefile is the same as that of a project file.

Hehe.

Today I heard from the moderator that your wattcp seems quite capable. I wonder if you have written a wattcp TCP program.
Floor30 glinda Posted 2003-07-08 00:00
初级用户 Posts 15 Credits 144
Me? No way, I'm just starting out too. I'm still far behind you!!
I have a task and have to do this!! I can only bite the bullet and do it. You see, I'm just asking silly questions, which shows I don't have much foundation. : ) But I think I can program following its examples.
Let's learn from each other. It seems your progress is faster. Please give me more advice!
Prev  1 2 3  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023