managed

System:Uint32^ in C++/CLI compiles to VaueType in C#?

你离开我真会死。 提交于 2021-02-11 04:28:21
问题 In a C++/CLI class library I have the following function: static System::UInt32^ Fn() { return gcnew System::UInt32(0); } When I use the class library in a C# the System::Uint32 is a System::ValueType and the compiler error: Error 1 Cannot implicitly convert type 'System.ValueType' to 'uint'. An explicit conversion exists (are you missing a cast?) Why is it that when I'm defiing a System::UInt32 in C++/CLI I get a ValueType in C#? Thanks 回答1: UInt32 is a value type ( struct in C#), not a

System:Uint32^ in C++/CLI compiles to VaueType in C#?

旧巷老猫 提交于 2021-02-11 04:26:15
问题 In a C++/CLI class library I have the following function: static System::UInt32^ Fn() { return gcnew System::UInt32(0); } When I use the class library in a C# the System::Uint32 is a System::ValueType and the compiler error: Error 1 Cannot implicitly convert type 'System.ValueType' to 'uint'. An explicit conversion exists (are you missing a cast?) Why is it that when I'm defiing a System::UInt32 in C++/CLI I get a ValueType in C#? Thanks 回答1: UInt32 is a value type ( struct in C#), not a

How can I modify HTTP headers in ASP.NET (Web Forms) that are defined in web.config

孤者浪人 提交于 2021-02-07 14:22:54
问题 I have some custom HTTP response headers defined in an ASP.NET (Web Forms) website's web.config. I'm trying to write a managed HTTP module that can modify these web.config defined headers before they're sent back to the client. Unfortunately, whatever event I use (PreSendRequestHeaders, EndRequest) , the headers defined in web.config do not exist in the Response.Headers collection. I'm aware that PreSendRequestHeaders is not recommended so I also tried using Response.AddOnSendingHeaders but

VS ignores symbol _Debug in Resources.rc (Visual Studio bug ?)

…衆ロ難τιáo~ 提交于 2021-01-28 19:49:26
问题 Can anybody explain me that very strange fenomenon ? In my VS2005 Managed C++ project file (VCPROJ) is defined: <Configuration Name="Debug|Win32" .... PreprocessorDefinitions="WIN32;_DEBUG" .... </Configuration> <Configuration Name="Release|Win32" .... PreprocessorDefinitions="WIN32;NDEBUG" .... </Configuration> Whereever I used the symbol _Debug it works perfect. For example: #ifdef _DEBUG #include "noexist.h" #endif produces an error C1083: Cannot open include file: 'noexist.h': No such

How can you explore the managed heap in a .NET application to identify possible memory optimizations?

社会主义新天地 提交于 2020-02-18 13:03:37
问题 We have a .NET application which our customers consider too large for mass deployment and we would like to understand what contributes to our memory footprint and is it possible to do any better without completely abandoning .NET and wpf. We are interested in improving both Total Size and the Private Working Set (pws). In this question I just want to look at pws. VMMap typically reports a pws of 105 mb. Of this 11mb is image, 31mb is heap, 52 mb is managed heap, 7 mb is private data and the

How can you explore the managed heap in a .NET application to identify possible memory optimizations?

折月煮酒 提交于 2020-02-18 13:02:59
问题 We have a .NET application which our customers consider too large for mass deployment and we would like to understand what contributes to our memory footprint and is it possible to do any better without completely abandoning .NET and wpf. We are interested in improving both Total Size and the Private Working Set (pws). In this question I just want to look at pws. VMMap typically reports a pws of 105 mb. Of this 11mb is image, 31mb is heap, 52 mb is managed heap, 7 mb is private data and the

EWS - This operation can't be performed because one or more items are new or unmodified

ぃ、小莉子 提交于 2020-01-25 02:55:50
问题 Relating to a batch update question I asked previously about using a single update to mark as read all the unread emails, I could use ExchangeService.UpdateItems according to Jason's answer. So I modified accordingly: Folder.Bind(Service, WellKnownFolderName.Inbox); SearchFilter sf = new SearchFilter.SearchFilterCollection(LogicalOperator.And, new SearchFilter.IsEqualTo(EmailMessageSchema.IsRead, false)); //ItemView limits the results to numOfMails2Fetch items FindItemsResults<Item>

C++/CLI: wrapping the same unmanaged object in multiple managed objects

老子叫甜甜 提交于 2020-01-16 08:45:10
问题 I am developing a library which has two layers, unmanaged (C++) and managed (C++/CLI). The unmanaged layer contains the logics and the computation algorithms, while the managed layer provides interface and visualisation to a .NET-based host application. A class in the managed layer wraps its class counterpart in the unmanaged layer, e.g. ManagedA wraps UnmanagedA and ManagedB wraps UnmanagedB. Classes in the unmanaged layer have query methods, suppose UnmanagedA::B() returns an instance of

Memory usage of DotNET app

强颜欢笑 提交于 2020-01-15 09:39:10
问题 My application (DotNET) runs as a plug-in inside a C++ standalone app that exposes a C++/CLI SDK. It is very easy for my users to generate large amounts of data and I'd like to offer an abort option if the memory consumption of my plug-in + the base application reaches -say- 90% of the legal maximum. How can I measure the total memory consumption (ideally for both the managed and unmanaged code) and how do I know how much memory windows allows for the current application? 回答1: The Process