Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

Bug in VSPackage template (C#,DLL)

$
0
0

Hi everyone,

I have faced with a strange code behavior in VSpackage. This bug is easy reproduce.

I have created a simple template which clearly shows what is going on.

Here is the link to the project:

Link to Project

The problem is the following.

There is a simple VSpackage template there. I have created it using Visual Studio 2005 Wizard. The C# is the language.

Also there is a simple C++ DLL created also in Visual Studio 2005.

The VSPAckage has Initialize method.

I'm trying to allocate 400MB of memory there using AllocHGlobal function.

Before allocating memory i'm calling function from DLL. It is SetPixelFormat.

I don't have any window and i'm passing 0 as the window as the handle. But that is not the issue.

The problem is that i'm getting exception allocating the memory. Insufficient memory.

If i comment SetPixelFormat in DLL the memory is allocated fine.

What is the problem. It is very important for me. I spend a week trying to understand what is going on.

I can't debug into AllocHGlobal. That is disappointing.

PS: There is path to DLL in C# project. Please change it to your absolute path as DLL's are not in the same directory.

PSS: Please to run the project put breakpoint in Initialize method and press F5.



Viewing all articles
Browse latest Browse all 4410

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>