我尝试使用node.js创建类似char的东西我是nodejs中的新手,我想在没有socket.io的情况下创建它(我想学习它是如何工作的).这是我正在使用的代码.
var http = require('http');
var net = require('net');
var server = http.createServer(function(req,res){
res.writeHead(200,{'content-type' : 'text/html'});
res.write('<a href="./lol/">lol</a><br>');
res.end('hello world: '+req.url);
var client = new net.Socket();
client.connect('7001', '127.0.0.1', function() {
console.log('CONNECTED TO: ');
// Write a message to the socket as soon as the client is connected, the server will receive it as message from the client
client.write('I am Chuck Norris!');
});
// Add a 'data' event handler for the client socket
// data is what the server sent to …Run Code Online (Sandbox Code Playgroud) 我正试图从一个获得属性HWND.我使用了" 使用窗口属性"中的信息,但下面的示例对我不起作用.我在编译代码时遇到错误.
类型"BOOL(__stdcall*)(HWND hwndSubclass,LPCSTR lpszString,HANDLE hData)"的参数与"PROPENUMPROCEXW"类型的参数不兼容
这是我的回调函数
BOOL CALLBACK PropEnumProcEx(HWND hwndSubclass, LPCSTR lpszString, HANDLE hData) {
return TRUE;
}
Run Code Online (Sandbox Code Playgroud)
这就是我如何使用它
EnumPropsEx(hwnd, PropEnumProcEx, NULL);
Run Code Online (Sandbox Code Playgroud)
有人有任何关于如何解决这个问题的建议吗?