|
by: William Stacey |
last post by:
Using the following struct def, how can I tell (using reflection) if "ba"
has the marshal attribute and get the "ByValArray" and maybe even the size?
In the bigger picture, given a struct (or a class), how to decide if
"sizeof(MyStruct)" would fail before calling sizeof and having to use
Marshal.sizeof? TIA
public struct MyStruct
{
|
by: Beringer |
last post by:
Why do I get the following run time error:
Additional information: Type System.Object can not be marshaled as an
unmanaged structure; no meaningful size or offset can be computed.
When the following code is executed?
object test = new object();
int temp = Marshal.SizeOf(test);
|
by: SB |
last post by:
I feel dumb to ask because I bet this is a simple question...
Looking at the code below, can someone please explain why I get two
different values in my Marshal.SizeOf calls (see the commented lines)?
TIA!
sb
|
by: Claire |
last post by:
char a = 'p';
if (System.Runtime.InteropServices.Marshal.SizeOf(a) == 1)
dothis();
else
dothat();
SizeOf(a) is returned as 1. I thought chars were 16 bits in size. Why is it
returning 1 to me?
thanks
Claire
|
by: Howard Kaikow |
last post by:
Given:
private struct PROCESSENTRY32
{
public int dwSize;
public int cntUsage;
public int th32ProcessID;
public int th32DefaultHeapID;
public int th32ModuleID;
|
|
by: marcosegurini |
last post by:
Hi.
Is is possible to mark a class-member-variable to avoid its marshaling?
class MyClass
{
int i_;
IntPtr point_;
|
by: scottt |
last post by:
I need to call into a C++ DLL from my C# code.
The function is expecting a void pointer to an unsigned short.
Which would be more correct?
UInt16 wRegData;
IntPtr p = Marshal.AllocHGlobal(Marshal.SizeOf(wRegData));
Marshal.StructureToPtr(wRegData, p, false);
|
by: RYoung |
last post by:
Given this native struct:
typedef struct vendor
{
char name;
} VENDOR
I want to make managed equivalent, so I did this:
public value struct Vendor
|
by: Charming12 |
last post by:
Hi All,
I have a strange problem and due to my inefficiency with IntPtr i am unable to figure it out.
I have an structure something like:
public struct Detail
{
public int age;
public Detail(int _age)
|
by: Charming12 |
last post by:
Hi All,
I am using System.Runtime.InteropServices; to marshal a structure using Marshal.structureToPtr().
But to get the size of structure when i get Marshal.sizeOf(), it gives me improper sizes.
Code:
public struct IDName
{
public ushort Id;
|
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 usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
|
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 most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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 into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...
|