473,379 Members | 1,423 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,379 software developers and data experts.

Help with marshalling

Hi Everyone -

I have two questions about MarshalAs

1) I need to setup the correct MarshalAs for this setup...

[StructLayout(LayoutKind.Sequential)]
public struct DateTimeStruct
{
public int year;
public int month;
public int day;
public int hour;
public int minute;
public int second;
}

What would the correct MarshalAs statement be?

This is what i'm trying...

[MarshalAs( UnmanagedType.Struct)]
DateTimeStruct startTime;
2) Given this struct element -

int samplingInterval[5]

What would the correct MarshalAs statement be?
This is what i'm thinking...
[MarshalAs( UnmanagedType.ByValArray, SizeConst=5)]
int samplingInterval;
Would someone please correct my direction on these two questions??

thanks
tony
Nov 15 '05 #1
0 888

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

Similar topics

2
by: Terence | last post by:
Help Need!!! I am writing a program for a distributed system course. I need to marshall all the messages in order to send them thru a socket. The first 8 bytes of the message are used to store the...
4
by: Animesh | last post by:
Hi All, I don't know whethher this is possible or not. This is the result of a bad design problem. Here I go; I have a structure like this: typedef struct _s_index_entry { char *doc_id;...
17
by: VM | last post by:
In my Windows app, I'm running a batch process that's composed of a FOR loop that'll run 15,000 times (datatable row count), copy cthe data of each row -3 fields- to a struct, and send the strct to...
0
by: swartzbill2000 | last post by:
I am familiar with the VB6/VC6/ATL way of marshalling an incoming interface via New (VB), and then marshalling an outgoing interface with some form of Advise. To me it looks like .Net has...
2
by: bonk | last post by:
I am currently trying to write a longer article about Marshalling when using . Does anyone know books, articles, or websites that cover Marshalling in Platform Invocation Services ()?
2
by: RJ Lohan | last post by:
Howdy, I have a legacy DLL for which I have a problem marshalling a parameter type of char**. The function header (C++) is as so; extern "C" __declspec(dllexport) int __stdcall...
4
by: | last post by:
In C++ I use the memcpy function to copy a struct to a buffer, I have not been able to find a method to do this in C#. I will need to be able to do this for a struct with mixed types. Example...
2
by: d-42 | last post by:
Hi, I'm pretty sure I've just got a Marshalling problem, but I'm completely stumped. If there is a better newsgroup to post this in, please point me towards it. First I'm trying to use...
1
by: d-42 | last post by:
Hi, I'm pretty sure I've just got a Marshalling problem, but I'm completely stumped. If there is a better newsgroup to post this in, please point me towards it. First I'm trying to use...
0
by: santoshdarekar | last post by:
HI, I have some code which I am reverse engineering. Here is one module which is used as calculation madule and marshalling is used in it. But, still there is performance issue as the CPU time the...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.