473,698 Members | 2,635 Online
Bytes | Software Development & Data Engineering Community
+ 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 1579

"Bruce" <Br***@nospam.c omwrote in message
news:et******** ******@TK2MSFTN GP04.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.nos pamwrote in message
news:uT******** ******@TK2MSFTN GP06.phx.gbl...
>
"Bruce" <Br***@nospam.c omwrote in message
news:et******** ******@TK2MSFTN GP04.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
1174
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
4524
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 just fine. Below is the format of the waveInOpen call and WaveFormatEx structure. <DllImport("winmm.dll", SetLastError:=False, ExactSpelling:=True)> _ Public Shared Function waveInOpen(ByVal lphWaveIn As Int32 _ , ByVal uDeviceID As Int32 _ ,...
1
970
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
5862
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 created in my code (OdbcParamater objects), these are then being added to the Command objects paramaters, however when it comes to running the SP the paramaters are not present and the following exception is thrown ...
5
4025
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: {System.InvalidOperationException} : {System.InvalidOperationException} HelpLink: Nothing InnerException: {System.ComponentModel.Win32Exception}
3
2306
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
993
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
20718
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, the solutions builds fine but once i try to run the program it gives an exception as "Attempted to read or write protected memory. This is often an indication that other memory is corrupt" I am passing two integer pointer variables as the...
2
6041
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 error during the update: Server Error. To return to your data and retry, use the BACK button System.ArgumentException: Object of type 'System.Int16' cannot be converted to type 'System.Boolean'. at System.RuntimeType.CheckValue(Object value,...
0
8610
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9031
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7740
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4372
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4623
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2339
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.