小编C. *_*sti的帖子

尝试构建 XLL“该程序无法在 DOS 模式下运行”

我一直在尝试构建一个简单的 XLL,它仅使用硬编码命令行创建一个进程。这是我的代码:

#include "pch.h"

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
                     )
{
    switch (ul_reason_for_call)
    {
    case DLL_PROCESS_ATTACH: {
        LPSTARTUPINFOA si = new STARTUPINFOA();
        LPPROCESS_INFORMATION pi = new PROCESS_INFORMATION();
        CreateProcessA(NULL, (LPSTR)"notepad.exe", NULL, NULL, TRUE, CREATE_SUSPENDED, NULL, NULL, si, pi);
    }
    case DLL_THREAD_ATTACH:
    case DLL_THREAD_DETACH:
    case DLL_PROCESS_DETACH:
        break;
    }
    return TRUE;
}
Run Code Online (Sandbox Code Playgroud)

基本上创建 DLL,然后将其重命名为 XLL。我正在使用 Visual Studio 2019,以下是我的编译标志:

/JMC /permissive- /Yu"pch.h" /ifcOutput "x64\Debug\" /GS /W3 /Zc:wchar_t /ZI /Gm- /Od /sdl /Fd"x64\Debug\vc142.pdb" /Zc:inline /fp:precise /D "_DEBUG" /D "EVIL_EXPORTS" /D "_WINDOWS" …
Run Code Online (Sandbox Code Playgroud)

c++ dll excel xll

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

用鼠标拖动滚动

我试图制作一个可滚动的面板但没有滚动条并通过垂直拖动滚动...这是有人帮助我做到目前为止...:

 private void panel1_MouseEnter(object sender, EventArgs e)
    {
        panel1.AutoScroll = false;
    }

    private int ValidateChange(int change)
    {
        var padding = -1;
        if (change < 0)
        {
            var max = (from Control control in Controls select control.Top + control.Height + padding).Concat(new[] { int.MinValue }).Max();

            if (max < Height + Math.Abs(change))
            {
                return Height - max;
            }
        }
        else
        {
            var min = (from Control control in Controls select control.Top).Concat(new[] { int.MaxValue }).Min();

            if (min > padding - Math.Abs(change))
            {
                return padding …
Run Code Online (Sandbox Code Playgroud)

c# winforms

4
推荐指数
2
解决办法
2814
查看次数

显示指针减法

好的,我说我有一个序列"abcdefg"

char* s = strdup("abcdefg");
char* p;
char* q;
p = strchr(s, 'c');// -> cdefg
q = strchr(p, 'd');// -> defg
Run Code Online (Sandbox Code Playgroud)

我想s - p基本上显示abcdefg - cdefg = ab,我可以使用指针算法吗?

c pointers char sequence

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

获取函数返回Promise <pending>

所以我的代码在这里返回一个Promise,因为我使用then语法,我不知道为什么会发生这种情况: - ??

fetch('someurltoAJsonFile.json')
  .then(function(response) {
    console.log(response.json());});
Run Code Online (Sandbox Code Playgroud)

javascript json fetch

2
推荐指数
2
解决办法
1531
查看次数

奇怪的 C++ 错误,不合格的 ID,重新声明

我想创建一个项目,我有3个文件,一个test.cppsomething.h和一个something.cpp。他们来了:

测试.cpp:

#include <bits/stdc++.h>
#define f cin
#define g cout
#include "something.h"
using namespace std;

int main(void)
{
    int x;
    register(x);
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

东西.h:

#ifndef __SOMETHING__H_
#define __SOMETHING__H_
#include <bits/stdc++.h>

void register(int x);
#endif
Run Code Online (Sandbox Code Playgroud)

东西.cpp:

#include "something.h"

void register(int x)
{
    std::cout << x << '\n';
}
Run Code Online (Sandbox Code Playgroud)

这是我得到的错误:

In file included from test.cpp:4:0:
something.h:5:15: error: expected unqualified-id before ‘int’
 void register(int x);
               ^~~
something.h:5:15: error: expected ‘)’ before ‘int’
test.cpp: In function ‘int …
Run Code Online (Sandbox Code Playgroud)

c++ file

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

标签 统计

c++ ×2

c ×1

c# ×1

char ×1

dll ×1

excel ×1

fetch ×1

file ×1

javascript ×1

json ×1

pointers ×1

sequence ×1

winforms ×1

xll ×1