loadlibrary失败,错误8 [英] loadlibrary fail with error 8

查看:198
本文介绍了loadlibrary失败,错误8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个程序可以复制一个dll并多次加载它。



在第7个loadlibrary命令中,操作失败并显示失败 - 存储空间不足(错误代码8)



i我正在加载4个dll',然后释放它们(freelibrary)再加载它们



我用8 GB内存赢了7并在VS2008中用c / c ++写作



当我看到任务管理器时我没有看到任何异常可能是我没有找到正确的位置,应用程序的内存使用量不超过1,300,000 KB



如果我使用6个loadlibary命令运行应用程序它可以正常工作。



这可能是dll中的问题吗?



我以为我的电脑相当强大,应该可以满足内存需求。



我试图解决这个问题3天。



希望有人可以帮助我

< br $> b $ b谢谢



dj4400

解决方案

我有一个复制a的程序dll并加载多次。什么???



你复制DLL然后调用LoadLibrary吗?



同样的dll会不能通过相同的进程多次加载。



MSDN说:

对于尚未调用的每个DLL,系统调用DLL的入口点函数。

这个调用是在导致进程地址空间改变的线程的上下文中进行的,

如主要的进程的线程或调用LoadLibrary的线程。

...

DllMain中的线程持有加载程序锁定,因此不能动态加载或初始化其他DLL。 br $>


http:// msdn .microsoft.com / zh-CN / library / windows / desktop / ms682583.aspx



如果在加载相同的DLL几次后出现问题LoadLibrary()的内容

必须在你的DLL中出错。



DLL做了什么以及为什么要多次加载?


这可能对你有所帮助 - > http:// stackoverflow。 com / questions / 507853 / system-error-code-8-not-enough-storage-is-available-to-process-this-command [ ^ ]

Hi,

I have a program that duplicates a dll and loads it multiple times.

in the 7th loadlibrary command the operation failed with the failure - "not enough storage" (error code 8)

i am loading 4 dll''s, then release them (freelibrary) and load them again

I have win 7 with 8 GB of memory and working in VS2008 writing in c/c++

when i look at the task manager i don''t see anything unusual may be i am not looking in the right place, the memory usage of the application doesn''t exceed 1,300,000 KB

if i run the app with 6 loadlibary commands it works ok.

Could It be a problem in the dll?

I thought my PC is rather strong and it should be able to stand in memory demands.

I am trying to solve this problem for 3 days.

hope someone can help me

thanks

dj4400

解决方案

"I have a program that duplicates a dll and loads it multiple times." What ???

Do you copy the DLL and then call LoadLibrary ?

The same dll would not be loaded several times by the same Process.

MSDN says:
"For each DLL that has not already been called, the system calls the DLL''s entry-point function.
This call is made in the context of the thread that caused the process address space to change,
such as the primary thread of the process or the thread that called LoadLibrary.
...
Threads in DllMain hold the loader lock so no additional DLLs can be dynamically loaded or initialized."

http://msdn.microsoft.com/en-us/library/windows/desktop/ms682583.aspx

If the Problem occurs after loading the same DLL several times with LoadLibrary() something
must go wrong inside your DLL.

What does the DLL do and why are you loading it several times ?


This might help you -> http://stackoverflow.com/questions/507853/system-error-code-8-not-enough-storage-is-available-to-process-this-command[^]


这篇关于loadlibrary失败,错误8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆