小编Gab*_*ros的帖子

如何在Visual Studio C++ Win32项目中填充组合框

如何在Visual Studio C++ Win32项目中填充组合框.如何检查用户选择了哪个单词.

我的意思是我想要一个充满这些的comboxbox:一,二,三.我想做不同的事件取决于用户选择哪一个.

编辑:窗口在资源编辑器中创建为对话框,消息线程运行如下:

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
    return DialogBox(hInst, MAKEINTRESOURCE(IDD_MAIN), NULL, DlgProc);
}
Run Code Online (Sandbox Code Playgroud)

先感谢您!

c++ winapi combobox visual-studio

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

c ++ win32使用DirectInput模拟Keypress

如何使用DirectInput模拟按键?我目前有初始化(但我不确定它是否好):

#include <dinput.h>

#pragma comment (lib, "dinput8.lib")
#pragma comment (lib, "dxguid.lib")

LPDIRECTINPUT8 din;    // the pointer to our DirectInput interface
LPDIRECTINPUTDEVICE8 dinkeyboard;    // the pointer to the keyboard device
BYTE keystate[256];    // the storage for the key-information

void initDInput(HINSTANCE hInstance, HWND hWnd);    // sets up and initializes DirectInput
void detect_input(void);    // gets the current input state
void cleanDInput(void);    // closes DirectInput and releases memory 
Run Code Online (Sandbox Code Playgroud)

那么有人可以告诉我如何模拟例如在游戏中按下左箭头键吗?

c c++ winapi directinput

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

c ++控制台应用程序,atof

我的问题如下.我尝试将字符串转换为double.通过这种方式:

string str = "1.1";
double d = atof(str.c_str());
Run Code Online (Sandbox Code Playgroud)

但这不起作用,它只返回1;

但如果我尝试:

string str = "1,1";
double d = atof(str.c_str());
Run Code Online (Sandbox Code Playgroud)

它返回1.1.

这真的很奇怪.似乎只有我写一个","它才能理解数字,但返回为".".

任何想法我怎么能解决这个转换"1.1"呢?

c++ atof

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

标签 统计

c++ ×3

winapi ×2

atof ×1

c ×1

combobox ×1

directinput ×1

visual-studio ×1