小编Con*_*con的帖子

“初始化”:无法从“const wchar_t[35]”转换为“LPWSTR”

我目前正在学习 C++,想要更改我的桌面壁纸。但是我收到上面这个错误。

#include <string>
#include <iostream>
#include <Windows.h>

using namespace std; 

int main() {

LPWSTR test = L"C:\\Users\\user\\Pictures\\minion.png";

int result = SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, 
test, SPIF_UPDATEINIFILE);


}
Run Code Online (Sandbox Code Playgroud)

“Const wchar_t*”类型的值不能用于初始化 LPWSTR 类型的实体

有任何想法吗?

谢谢

c++ lpwstr

3
推荐指数
1
解决办法
7731
查看次数

Okhttp 无法连接到本地主机端点抛出连接失败:ECONNREFUSED(连接被拒绝)

我正在尝试使用 okhttp 和 Flask 将本地后端和前端连接在一起,但是我收到 java.net.ConnectException: failed to connect to /127.0.0.1 (port 5000) after 10000ms: isConnected failed: ECONNREFUSED (Connection Dockered)例外

现在 API 确实可以正常工作,因为我可以在邮递员中访问它并返回值,这是代码

from flask import request, Flask
import getMovie
import getUser

api = Flask(__name__)

#Movie Endpoints

@api.route('/Movies/GetMovieById', methods=['GET'])
def get_movie_by_id():
    id = str(request.args['id'])
    return getMovie.getById(id)


@api.route('/Movies/All', methods=['GET'])
def get_all_movies():
    return getMovie.getAll()

#User Endpoints

@api.route('/Users/All', methods=['GET'])
def get_all_users():
    return getUser.getAll()

@api.route('/Users/GetUserById', methods=['GET'])
def get_user_by_id():
    id = str(request.args['id'])
    return getUser.getById(id)


if __name__ == '__main__':
    api.run()
Run Code Online (Sandbox Code Playgroud)

然后这是 Android 应用程序的主要活动

package com.example.moviebuffs

import …
Run Code Online (Sandbox Code Playgroud)

python android flask kotlin okhttp

1
推荐指数
1
解决办法
3443
查看次数

标签 统计

android ×1

c++ ×1

flask ×1

kotlin ×1

lpwstr ×1

okhttp ×1

python ×1