locked
Bug in VSPackage template (C#,DLL) RRS feed

  • Question

  • 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.


    • Edited by ZELEZIAKA Monday, July 7, 2014 9:02 AM
    Monday, July 7, 2014 9:02 AM

Answers

  • Hi,

    Since you have posted in connect (https://connect.microsoft.com/VisualStudio/feedback/details/917349/bug-in-vspackage-template-c-dll), please wait for the solution patiently. I'm sorry that I can't tell the specified time you need to wait. However, I have voted and I think the product team experts will help solve as soon as possible.

    Best regards, 


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Anna Cc Monday, July 28, 2014 1:46 PM
    Tuesday, July 15, 2014 8:22 AM

All replies

  • Hi,

    I tried to install Vs2005 to test your project.

    Since Visual Studio 2005 is an old compiler, I suggest you upgrade your compiler to the latest one for best performance.

    As to this issue, please post it in connect and the product team will help solve it.

    Thank you for understanding my work.

    Best regards, 


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, July 9, 2014 7:54 AM
  • Hi,

    I have managed to reproduce this problem in Visual Studio 2013.

    I have submitted my case in connect on Thursday last week.

    How much time will it take to solve that?

    How do you think?

    Sunday, July 13, 2014 7:21 PM
  • Hi,

    Since you have posted in connect (https://connect.microsoft.com/VisualStudio/feedback/details/917349/bug-in-vspackage-template-c-dll), please wait for the solution patiently. I'm sorry that I can't tell the specified time you need to wait. However, I have voted and I think the product team experts will help solve as soon as possible.

    Best regards, 


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Anna Cc Monday, July 28, 2014 1:46 PM
    Tuesday, July 15, 2014 8:22 AM