473,385 Members | 1,309 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Why MarshalAs(UnmanagedType.U1) on bool/Boolean?

Hello,

I've noticed that MC++ compiler (VS.NET 2003) marks "bool" type with
MarshalAs(UnmanagedType.U1) attribute, even if System::Boolean is used. I
would understand, why this happens for C++ "bool" type (which is really
represented as byte), but I do not understand why this happens for
System::Boolean.

System::Boolean A(System::Boolean a);

produces

[return: MarshalAs(UnmanagedType.U1)]
public bool A([MarshalAs(UnmanagedType.U1) bool b)

Regards,
---
Stanislav Simicek
Nov 17 '05 #1
0 1745

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

Similar topics

0
by: Bob | last post by:
I have an old project written in VC++ that I want to convert to C#. In the old project I have a structure that has an array within it that is predefined to be 10 elements long. Anyway, I had issues...
2
by: Mo | last post by:
Hi, i am trying to call unmanaged C++ DLL in my C# application i converted all the structures to be .net compatible (e.g TCHAR to string (including Marshal As) one of the functions i try to...
4
by: maxixi | last post by:
Hi, It is my first time to use C#, and i struggle with my code with wininet api. Declare API: public abstract class WinInet { StructLayout(LayoutKind.Sequential)] public struct...
0
by: [Yosi] | last post by:
I have DLL (unmannaged code) , in this DLL I have some functions and structures. one of those functions is GetDataBaseStructure (GDS_Structure *str), the structure definition is as following : ...
2
by: Michael Moreno | last post by:
Hello, I have a .Net DLL that I use as a COM Server. I would like to return a SafeArray of double to a VB 6 client. I have declared this interface Public Interface ITest ...
8
by: **Developer** | last post by:
Been reading some of the Marshal doc and am a little confused. Anyway, I've been using the following and it works OK. Public Declare Auto Function SHGetFolderPath Lib "shell32.dll" (ByVal hWnd...
2
by: Paul Harvey | last post by:
Hi, I have some VB6 code that calls unmanaged DLLs, and I am converting it to C#. There's a couple of structs I need to define. I've had no problems with this one: Public Type A sz(128) As...
3
by: O.B. | last post by:
Below is a program that shows a test for marshaling data from a byte array to a class structure. Unfortunately, there are two annoying problems (bugs?) that I can't seem to get around. The...
0
by: Charming12 | last post by:
Hi , I need to pass Dynamic Size in the statement Is there anyway to pass a dynamic value in sizeconst or is there any other statement likethis which can take dynamic Size. Help will be...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.