C语言、串口阅读器
我想制作一个读取串行端口(V.24)的程序。 根据来自串行端口的信息,我需要拆分一个字符串,并将其添加到 MySQL 数据库中。
我不太了解C,所以我需要一些关于我应该使用哪些功能的帮助
该程序必须在Windows XP下运行,并且我必须将其作为一个服务。
谢谢, 塞巴斯蒂安
I want to make a program that reads a serial port (V.24).
with the info from the serial port I need to split a string up, and add it to a MySQL database.
I don't know C very well, so I need some help with what functions I should use
The program has to run under windows XP, and I have to make it an service.
thanks,
Sebastian
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
服务调试起来很痛苦。我建议首先将代码编写为普通应用程序 - 命令行即可 - 然后,一旦它起作用,将其转换为服务(这是一个机械过程)。
一般来说,第一次用 C 语言编写基于 Windows GUI 的应用程序是一个 PITA。非常挑剔,非常敏感。命令行应用程序或服务会更容易一些。
Services are a pain to debug. I suggest writing your code as a normal application first - command line will do - and then, once it works, converting it to a service (which is a mechanical process).
In general, Windows GUI based apps in C are a PITA to write for the first time. Very finicky, very sensitive. A command line app or a service will be quite a bit easier.
我建议阅读本文。至于这是否会作为一项服务起作用,我不确定,但应该如此。
您还可以查看现有开源项目,看看是否可以将该源代码作为起点,或者如果他们已经解决了您的问题。
I recommend reading this. As for if this will work as a service, I am not sure, but it should.
You can also look at existing open source projects, to see if you can take that source as a starting point, or if they already solve your problems.