小编Com*_*tix的帖子

Notepad ++在退出时不保存文档?

情况:

在n ++中打开一个文本文件,进行一些修改,按ALT-F4或关闭程序.N ++不会问"你想保存你的更改吗".相反,它退出并且hdd上的文本文件保持不变.

但是当我再次打开N ++时,MODIFIED文件仍在那里.红色选项卡指示未保存的更改,我可以通过ctrl-s保存它.我也可以通过关闭标签来保存它(n ++会问).

我想每次关闭n ++时自动保存文件.除了这个,我所有的其他都是这样做的.我在n ++选项中找不到任何设置.任何的想法?

notepad++

50
推荐指数
3
解决办法
3万
查看次数

Dim As New与Dim/Set之间有什么区别

在VBA中,我可以通过以下两种方式之一创建对象:

'First way
Dim myCol1 As New Collection

'Second way
Dim myCol2 As Collection
Set myCol2 = New Collection

myCol1.Add "AAA"    'Works
myCol2.Add "BBB"    'Works as well
Run Code Online (Sandbox Code Playgroud)

第二种方式是第一种方式的更详细的版本,还是myCol1和myCol2对象之间实际上有区别?

vba

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

为 MS Access 制作 QRCode ActiveX 控件:控件源属性

我想在Access2010中实现QR码,我找到了https://github.com/yas78/QRCodeLibVBA。从 Access 引用 XLAM 不起作用,我不想将所有模块直接插入 Access,因为这会使项目变得混乱。因此,我决定使用古老的 VB6 创建一个 OCX 文件,因为这似乎是将所有位封装到一个简单对象中的最简单方法。

最后,我制作了一个OCX,它有几个关键属性:这是DataString要显示的字符串、、、、、ByteModeCharsetName还有方法ErrorCorrectionLevel、事件和ForeRGBBackRGBRefreshClsOnClickOnDblClick

它在 VB6 应用程序 + Excel 工作表 + Excel 表单中工作正常,但在 Access 表单、报告等中表现得很奇怪。

Excel 中的一切看起来都如人们所期望的那样: Excel 打印屏幕

这是它在 Access 中的样子: MS Access 打印屏幕

  • 自定义属性在“其他”选项卡上可见,但 VBA 编辑器中根本不提供它们!但是,手动输入时它会编译。
  • 调整控件大小的行为很奇怪
  • 控件的事件(如OnClick属性表的“事件”选项卡中不显示)

这是我的问题:

  1. 访问控制与其他办公应用程序“不同”吗?
  2. 为什么属性隐藏在编辑器中?
  3. 如何将某些属性“移动”到其他选项卡(类别),例如ForeRGB选项卡格式(如通常的文本框等)?
  4. 如何创建ControlSource可以直接绑定到记录集而无需使用 VBA 的属性(在“数据”选项卡上)?这样,我希望我也可以在连续表单上使用该控件。事实上,这是最重要的问题。
  5. 调整大小的一些技巧?(不重要)

我认为我已经非常接近我的目标了,但我现在陷入了困境。我知道 VB6 已过时,但在阅读了为 ms access 2010 创建自定义控件后,VB6 似乎是一个简单的选择。编写 OCX 有其他选择吗?

编辑:最终工作控制可在此处 https://github.com/Combinatix/QRCodeAX

vb6 ms-access vba activex qr-code

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

VBA CreateObject("MSXML2.DOMDocument60")抛出错误429

我在使用声明新对象时遇到问题 CreateObject()

Sub A()
    Dim x

    'This works
    Set x = CreateObject("Scripting.FileSystemObject")
    Set x = Nothing

    'This throws an error 429 "Active component cannot create object."
    Set x = CreateObject("MSXML2.DOMDocument60")
    Set x = Nothing

    'The only way I can create object is to add the reference using GUID
    Dim y As MSXML2.DOMDocument60
    Set y = New MSXML2.DOMDocument60
    Set y = Nothing
    'This works like a charm

End Sub
Run Code Online (Sandbox Code Playgroud)

我不明白为什么"脚本"有效,"MSXML2"没有.

我在Windows 7 64位上使用MS Access 2010 32位.

vba msxml access-vba ms-access-2010

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

有没有办法UnDim变量?

我只是想知道是否有可能取消变量.

想象一下,这是我在ASP页面中使用的#include文件

Dim MyVar
MyVar = "Hello World"
Response.write(MyVar)
'From now on I can not use Dim MyVar anymore as it throws an error
'I have tried
MyVar = Nothing
Set MyVar = Nothing
'But again, when you do
Dim MyVar
'It throws an error.
Run Code Online (Sandbox Code Playgroud)

原因是我不能每页多次使用相同的#INCLUDE文件.是的,我喜欢使用Option Explicit,因为它可以帮助我保持代码清洁.

*)编辑:我发现它并不像我想的那么清晰.

想象一下这是一个"include.asp"

<%
Dim A
A=1
Response.Cookie("beer")=A
%>
Run Code Online (Sandbox Code Playgroud)

现在的asp页面:

<!--#include file="include.asp"-->
<%
'Now: I do not see whats in include above and I want to use variable A
Dim A
'And I get …
Run Code Online (Sandbox Code Playgroud)

vbscript asp-classic

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

#define不会从主程序传播到class.cpp?

如果我从WotClass.h注释掉#define行,我得到了编译错误: WotClass.cpp:7: error: 'BFLM_DEFINE' was not declared in this scope

它不是假设与范围无关吗?或者是订单中的问题?

WotClass.h

#ifndef WOTCLASS_H
#define WOTCLASS_H

#define BFLM_DEFINE 1 // if commented out then compile fails.

class WotClass{
    public:
        WotClass();
        int foo();
    private:
};

#endif
Run Code Online (Sandbox Code Playgroud)

WotClass.cpp

#include "WotClass.h"

WotClass::WotClass(){}

int WotClass::foo(){
    return BFLM_DEFINE;
}
Run Code Online (Sandbox Code Playgroud)

Test.ino

#define BFLM_DEFINE 1 // This is before including class
#include "WotClass.h"

void setup(){
    Serial.begin(115200);
    Serial.println(BFLM_DEFINE);
    WotClass x;
    Serial.print(x.foo());
}

void loop(){}
Run Code Online (Sandbox Code Playgroud)

c++ class arduino

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

在#define 中相乘会给出奇怪的值

我为 Arduino Nano 编写了一个代码,我遇到了这种奇怪的行为:

#define     GREAT      (60 * 60000)
#define     STRANGE     (60 * 6000)
#define     ZERO_X      (60 * 1000)

void setup() {
    Serial.begin(115200);
    Serial.println(GREAT);      // Prints 3600000, that's correct
    Serial.println(STRANGE);    // Prints 32320, thats wrong
    long zerox = ZERO_X;
    Serial.println(zerox);      // Prints -5536, thats also wrong, obviously
}

void loop() {}
Run Code Online (Sandbox Code Playgroud)

到底是怎么回事?

我将 MSVS2019 社区与 vMicro 一起使用

arduino arduino-c++

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