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

For structures: VB.Len or Marshal.SizeOf

I have some code converted from VB6 that contains VB.Len for structures.

VB.Len(lDevMode)

Seems to me that I can always change that to Marshal.SizeOf

Since sometimes Marshal.SizeOf works better

and VB.Len is never better.

Is that correct or are there cases when VB.Len is the correct one to use?

Thanks
Nov 21 '05 #1
2 3829
" Just Me" <gr****@a-znet.com> schrieb:
Since sometimes Marshal.SizeOf works better

and VB.Len is never better.

Is that correct or are there cases when VB.Len is the correct one to use?


In interop scenarios I would use 'Marshal.SizeOf' instead of 'Len'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #2
Thanks again

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:e7**************@TK2MSFTNGP10.phx.gbl...
" Just Me" <gr****@a-znet.com> schrieb:
Since sometimes Marshal.SizeOf works better

and VB.Len is never better.

Is that correct or are there cases when VB.Len is the correct one to use?


In interop scenarios I would use 'Marshal.SizeOf' instead of 'Len'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3

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

Similar topics

33
by: Peter Seaman | last post by:
I understand that structures are value types and arrays and classes are reference types. But what about arrays as members of structures i.e. as in C struct x { int n; int a; }
2
by: phyzics | last post by:
I am porting an application from C++ to C#, and am having trouble finding a way to quickly and efficiently write structures to a binary file. In C++ this is trivial because all that is necessary is...
26
by: Olaf Baeyens | last post by:
I am trying to port some C++ structures to C# but I have troubles with this one. Note: this is a file record, so I must keep this format. #pragma pack( push, 1 ) typedef struct { char title; ...
7
by: Rich Claxton | last post by:
Hi we have a 3rd party in process com dll, which was written In C++ and our client is in c#. All is working fine apart from we get a callback from the DLL which contains an array of structures....
8
by: Brian Corbett | last post by:
I'm am trying to write a RAS Component that lists the Available RAS Connections on the current machine, I have got as far as getting the Connections using the RasEnumEntry API Getting the Entry...
1
by: Dennis Woos | last post by:
I am trying to get two structures to map the same data, like a union. Having failed to get the FieldOffset attribute to work at runtime, I tried: ...
4
by: cleanrabbit | last post by:
Hello! I hate having to do this, because im almost certain there is someone in the world that has come across this problem and i just havent found their solution yet, so i do appologise if this...
3
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, I'm trying to write an array of structures named myStructArray to a binary file and later on read it back. Although I could complete the entire project in C in about 2 minutes, I...
5
by: craig1231 | last post by:
I have a problem trying to pass a structure to an unmanaged c++ DLL from C#. When I call PCSBSpecifyPilotLogon from C#, it throws an AccessViolationException This is what I have... The...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.