mixed-mode

Can Windows find unmanaged DLLs not in the path, GAC or Registry?

Can Windows find the unmanaged (non-COM) DLLs of a mixed-mode application if these DLLs are not in the application directory or Windows path? I noticed VS 2008 does not appear on the path, and I was wondering how this is done. ...

C++ COM C# Mixed Mode Interoperation

I'm trying to understand my options for calling a C# library implementation from unmanaged C++. My top level module is an unmanaged C++ COM/ATL dll. I would like to integrate functionality of an existing managed C# dll. I have, and can recompile the source for both libraries. I understand from reading articles like this overview on MSD...

My application is unmanaged. Where do I start introducing managed code?

My whole application (which is rather big, with a 20MB executable) is written in unmanaged C++. Because I can clearly see the advantages in using managed code, I want to start introducing managed code in my application, but where do I start? Can I easily start to use C++/CLI and link it with the rest of my application? (although the C++...

Getting a "ComponentActivatorException" using Castle Windsor from a .net 4.0 application using a .net 2.0 component.

I have an application which is being developed in VS2010, and makes use of the Castle-Windsor IoC, through a configuration file. One of the components I am registering, also developed in VS2010, references a .net 2.0 component (LeadTools), so recompiling the 2.0 project isn't an option. When the wrapping component's registration is done...

Memory debugger for mixed-mode C++ applications

I have to maintain a large C++ mixed-mode application (VC++ 2005, CLR-support: /clr:oldsyntax). I suspect the program has a number of memory leaks but it's hard to find them manually. For native C++ applications we use Purify (and Valgrind on Linux). Unfortunately Purify does not support mixed mode assemblies. Anybody here knows a dece...

ASP.NET MVC and mixed mode authentication

Hi All I have a scenario whereby I require users to be able to authenticate against an ASP.NET MVC web application using either Windows authentication or Forms authentication. If the user is on the internal network they will use Windows authentication and if they are connecting externally they will use Forms authentication. I’ve seen qu...

Access violation when running native C++ application that uses a /clr built DLL

I'm reorganzing a legacy mixed (managed and unmanaged DLLs) application so that the main application segment is unmanaged MFC and that will call a C++ DLL compiled with /clr flag that will bridge the communication between the managed (C# DLLs) and unmanaged code. Unfortuantely, my changed have resulted in an Access violation that occurs...

C++/CLI Mixed Mode DLL Creation

I've got a native C++ DLL that I would like to have a C++/CLI wrapper layer for. From what I understood, if you simple added a C++/CLI class to the project, VS would compile as mixed mode, but I was apparently wrong as VS doesn't seem to be even touching the managed code. So, given a pre-existing native code-base what exactly, step-by-...

How can I compile some parts of C++/CLI code as Native and some part as Managed?

Hello, I am calling LoadTypeLib for loading unmanaged type libraries in C++/CLI. I need to compile some code(some code areas) as managed and some code areas as unmanaged(native) code and form a mixed mode class library as executable. What i need to mention between the lines of code so that whatever the part i need to be compiled as man...

Can managed and unmanaged C++/MFC be mixed in one dll?

Previously we had software in MFC (VC6), VB6 and C# applications that needed to call the same engine written in C++ (and MFC). The engine required C++ for speed. At the time we decided to use COM as the interface because all three could use it with the least issues in marshalling, etc. Our MFC application is now deprecated and we have...

Exception occured While loading dynamically EXE assembly in C++/CLI (Could not load file or assembly ', Version=1.0.3836.39802 ...)

Hello, I am facing an exception in C++/CLI while dynamically loading assembly which itself an EXE created in C++/CLI managed mode using Assembly.Load. It successfully loads a dll assembly, but fails to load EXE assembly and generates following exception: An unhandled exception of type 'System.IO.FileLoadException' occurred in TestManag...

Mixed mode assembly in .NET 4

I wrote a class library in .NET 2.0 for database access some 2 years ago and have been using it all along on .NET 2.0, 3.0 and 3.5. In the current project I'm working on (which is a .NET 4.0 application), tried using the old faithful class library and I got the following exception: System.InvalidOperationException was unhandled Me...

How can i enable the intellisense on my c++/cli project?

I am using visual studio 2008 and i have a native c++ project that loads a managed c++ dll, but on the last one, the intellisense doenst work anymore only por the managed code. this project (dll) has a mixed code (native and managed) and if i write only "::" on a clean line, the intellisense gives me the methods inherits from the base c...

mixed mode authentication against AD and fallback to the database if it fail with Membership providers

Hi! my user will use form authentication against Active Directory or database. Theres no Windows Integrated Authentication there!! What i want is when the user submit the authentication form, it will try to validate the user against Active Directory and if it fail, try with the database. How can i do that? What i had in mind was to bu...

Targeting .net framework 3.5 and 4.0 with mixed mode assembly

hi, i have a mixed mode assembly that targets .net 3.5 using the vc 9.0 runtime. i do wan't to support .net 4.0 yet still remain compatible to the old framework as well (the library should work for 4.0 and for 3.5 processes). if i update to .net 4.0 i have to use the vc 10.0 runtime. however from this runtime i can't target an old .ne...

Mixed mode assembly not loading symbol for native C++ pdbs

Hello, I am working with mixed mode assemblies in C++/CLI. All managed mode assemblies pdb's get loaded when successfully in mixed mode assembly. But native dll's pdb's not getting loaded even no information shown of native pdb in Modules pane (i.e in VS Debug->Windows->Modules). Note: I am using native dll and calling its exported fu...

Global variables not destructed in main thread?

I have a mixed-mode executable and I noticed that the constructor of my native global variables is called in the main thread, but the destructor is called in some other thread. The name of thread is 'Thread::intermediateThreadProc'. The global variables are What is the reason for this? And what is this 'Thread::intermediateThreadProc'...

How to identify which framework an assembly is loaded in?

A user reported to us that some strange behaviour in our application can be resolved after installing .NET 4: <?xml version="1.0" encoding="utf-8" ?> <configuration> <startup> <supportedRuntime version="v2.0.50727" /> </startup> </configuration> I wasn't aware that if you didn't specify an assembly it might be loaded in a high...

Why Inline asm in C++/CLI creates horrible problem?

Hello, I am using Inline asm in C++/CLI. Horrible problem infact could be a bug I obsereved. I passed vector from one function call to another. If I comment the whole code snippet of _asm{....some assembly code here} inside the called function where vector used which are provided to it from other function, then no problem whole vector...

Mixing WebForms and MVC: What should I do with the MasterPage?

I want to start migrating a WebForms App to MVC. The process will be gradual, so both systems must co-exist. The question is: Should I have two MasterPages, one for the WebForms pages and other for the MVC views? Is there a way to have only one? ...