473,545 Members | 2,092 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

can unmanaged code be verifiable?

I have got some C++ code that uses STL containers.
I need to use that code from a C# application, so compiled it as a .NET
assembly.
As I wish to run the project on a web environment, the DLL must be
verifiable.
As far as I understand, unless it's managed, it cant be verifiable.
One idea I had was to use System.Collecti ons containers instead of the STL
containers. As I dont want to make changes to the original code, I thought I
could just create wrappers for the STL containers.
That approach didnt quite work, as I cannot provide the STL interface for my
new containers, for reasons such as being unable to override the * and ->
operators. (It's not allowed in managed code.)
Has anyone got a better (working) idea, or knows of an already existing
solution to this problem?

Cheers,
g.

p.s.
Alternatively, is there a way of making unmanaged code verifiable?
Nov 16 '05 #1
1 1255
Hi Gideon,

Unmanaged code cannot be verifiable using the CAS mechanism since it
requires provable type safety.

And you definitely won't be able to create a verifiable replacement for STL
that can keep the client side code intact since the STL interface by itself
clearly isn't type safe in the CLR sense.

Of course nothing prevents you from using unverifiable code in an ASP.Net
application. The only reason that I could see is when using a low end
hosting plan that doesn't allow you to use non verifiable code.

Ronald Laeremans
Visual C++ team

"Gideon" <gi************ @dwl.co.uk.inva lid> wrote in message
news:%2******** **********@TK2M SFTNGP09.phx.gb l...
I have got some C++ code that uses STL containers.
I need to use that code from a C# application, so compiled it as a .NET
assembly.
As I wish to run the project on a web environment, the DLL must be
verifiable.
As far as I understand, unless it's managed, it cant be verifiable.
One idea I had was to use System.Collecti ons containers instead of the STL
containers. As I dont want to make changes to the original code, I thought I could just create wrappers for the STL containers.
That approach didnt quite work, as I cannot provide the STL interface for my new containers, for reasons such as being unable to override the * and ->
operators. (It's not allowed in managed code.)
Has anyone got a better (working) idea, or knows of an already existing
solution to this problem?

Cheers,
g.

p.s.
Alternatively, is there a way of making unmanaged code verifiable?

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
3290
by: Timothy Shih | last post by:
Hi, I am trying to figure out how to use unmanaged code using P/Invoke. I wrote a simple function which takes in 2 buffers (one a byte buffer, one a char buffer) and copies the contents of the byte buffer into the character pointer. The code looks like the following: #include <stdio.h> #include <stdlib.h> #include "stdafx.h" BOOL APIENTRY...
40
3013
by: Neo The One | last post by:
I think C# is forcing us to write more code by enforcing a rule that can be summarized as 'A local variable must be assgined *explicitly* before reading its value.' If you are interested in what I mean, please look at this feedback my me: ...
4
39953
by: Rachel Suddeth | last post by:
What is the difference between a managed/unmanaged resource, and how do you tell which is which? I'm trying to understand how to write some Dispose() methods, and we are supposed to put code that deals with managed in one place, and code that deals with unmanaged in another place, but I can't seem to find anything that clearly explains what...
1
1622
by: Sparhawk | last post by:
Hi, my company is going to migrate a large VC++ application to .NET to make use of Windows Forms (the old class library is not updated any more). We are not planning to migrate the rest of the code which works well. I understand the basic concept: our code is unmanaged, Windows Forms is Managed and Unmanaged may not call Managed code. I...
1
1529
by: Ioannis Vranos | last post by:
This compiles: value class SomeClass {}; int main() {
88
7981
by: Peter Olcott | last post by:
Cab you write code directly in the Common Intermediate language? I need to optimize a critical real-time function.
5
4767
by: R. MacDonald | last post by:
Hello, all, I am currently working on a .Net (VB) application that invokes routines in unmanaged (Fortran) DLLs. The unmanaged routines then communicate with the .Net application by means of a call-back mechanism. These calls pass a string that contains a "command" and a pointer to a SafeArray that (depending on the command) either...
13
3633
by: =?Utf-8?B?d3BjbWFtZQ==?= | last post by:
I have a small C++/CLI application which calls an unmanaged lib. It seems like I can't use /clr:pure and link with the unmanaged lib (LNK1313 error). The problem I have is that compiling with /clr adds a dependency on several msvc*.dll:s which adds some unwanted complexity to the installation. Is it possible to avoid the msvc*.dll...
6
8954
by: =?Utf-8?B?QWxleGFuZGVyZmU=?= | last post by:
Hi, I have a C# program that uses an unmanaged dll that has a function similar to the signature below : void f(out MyStruct arr, out int num); // num = actual array length returned The array must be allocated (with known max length = 10) before the call to the dll function (the dll just fills it ,with no allocations). The definitions of...
0
7473
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7408
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7815
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7433
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7763
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5976
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5340
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4949
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
712
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.