惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
J
Java Code Geeks
雷峰网
雷峰网
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
云风的 BLOG
云风的 BLOG
V
Visual Studio Blog
V
Vulnerabilities – Threatpost
S
Securelist
The Hacker News
The Hacker News
The Register - Security
The Register - Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Help Net Security
Help Net Security
G
Google Developers Blog
Hugging Face - Blog
Hugging Face - Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
M
MIT News - Artificial intelligence
AI
AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The GitHub Blog
The GitHub Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Schneier on Security
Schneier on Security
N
Netflix TechBlog - Medium
T
The Blog of Author Tim Ferriss
Google DeepMind News
Google DeepMind News
Hacker News - Newest:
Hacker News - Newest: "LLM"
H
Hacker News: Front Page
博客园 - 司徒正美
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
B
Blog
Microsoft Azure Blog
Microsoft Azure Blog
大猫的无限游戏
大猫的无限游戏
Security Latest
Security Latest
Engineering at Meta
Engineering at Meta
N
News and Events Feed by Topic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
酷 壳 – CoolShell
酷 壳 – CoolShell
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Threat Research - Cisco Blogs
U
Unit 42
V
V2EX
V2EX - 技术
V2EX - 技术
L
LINUX DO - 最新话题
aimingoo的专栏
aimingoo的专栏
Microsoft Security Blog
Microsoft Security Blog
Recorded Future
Recorded Future
P
Privacy & Cybersecurity Law Blog
美团技术团队
小众软件
小众软件
F
Fortinet All Blogs

博客园 - 瓶子

泛型抽象厂。模式练习1 范型与反射乱画。 小技巧:用javascript实现asp.net中ispostback功能! - 瓶子 - 博客园 给定一个集合,求出其所有子集合 把以"文本文件(制表符分割)"保存的EXCEL文件导进SQLSERVER2000的DEMO! ObjectARX 2007已经发布一个多月了.贴下载地址! sql server 2005 排序规则与大小写敏感   (sql server2005学习笔记1) HELLO MONO! 德里达逝世了! - 瓶子 - 博客园 CBI——宇宙新的婴儿照片 Longhorn的糟糕体验! en! ~c#真的好简洁。贴段C#到VB的小典型。 为什么ICON类型没有EQUALS方法呢? 与音乐,,纪念Arthur Rimbaud诞辰150周年 SharpDevelop 并不RUN OUTSIDE IIS 的RUN OUTSIDE IIS 有关SQL排序规则---------即"无法解决 equal to 操作的排序规则冲突"等等的菜问题. 兰波生平 今天,终于注册了BLOG了.是菜鸟.请大家关照! 还有我的小简介
Is there any way to get detailed error information for Win32 errors when using Platform Invoke?
瓶子 · 2004-08-30 · via 博客园 - 瓶子

you can use the FormatMessage Win32 API. Sample projects for C# and VB.NET are enclosed. This is how the declaration looks like:

          [DllImport("Kernel32.dll")]

          public static extern int FormatMessage(int flags, IntPtr source, int messageId, int languageId, StringBuilder

               buffer, int size, IntPtr arguments );


// You can call FormatMessage to get a descriptive error message

                    StringBuilder sbFormatMessage = new StringBuilder(1024);

                    retVal = Interop.FormatMessage(Interop.FORMAT_MESSAGE_FROM_SYSTEM, IntPtr.Zero, Marshal.GetLastWin32Error(), 0, sbFormatMessage,

                         sbFormatMessage.Capacity, IntPtr.Zero);