China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-30 17:40
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » Help: Can't connect to the WattCP connection library with Borland C 3.1? View 6,900 Replies 36
Floor 16 Posted 2003-07-05 00:00 ·  中国 浙江 杭州 电信
初级用户
Credits 126
Posts 13
Joined 2003-06-30 00:00
23-year member
UID 6174
Gender Male
Status Offline
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.
Floor 17 Posted 2003-07-05 00:00 ·  中国 北京 鹏博士BGP
初级用户
Credits 152
Posts 19
Joined 2003-05-22 00:00
23-year member
UID 2324
Gender Male
Status Offline
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?
Floor 18 Posted 2003-07-05 00:00 ·  中国 北京 鹏博士BGP
初级用户
Credits 152
Posts 19
Joined 2003-05-22 00:00
23-year member
UID 2324
Gender Male
Status Offline
It's different from the msclient driver.

Floor 19 Posted 2003-07-05 00:00 ·  中国 北京 鹏博士BGP
初级用户
Credits 152
Posts 19
Joined 2003-05-22 00:00
23-year member
UID 2324
Gender Male
Status Offline

Floor 20 Posted 2003-07-06 00:00 ·  中国 浙江 杭州 电信
初级用户
Credits 126
Posts 13
Joined 2003-06-30 00:00
23-year member
UID 6174
Gender Male
Status Offline
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 */
}
Floor 21 Posted 2003-07-06 00:00 ·  中国 浙江 杭州 电信
初级用户
Credits 126
Posts 13
Joined 2003-06-30 00:00
23-year member
UID 6174
Gender Male
Status Offline
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.
Floor 22 Posted 2003-07-06 00:00 ·  中国 安徽 滁州 天长市 电信
银牌会员
★★★
Credits 1,833
Posts 648
Joined 2002-11-08 00:00
23-year member
UID 197
Gender Male
Status Offline
I haven't programmed about networks, and I haven't added LIBs to PRJ...
Can't help much...

Floor 23 Posted 2003-07-07 00:00 ·  中国 黑龙江 哈尔滨 联通
初级用户
Credits 144
Posts 15
Joined 2003-05-26 00:00
23-year member
UID 2429
Gender Female
Status Offline
to Qiuchan, that address can't be connected. Can you send me a copy? Thanks!
blue_viv@sohu.com
Floor 24 Posted 2003-07-07 00:00 ·  中国 黑龙江 哈尔滨 联通
初级用户
Credits 144
Posts 15
Joined 2003-05-26 00:00
23-year member
UID 2429
Gender Female
Status Offline
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.
Floor 25 Posted 2003-07-07 00:00 ·  中国 浙江 杭州 电信
初级用户
Credits 126
Posts 13
Joined 2003-06-30 00:00
23-year member
UID 6174
Gender Male
Status Offline
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.
Floor 26 Posted 2003-07-07 00:00 ·  中国 黑龙江 哈尔滨 联通
初级用户
Credits 144
Posts 15
Joined 2003-05-26 00:00
23-year member
UID 2429
Gender Female
Status Offline
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!

Floor 27 Posted 2003-07-07 00:00 ·  中国 浙江 杭州 电信
初级用户
Credits 126
Posts 13
Joined 2003-06-30 00:00
23-year member
UID 6174
Gender Male
Status Offline
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.
Floor 28 Posted 2003-07-08 00:00 ·  中国 黑龙江 哈尔滨 联通
初级用户
Credits 144
Posts 15
Joined 2003-05-26 00:00
23-year member
UID 2429
Gender Female
Status Offline
I also want to ask, does a makefile have the same function as compiling an engineering project in a compiler?
Floor 29 Posted 2003-07-08 00:00 ·  中国 浙江 杭州 电信
初级用户
Credits 126
Posts 13
Joined 2003-06-30 00:00
23-year member
UID 6174
Gender Male
Status Offline
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.
Floor 30 Posted 2003-07-08 00:00 ·  中国 黑龙江 哈尔滨 联通
初级用户
Credits 144
Posts 15
Joined 2003-05-26 00:00
23-year member
UID 2429
Gender Female
Status Offline
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!
Forum Jump: