首页 \ 问答 \ 循环中的迭代(Iterations In From Loop)

循环中的迭代(Iterations In From Loop)

有没有办法在vba中说:

from x = 1 to 100, by 10

所以x的值是1,10,20,30等到100?


is there a way to say in vba something like:

from x = 1 to 100, by 10

so that the x's are 1, 10, 20, 30, etc. to 100?


原文:https://stackoverflow.com/questions/3712000
更新时间:2024-02-22 20:02

最满意答案

  • 在32位和64位Windows中, LoadLibrary在失败时返回NULL
  • 在16位Windows中LoadLibrary返回一个小于32的值来表示失败。

KB142814显然是从16位Windows日期开始的,如果仔细观察,您会看到一个kb16bitonly关键字。 我认为假设您不再开发16位Windows是安全的!

Raymond Chen在这件事上的一些相关文章:

LoadLibrary的现代文档位于: https//msdn.microsoft.com/en-us/library/windows/desktop/ms684175.aspx ,这是您问题中的第一个链接。 它说:

返回值

如果函数成功,则返回值是模块的句柄。

如果函数失败,返回值为NULL。 要获得扩展的错误信息,请调用GetLastError。


  • In 32 and 64 bit Windows, LoadLibrary returns NULL on failure.
  • In 16 bit Windows LoadLibrary returns a value less than 32 to indicate failure.

KB142814 clearly dates from the 16 bit Windows days, and if you look closely you will see a kb16bitonly keyword. I think it is safe to assume that you are not developing for 16 bit Windows anymore!

Some relevant articles from Raymond Chen on this matter:

The modern day documentation for LoadLibrary is here: https://msdn.microsoft.com/en-us/library/windows/desktop/ms684175.aspx, that is the first link in your question. It says:

Return value

If the function succeeds, the return value is a handle to the module.

If the function fails, the return value is NULL. To get extended error information, call GetLastError.

相关问答

更多
  • 我通过将C:\ Program Files \ R \ R-3.4.3 \ bin \ x64添加到路径来解决此问题。 我认为当我卸载了以前的R版本时,该地址已从路径中删除。 根据R for Windows FAQ ,您需要在安装新版本后手动将地址安装到路径中。 I solved the problem by adding C:\Program Files\R\R-3.4.3\bin\x64 to the path. I think that this address was deleted from th ...
  • 文件说: 如果函数成功,则返回值是模块的句柄。 如果函数失败,则返回值为NULL 。 要获取扩展错误信息,请调用GetLastError 。 函数成功时,返回值不为NULL 。 这是你的方案。 如果函数成功,文档不会保证GetLastError将返回什么。 一些Win32 API函数会在返回之前调用SetLastError(ERROR_SUCCESS) ,但不是全部。 这是一个没有的。 换句话说,没有错误。 函数返回值表示成功,您不应该调用GetLastError因为它返回的值是没有意义的。 The doc ...
  • 有一个操作系统工具来帮助诊断这样的问题。 下载SDK或DDK并使用gflags.exe为该过程设置“显示加载程序捕捉”(+ sls)。 这应该会揭示为什么DLL加载失败。 加载程序捕捉输出将显示在调试器输出窗口中。 马丁 There is an OS tool to help diagnose problems like this. Download the SDK or DDK and use gflags.exe to set 'Show Loader Snaps' (+sls) for the pro ...
  • KeBugCheck是一个内核函数。 这意味着您无法从用户模式代码中调用它,就像您尝试编写的应用程序一样。 此功能也没有提供用户模式包装器,因为用户模式代码不应该能够关闭整个系统。 您必须编写自己的内核模式驱动程序才能执行此操作。 要开始使用,请下载Windows驱动程序开发工具包(DDK) 。 在这种情况下,不需要整个LoadLibrary和GetProcAddress ,因为函数声明位于公共Ntddk.h头文件中,并且将自动从Ntoskrnl.lib文件链接。 至于你在这里遇到的问题, LoadLibr ...
  • 在32位和64位Windows中, LoadLibrary在失败时返回NULL 。 在16位Windows中LoadLibrary返回一个小于32的值来表示失败。 KB142814显然是从16位Windows日期开始的,如果仔细观察,您会看到一个kb16bitonly关键字。 我认为假设您不再开发16位Windows是安全的! Raymond Chen在这件事上的一些相关文章: HINSTANCE和HMODULE有何区别? 我可以用ShellExecute函数返回的HINSTANCE做什么? LoadLib ...
  • 尝试: [DllImport("kernel32", SetLastError = true] static extern IntPtr LoadLibraryW([MarshalAs(UnmanagedType.LPWStr)]string lpFileName); 底层的Win32 API有两种版本:ASCII模式(只允许字符串中的ASCII字符)和Unicode模式(允许字符串中的UTF16字符)。 C#是基于UTF16的,基本上,你用UTF16字符串调用了一个ASCII风格的函数,你需要明确地告诉 ...
  • 好吧,我解决了我的问题,不幸的是,这是一个相当明显的解决方案。 我将包含我的dll的目录添加到PATH变量中。 显然dll不会在自己的目录中查找它们的依赖项。 Well I solved my problem, and unfortunately it's a fairly obvious solution. I added the directory that contained my dll to the PATH variable. Apparently dlls don't look in thei ...
  • 错误代码看起来像是“错误的位”,这意味着您可能混合了32位和64位可执行文件/ DLL。 项目属性“链接器 - >高级 - >目标机器”中的设置应该设置为您的DLL中的相同值,并在可执行文件中加载该DLL。 The error code looks like it has the "wrong bitness", meaning you're probably mixing 32-bit and 64-bit executables/DLLs. The setting in the Project prop ...
  • 你的DLL几乎肯定会调用一些试图从其DLLMain()内部获取加载器锁的东西。 你所描述的被称为死锁,这些症状完全适合这个特殊问题。 Your DLL is almost certainly calling something that tries to obtain the loader lock from inside its DLLMain(). What you describe is called deadlock and these symptoms fit this particular is ...

相关文章

更多

最新问答

更多
  • 如何在Laravel 5.2中使用paginate与关系?(How to use paginate with relationships in Laravel 5.2?)
  • linux的常用命令干什么用的
  • 由于有四个新控制器,Auth刀片是否有任何变化?(Are there any changes in Auth blades due to four new controllers?)
  • 如何交换返回集中的行?(How to swap rows in a return set?)
  • 在ios 7中的UITableView部分周围绘制边界线(draw borderline around UITableView section in ios 7)
  • 使用Boost.Spirit Qi和Lex时的空白队长(Whitespace skipper when using Boost.Spirit Qi and Lex)
  • Java中的不可变类(Immutable class in Java)
  • WordPress发布查询(WordPress post query)
  • 如何在关系数据库中存储与IPv6兼容的地址(How to store IPv6-compatible address in a relational database)
  • 是否可以检查对象值的条件并返回密钥?(Is it possible to check the condition of a value of an object and JUST return the key?)
  • GEP分段错误LLVM C ++ API(GEP segmentation fault LLVM C++ API)
  • 绑定属性设置器未被调用(Bound Property Setter not getting Called)
  • linux ubuntu14.04版没有那个文件或目录
  • 如何使用JSF EL表达式在param中迭代变量(How to iterate over variable in param using JSF EL expression)
  • 是否有可能在WPF中的一个单独的进程中隔离一些控件?(Is it possible to isolate some controls in a separate process in WPF?)
  • 使用Python 2.7的MSI安装的默认安装目录是什么?(What is the default installation directory with an MSI install of Python 2.7?)
  • 寻求多次出现的表达式(Seeking for more than one occurrence of an expression)
  • ckeditor config.protectedSource不适用于editor.insertHtml上的html元素属性(ckeditor config.protectedSource dont work for html element attributes on editor.insertHtml)
  • linux只知道文件名,不知道在哪个目录,怎么找到文件所在目录
  • Actionscript:检查字符串是否包含域或子域(Actionscript: check if string contains domain or subdomain)
  • 将CouchDB与AJAX一起使用是否安全?(Is it safe to use CouchDB with AJAX?)
  • 懒惰地初始化AutoMapper(Lazily initializing AutoMapper)
  • 使用hasclass为多个div与一个按钮问题(using hasclass for multiple divs with one button Problems)
  • Windows Phone 7:检查资源是否存在(Windows Phone 7: Check If Resource Exists)
  • 无法在新线程中从FREContext调用getActivity()?(Can't call getActivity() from FREContext in a new thread?)
  • 在Alpine上升级到postgres96(/ usr / bin / pg_dump:没有这样的文件或目录)(Upgrade to postgres96 on Alpine (/usr/bin/pg_dump: No such file or directory))
  • 如何按部门显示报告(How to display a report by Department wise)
  • Facebook墙贴在需要访问令牌密钥后无法正常工作(Facebook wall post not working after access token key required)
  • Javascript - 如何在不擦除输入的情况下更改标签的innerText(Javascript - how to change innerText of label while not wiping out the input)
  • WooCommerce / WordPress - 不显示具有特定标题的产品(WooCommerce/WordPress - Products with specific titles are not displayed)