Article View: free.it.visual-basic
Article #66Re: System.Runtime.InteropServices.Marshal.SizeOf(MiaStruttura)
From: F.
Date: Tue, 16 Jan 2007 13:56
Date: Tue, 16 Jan 2007 13:56
58 lines
2721 bytes
2721 bytes
Ecco qua:
Private Structure Lettu
Public IntPiePri As Int32
Public IntGiaPri As Int32
Public IntFedPri As Int32
Public IntRenPri As Int32
Public IntLinPri As Int32
Public IntPieNow As Int32
Public IntGiaNow As Int32
Public IntFedNow As Int32
Public IntRenNow As Int32
Public IntLinNow As Int32
Public IntImpoPie As Double
Public IntImpoGia As Double
Public IntImpoFed As Double
Public IntImpoRen As Double
Public IntImpoLin As Double
Public IntTot As Int32
Public DatScad As Long
End Structure
Private MiaStruttura As New Lettu
' questa espressione mi ritorna 96 byte ->
System.Runtime.InteropServices.Marshal.SizeOf(MiaStruttura)
Grazie per l'eventuale risposta
"Rafunk" <zero@none0.it> ha scritto nel messaggio
news:45ac97fe$0$13253$4fafbaef@reader5.news.tin.it...
> F. wrote:
>> Usando la funzione riportata qui sotto ho notato che mi restituisce
>> 96 byte mentre Mia struttura ne ha 92 (ho verificato manualmente
>> contando i byte e anche attraverso registrazione del record su file..)
>>
>> Dove sbaglio?
>>
>> Questa funzione come funziona?
>>
>> Grazie della risposta.
>>
>> System.Runtime.InteropServices.Marshal.SizeOf(MiaStruttura)
>
> Potrebbe dipendere dal padding (allineamento in memoria) degli elementi
> della
> tua struttura.
> Posta il codice che la definisce.
>
> Bye
>
> Raf
>
> -----------------------------------------------------
> Funk: cooler than the other side of the pillow.
>
Technical Details
Message-ID:
<45acd996$0$4252$4fafbaef@reader1.news.tin.it>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.glorb.com!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!feeder.news.tin.it!spool.news.tin.it!not-for-mailReferences:
<45ac1594$0$8385$4fafbaef@reader5.news.tin.it> <45ac97fe$0$13253$4fafbaef@reader5.news.tin.it>Show Full Headers
Complete Article Headers
X-Google-Thread: f94ee,bc28f55628632a1f X-Google-Attributes: gidf94ee,public X-Google-Language: ITALIAN,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.glorb.com!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!feeder.news.tin.it!spool.news.tin.it!not-for-mail From: "F." <f@f.it> Newsgroups: free.it.visual-basic References: <45ac1594$0$8385$4fafbaef@reader5.news.tin.it> <45ac97fe$0$13253$4fafbaef@reader5.news.tin.it> Subject: Re: System.Runtime.InteropServices.Marshal.SizeOf(MiaStruttura) Date: Tue, 16 Jan 2007 14:56:32 +0100 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3028 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-RFC2646: Format=Flowed; Original Lines: 60 Message-ID: <45acd996$0$4252$4fafbaef@reader1.news.tin.it> Organization: TIN.IT (http://www.tin.it) X-Comments: Please send technical notifications to newsmaster@tin.it NNTP-Posting-Host: 82.61.59.16 X-Trace: 1168955798 reader1.news.tin.it 4252 82.61.59.16:22465 X-Complaints-To: Please send abuse reports to abuse@tin.it