473,471 Members | 1,912 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Should I be using int or Int16 for the paramaters for my assemblymethods?

I have a public method in a managed class similar to void foo(int i);

I noticed something a bit curious when I complied the help file with
Sandcastle. Sandcastle is seeing the int parameters as Int32.

Should I not be using int but use Int16 so that the parameter is
compatible across all of the languages?

Bruce

--
Bruce E. Stemplewski
GarXface OCX and C++ Class Library for the Garmin GPS
www.stempsoft.com
Dec 27 '06 #1
3 1570

"Bruce" <Br***@nospam.comwrote in message
news:et**************@TK2MSFTNGP04.phx.gbl...
>I have a public method in a managed class similar to void foo(int i);

I noticed something a bit curious when I complied the help file with
Sandcastle. Sandcastle is seeing the int parameters as Int32.

Should I not be using int but use Int16 so that the parameter is
compatible across all of the languages?
int is Int32 in .NET, and long is Int64. short is Int16.

You may be confusing int with VB6's Integer, which was 16 bits.
>
Bruce

--
Bruce E. Stemplewski
GarXface OCX and C++ Class Library for the Garmin GPS
www.stempsoft.com

Dec 27 '06 #2

"Ben Voigt" <rb*@nospam.nospamwrote in message
news:uT**************@TK2MSFTNGP06.phx.gbl...
>
"Bruce" <Br***@nospam.comwrote in message
news:et**************@TK2MSFTNGP04.phx.gbl...
>>I have a public method in a managed class similar to void foo(int i);

I noticed something a bit curious when I complied the help file with
Sandcastle. Sandcastle is seeing the int parameters as Int32.

Should I not be using int but use Int16 so that the parameter is
compatible across all of the languages?

int is Int32 in .NET, and long is Int64. short is Int16.
Arggh! That's for C# and VB.NET. In C++/CLI, long is still a synonym for
int, and __int64 is the keyword corresponding to System::Int64 (and there is
also __int128).
>
You may be confusing int with VB6's Integer, which was 16 bits.
>>
Bruce

--
Bruce E. Stemplewski
GarXface OCX and C++ Class Library for the Garmin GPS
www.stempsoft.com


Dec 27 '06 #3
Ben Voigt wrote:
Arggh! That's for C# and VB.NET. In C++/CLI, long is still a synonym for
int, and __int64 is the keyword corresponding to System::Int64 (and there is
also __int128).
I would like to add that there's a new 64-bit integer type called long
long, which was introduced to replace the non-standard and awkward
__int64 type. I personally prefer long long or System::Int64 to __int64.
long long is part of C99 and will be part of ISO C++0x.

Tom
Dec 29 '06 #4

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

Similar topics

1
by: Job Lot | last post by:
I have written couple of queries in Access 2002 which accept parameters. How can I execute these queries in vb.net application to fill dataset object. Thanks
2
by: Fred Loud | last post by:
I'm having a problem calling waveInOpen from a VB.NET application, every time I call it I get a return value of 11 which is MMSYSERR_INVALPARAM. I can call waveInGetNumDevs and waveInGetDevCaps...
1
by: Darryn Ross | last post by:
Hi, How do you populate a Datagrid with information from a query setup in an access database? Regards Darryn
4
by: Stuart Ferguson | last post by:
I am currently writing code to execute SQL Server 2000 Stored procedured using the ODBC.NET SQL Server Driver. The particular stored procedure I am using has multiple paramaters which I have...
5
by: David Conorozzo | last post by:
I am able to create new sources using CreateEventSource. I can call GetEventLogs, I can delete sources, I can see if sources exist BUT, as soon as I try a "WriteEntry", I get an exception: ...
3
by: QuocSi | last post by:
Hi all, I have a bitsfield Structure MyBits a as boolean b as boolean c as boolean d as boolean end structure
1
by: Starbuck | last post by:
Hi I want to broadcast a message to all pc's on a lan via port 1002. Can anyone tell me the best way of doing a general broadcast. Thanks in advance
2
by: adypoly | last post by:
Hi guys... I am having a typical problem in using one of the native dll in C# I'll explain what am trying to do, I've a dll written in C language which i am trying to include in my C# project,...
2
by: jobs | last post by:
What's messed up here is that i have close to identical code that is working perfectly, only difference is that code uses sqldatasource control instead objectdatasource used here. Getting this...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
1
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
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,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.