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-21 11:33
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » The Terminator of DOS Interface Development View 94,127 Replies 290
Floor 271 Posted 2008-11-20 11:18 ·  中国 广东 深圳 电信
高级用户
★★
Credits 668
Posts 295
Joined 2005-07-26 00:00
20-year member
UID 41110
Gender Male
From 广东深圳
Status Offline
Originally posted by godai at 2008-7-17 12:00:
Mr. Guo, there is a phenomenon in the trial of your winsail program: that is, sometimes the PS2 mouse pointer flies around and drops occasionally in a vibrating environment. Initially judged to be an interference - caused mouse communication error...



Regarding the situation where the mouse jumps randomly in an industrial environment with vibration, it may be due to using a "photoelectric mouse". It is suggested to try using a "mechanical scroll mouse" in an industrial strong - vibration environment.
Floor 272 Posted 2009-03-05 00:45 ·  中国 广东 深圳 电信
初级用户
★★
Credits 138
Posts 67
Joined 2007-07-04 10:11
18-year member
UID 93093
Gender Female
From 云南
Status Offline
It seems that there hasn't been an update for a long time!
Floor 273 Posted 2009-03-15 10:05 ·  中国 湖北 武汉 电信
新手上路
Credits 16
Posts 8
Joined 2009-03-12 12:09
17-year member
UID 141144
Gender Male
Status Offline
Come and study a bit
Floor 274 Posted 2009-04-02 23:36 ·  中国 广东 深圳 电信
高级用户
★★
Credits 668
Posts 295
Joined 2005-07-26 00:00
20-year member
UID 41110
Gender Male
From 广东深圳
Status Offline
Window control supports "command shortcut key" function
void CWindow::AddCommandKey(WORD wKey, void far (*pMyFc)(CObject *));

Function: Add keyboard shortcut key (no need for control host)

Input parameters: wKey ------ Virtual key value. For example, F1 key is VK_F1, F2 key is VK_F2,..., F10 key is VK_F10
pMyFc ---- Callback function. The prototype is
void far MyFc(CObject* pObject)
{
CWindow* pWindow = (CWindow *)pObject;
//Add your own code below
//......
}
Output parameters: None
Return value: None

[ Last edited by firstsail on 2009-4-2 at 23:39 ]
Floor 275 Posted 2009-05-06 08:12 ·  中国 广东 深圳 电信
高级用户
★★
Credits 668
Posts 295
Joined 2005-07-26 00:00
20-year member
UID 41110
Gender Male
From 广东深圳
Status Offline
Discovery Process:
Some customers reported that when the program did not shut down normally, it often caused data loss in the database file, and the database file was illegal!
Check the Program:
In my own program, every time I write a data record, I have already called the "CFoxpro::Flush()" function, whose function is to truly write the data to the disk. If the situation mentioned above occurs, it should be that there is a problem with this function.

BOOL CFoxpro::Flush()
{
//Check the validity of the file pointer
if (NULL == m_pFile)
{
return(FALSE);
}

//Flush the disk buffer
::fflush(m_pFile);

return(TRUE);
}

Initially, it was suspected that the fflush() function provided by the C function library did not completely write the data in the disk buffer to the disk. After using the help file of BC31, it was found that this was indeed the case! The correct modification should be as follows
Solve the Problem:

Modify CFoxpro::Flush() as shown below, which has been solved

BOOL CFoxpro::Flush()
{
//Check the validity of the file pointer
if (NULL == m_pFile)
{
return(FALSE);
}

//Flush the disk buffer
::fflush(m_pFile);

int duphandle = ::dup(fileno(m_pFile));

::close(duphandle);

return(TRUE);
}
Floor 276 Posted 2009-05-16 01:11 ·  中国 广东 深圳 电信
高级用户
★★
Credits 668
Posts 295
Joined 2005-07-26 00:00
20-year member
UID 41110
Gender Male
From 广东深圳
Status Offline
In order to let everyone know how WINSAIL schedules TCP/IP in a single-task system, the following explanations are made!

(1) In the CWindow::OnIdle(CObject* pObj) function of the window, the socket loop function pointed to by the TCP/IP loop processing entry function pointer pSocketLoopFc is called.




The source code of CWindow::OnIdle(CObject* pObj) is as follows


extern BOOL bAfxNetcard; // Flag indicating whether a network card is configured in the CONFIG.Sys file
extern BOOL bAfxInitSocket; // Flag indicating whether the socket is successfully initialized
extern BOOL (*__pSocketInitFc)(); // Socket initialization function pointer
extern BOOL (*__pSocketCloseFc)();// Socket closing function pointer
extern BOOL (*__pSocketLoopFc)(BOOL, BOOL, BOOL);// Socket loop function pointer

void CWindow::OnIdle()
{
// Here, it is judged whether the TCP/IP stack needs to be executed
if (bAfxNetcard && bAfxInitSocket && __pSocketLoopFc != NULL)
{
__pSocketLoopFc(TRUE, TRUE, TRUE);
}

// Here, the "idle function pointer" registered by the void CWindow::SetIdleFc() function is executed
if (m_pIdleFc != NULL)
{
m_pIdleFc((CObject*)this);
}
}

(2) The source code of the function AfxRegisterNetcardEntry() for registering the TCP/IP protocol stack is as follows

BOOL AfxRegisterNetcardEntry(BOOL (*pSocketInitFc)(),
BOOL (*pSocketCloseFc)(), BOOL (*pSocketLoopFc)(BOOL, BOOL, BOOL))
{
if (pSocketInitFc == NULL || pSocketCloseFc == NULL)
{
return(FALSE);
}
__pSocketInitFc = pSocketInitFc;
__pSocketCloseFc = pSocketCloseFc;
__pSocketLoopFc = pSocketLoopFc;
return(TRUE);
}

(3) The default in WinSail
The socket initialization function: GlobalInitSocket() function
The socket closing function is: GlobalCloseSocket() function
The socket loop function: EthernetEntry() function

EthernetEntry only processes ARP, RARP, ICMP requests and sends out the packets that have not been sent in time, and other requests are ignored.
So users still need to rewrite their own "socket loop function".


// The following is the user's own "socket loop function". This can refer to the Sail2000.Cpp file and Remote_N.Cpp file of the Sail3000 project, which implements functions such as "file transfer, keyboard key sending, mouse key sending, screen uploading, QQ chatting".
BOOL User_EthernetEntry(BOOL bSingle, BOOL bSend, BOOL bIcmp)
{
// Run the default socket loop function
::EthernetEntry(bSingle, bSend, bIcmp);

// Write your own SOCKET query, read, write, etc. below
// (omitted)


return(TRUE);
}



(4) Since WINSAIL runs in a single task, any long-term blocking anywhere will cause the TCP/IP to be blocked for a long time. In order to reduce this situation, in the blocking loop, you must call

User_EthernetEnty(TRUE, TRUE, TRUE);


(5) If the user registers a third-party TCP/IP stack (such as Watcp, etc.), the initialization function must return TRUE if it is successful, otherwise return FALSE. WinSail automatically sets the return flag of the initialization function to the bAfxInitSocket variable, and don't forget to set the "netCard" key value in the "Netcard" segment of the config.Sys file to TRUE to perfectly integrate with WinSail!

The InitSystem() function in WINSAIL initializes the TCP/IP protocol stack in this way:



bAfxInitSocket = FALSE;

if (bAfxNetcard && __pSocketInitFc != NULL &&
__pSocketCloseFc != NULL)
{
if (!__pSocketInitFc())
{
__pSocketCloseFc();
bAfxInitSocket = FALSE;

//AfxMessageBox("Network","Failed to load network!");
}
else
{
bAfxInitSocket = TRUE;
}
}

[ Last edited by firstsail on 2009-5-16 at 02:25 ]
Floor 277 Posted 2009-11-15 09:08 ·  中国 广东 珠海 电信
新手上路
Credits 5
Posts 3
Joined 2009-11-09 05:24
16-year member
UID 154418
Gender Male
Status Offline
Nice stuff oh
Floor 278 Posted 2010-07-05 14:17 ·  中国 广东 深圳 电信
高级用户
★★
Credits 668
Posts 295
Joined 2005-07-26 00:00
20-year member
UID 41110
Gender Male
From 广东深圳
Status Offline
The website couldn't be logged in normally for several months due to an address resolution error. Now it can finally be logged in!
Floor 279 Posted 2010-07-09 13:56 ·  中国 北京 联通
新手上路
Credits 14
Posts 9
Joined 2010-07-03 20:00
15-year member
UID 169927
Gender Male
Status Offline
That's amazing. I don't understand it.
Floor 280 Posted 2011-01-14 11:15 ·  中国 广东 深圳 福田区 电信
高级用户
★★
Credits 668
Posts 295
Joined 2005-07-26 00:00
20-year member
UID 41110
Gender Male
From 广东深圳
Status Offline
Upgrading the MakeDlg.Exe File of WinSail



Two options are increased
(1) Interpret CLabel and CGroup controls as non-controls
(2) Align CGroup coordinates with Windows

<1> If the option "Interpret CLabel and CGroup controls as non-controls" is selected, then the generation code of all CLabel and CGroup controls is commented out, and the void FAR OnDraw_VccFunction(CObject *) function is generated. The code inside the function is as follows:

Among them, the CLabel control is interpreted as the ChPrintf() function
Among them, the CGroup control is interpreted as the DrawBoxCaptionEx() function

The purpose of such design is to save precious memory


<2> If the option "Align CGroup coordinates with Windows" is selected, then the visible border area of the Group control of WinSail is the same as that of the Windows Group control. It is strongly recommended to use this option.


Download address: http://www.firstsail.com.cn/software.html

[ Last edited by firstsail on 2011-1-14 at 11:23 ]
Floor 281 Posted 2011-01-16 00:48 ·  中国 广东 深圳 联通
新手上路
Credits 10
Posts 5
Joined 2010-11-07 01:21
15-year member
UID 177218
Gender Male
Status Offline
I am using China Unicom's network. I don't know why, I can't access Brother Guo's website "http://www.FirstSail.b2b.Cn".

Hope a kind friend can help send Brother Guo's software to my email. Thanks.
Email address: wuhengsi88@163.com
Floor 282 Posted 2011-01-19 10:16 ·  中国 广东 深圳 电信
高级用户
★★
Credits 668
Posts 295
Joined 2005-07-26 00:00
20-year member
UID 41110
Gender Male
From 广东深圳
Status Offline
Originally posted by wuhengsi at 2011-1-16 00:48:
I am using a Unicom network. I don't know why, I can't access Brother Guo's website "http://www.FirstSail.b2b.Cn".

I hope a kind friend can help send Brother Guo's software to my email. Thanks.
Email address: wuhengsi88@163.com



Website address is: http://www.firstsail.com.cn/softwafe.html
Email: szhello8@21cn.net
Floor 283 Posted 2016-12-24 23:58 ·  中国 广东 东莞 联通
新手上路
Credits 10
Posts 5
Joined 2016-12-24 10:55
9-year member
UID 182008
Gender Male
Status Offline
Study study
Floor 284 Posted 2018-07-13 20:16 ·  中国 广东 深圳 电信
新手上路
Credits 5
Posts 4
Joined 2017-05-16 20:00
9-year member
UID 182269
Gender Male
Status Offline
Long time no come back!
Floor 285 Posted 2018-07-14 12:08 ·  中国 广东 深圳 电信
高级用户
★★
Credits 668
Posts 295
Joined 2005-07-26 00:00
20-year member
UID 41110
Gender Male
From 广东深圳
Status Offline
In a single - chip microcomputer system or a Linux system, a custom database is often needed. How to make this database file recognizable by Office Excel under Windows? Now there is a method. You can use the database of Foxpro 2.6 version. The file structure is open and can be recognized by Excel.

In WinSail, it is composed of Foxpro.h and Foxpro.Cpp files. All the source code will be made public later. Those who need it can port it!
Forum Jump: