473,398 Members | 2,188 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,398 software developers and data experts.

Error: it contains an object field at offset 75 that is incorrectly aligned

4
Error as like this-->object field at offset 75 that is incorrectly aligned or overlapped by a non-object field. But here size constant is 3 so I think after 72 offset will be 75..If I change the offset to 76 it will works fine. I think reason is that size of int is 4. After changing that code will be like this.
Expand|Select|Wrap|Line Numbers
  1. [FieldOffset(72)]
  2.             [MarshalAs(UnmanagedType.ByValArray,SizeConst= 3)]
  3.             public int[] DC;
  4.  
  5.             [FieldOffset(76)]
  6.             [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
  7.             public float[] WIN;
  8.  
  9.  
  10.             [FieldOffset(84)]
  11.             [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
  12.             public byte[] name;
  13.  
  14.             [FieldOffset(104)]
  15.             [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
  16.             public byte[] SET;
  17.  
  18.             [FieldOffset(107)]
  19.             [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50)]
  20.             public byte[] ID;
But at that time I got the error as object field at offset 107 that is incorrectly aligned or overlapped by a non-object field..Can anyone tell me what is the main reason behind this..

Thanks..
Apr 22 '15 #1
0 1666

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: KathyB | last post by:
I have the following script in an html page: function goToPosition() { varGoTo = document.write(document.cookie("Position")); document.scrollTo(0, varGoTo); } </head> <body...
0
by: Sandi | last post by:
I have a simple problem: I have an Access database (images.mdb) that has 2 columns: one is the id of the picture (an integer) and one (column named picture) is a field of type OLE Object which...
11
by: Bradford Chamberlain | last post by:
I work a lot with multidimensional arrays of dynamic size in C, implementing them using a single-dimensional C array and the appropriate multipliers and offsets to index into it appropriately. I...
3
by: Sandi | last post by:
I have a simple problem: I have an Access database (images.mdb) that has 2 columns: one is the id if the picture (an integer) and one (column named picture) is a field of type OLE Object which...
3
by: Sandi | last post by:
I have a simple problem: I have an Access database (images.mdb) that has 2 columns: one is the id if the picture (an integer) and one (column named picture) is a field of type OLE Object which...
1
by: Rico | last post by:
Hello, I have an ole object field (Access XP/2002) which I store images in. I have a couple of questions regarding this; is it possible to determine the image dimensions? Secondly, is there...
3
by: Richard Hollenbeck | last post by:
I've marked the line in this subroutine where I've been getting this error. It may be something stupid but I've been staring at this error trying to fix it for over an hour. I'm pretty sure the...
11
by: dougmeece | last post by:
Good Morning Experts, I spent all weekend working on this and got absolutely no where. I have a database with an input form that runs an append query to append to a table. Form Name: ...
0
by: DivaLakshmanan502 | last post by:
I have an Access database which one of it's tables contains an OLE object field that holds pictures. I'm trying to load these pictures (one at a time) to a PictureBox control. I've tried to do it...
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?
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...
0
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...
0
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...
0
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...
0
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...
0
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,...

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.