Re: Structure in CSharp

Tech-Archive recommends: Fix windows errors by optimizing your registry



On Thu, 10 May 2007 05:35:01 -0700, Yatin Patel <YatinPatel@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

I tried using byte[] but it gives me the following error:

Could not load type '_msgType' from assembly 'HAICntrlApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' because
it contains an object field at offset 1 that is incorrectly
aligned or overlapped by a non-object field.

Well, you're making progress. :)

IMHO, the error messages you've posted so far have been pretty self-explanatory. I have little enough knowledge in this area as it is, so I won't bother trying to fix anything. But I will point out that if the compiler is complaining that you have a field that is incorrectly aligned or overlapped by a non-object field, you should look into whether the field is incorrectly aligned or may be illegally overlapping another field (note that clearly you should be allowed to overlap fields somehow, so the trick if there is an illegal overlap is to figure out how to turn it into a legal overlap).

I wish I had better knowledge about this and could help you directly, but hopefully you can take advantage of the error messages you're getting, which do seem to me to state pretty specifically what's wrong.

Pete
.