473,804 Members | 3,228 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

integer ->System.Unit3 2

Dear all,
how do I convert a .NET integer into System.Uint32 (needed to call external
function)
Thanks,
Boni
Nov 21 '05 #1
5 4184
Convert.ToUint3 2

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Boni" <oilia@nospam > wrote in message
news:ua******** ******@TK2MSFTN GP12.phx.gbl...
Dear all,
how do I convert a .NET integer into System.Uint32 (needed to call
external function)
Thanks,
Boni

Nov 21 '05 #2


"Boni" <oilia@nospam > wrote in message
news:ua******** ******@TK2MSFTN GP12.phx.gbl...
:
: Dear all,
: how do I convert a .NET integer into System.Uint32 (needed to call
: external function)
: Thanks,
: Boni
I assume by 'external function' you mean a function in a .DLL that isn't
part of dot net (e.g.: a windows API call or similar) in which case, the
function is expecting an unsigned 32 bit integer as a parameter and / or
returns the same. Correct?
This isn't my strong suit but I believe you can simply specify an
integer (System.Int32) and use it whereever the funtion specifies. The
external function shouldn't care if vb considers the value signed or
not- only that it has the correct number of bits. The problem in vb is
it doesn't support using unsigned integer values. It only supports
signed integers (System.Int32).
If you need to assign the value of the integer to some value greater
than 2147483647 (the positive upper limit of an Int32 value) before
passing to the function, you can use hex notation. For example, if you
need to supply the value 3000000000, you could use the notation
&HB2D05E00. Beyond that however, you are limited to treating the value
as signed.
I guess what I'm saying is, I believe you can pass Int32 values in and
out of external functions that expect unsigned 32 bit integers without
issue, but you cannot manipulate them in your code as such - your system
will always see them as being signed. (Note, C# does support unsigned
integers and may be more suited for your purposes in this instance).
Ralf
Nov 21 '05 #3
Hi Boni,

Use Convert.ToUInt3 2().

Roman
"Boni" <oilia@nospam > ñîîáùèë/ñîîáùèëà â íîâîñòÿõ ñëåäóþùåå:
news:ua******** ******@TK2MSFTN GP12.phx.gbl...
Dear all,
how do I convert a .NET integer into System.Uint32 (needed to call external function)
Thanks,
Boni

Nov 21 '05 #4
"Boni" <oilia@nospam > schrieb:
how do I convert a .NET integer into System.Uint32 (needed to call
external function)


In VB.NET 2002/2003 you can use 'Convert.UInt32 '. VB 2005 natively supports
unsigned numeric types.

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

Nov 21 '05 #5
VB.NET 2005 fully supports unsigned integer types. If you need it in
production before 2005 is released then use _AnonCoward's suggestion.
--
David Anton
www.tangiblesoftwaresolutions.com
Home of:
Clear VB: Cleans up outdated VB.NET code
Instant C#: Converts from VB.NET to C#
Instant VB: Converts from C# to VB.NET
Instant J#: Converts from VB.NET to J#

"Boni" wrote:
Dear all,
how do I convert a .NET integer into System.Uint32 (needed to call external
function)
Thanks,
Boni

Nov 21 '05 #6

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

Similar topics

1
2171
by: Ted | last post by:
I have some code which processes an xsd. For elements of type xs:integer the XmlSchemaDatatype object gotten from the schema elements ElementType member contains a ValueType of System.Decimal. I don't get it it should be System.Int32 or some other integer type but not a decimal. Any ideas why this is happening? btw: I'm using msxml 4.0. Ted
36
2488
by: AussieRules | last post by:
Hi, I want to use the user color scheme to set the color of my forms. I now I have to use the. System.Drawing.SystemColors, but which color is the color of a form background as used in other applications. In the end all I want to do is form1.backcolor = system.whatever.color
8
3044
by: Sueffel | last post by:
Okay, I can certinatly use a For..Next loop to find the specified info I need, but I'm thinking the BinarySearch will be faster, if I can get it working LOL Anyhew, got an array, may have 5 or 5,000 elements, and I need to find the string, say it's "Start here". I've tried this: Dim MyObj as Object = "Start Here" Dim I as Integer = System.Array.BinarySearch(MyArr,MyObj)
5
2876
by: Barry | last post by:
Hello, In VS2003, I tried using an enum and setting it into a field in a datarow. It seems as if the datatype of the field in the row determined what went into the field. If the datatype was string, then the name of the enum item went into the field, but if the datatype was integer, then the integer value of the enum was stored. Is this expected behaviour? I couldn't find anything while searching for answers.
6
7226
by: Arthur Dent | last post by:
How do you sort a generic collection derived from System.Collections.ObjectModel.Collection? Thanks in advance, - Arthur Dent
0
1673
by: Nickneem | last post by:
I' m trying to disable all right mouse clicks by using the vbAccelerator Windows Hooks Library The small (systray / console) app. must catch all (right) mouseclicks before they are received by the users application (for instance IE). I' m not getting passed the stage where I write to the console catching clicks on my applications form.. I really doubt if this one's possible at all (especially for an API noob like me)..
2
3273
by: fniles | last post by:
In VB6, we use Integer and Long. In VB.NET does Integer becomes Int32 and Long becomes Integer ? Thanks.
22
6441
by: schneider | last post by:
I need to hook the system mouse down event. I'm trying to replicate how a context menu hides when the mouse clicks outside of the control. Thanks, Schneider
6
3406
by: joegao1 | last post by:
can anyone help here? I am working on an embedded system with a C-like programming language, therefore floating point operation is not allowed (because it is time consuming), and floating point variable has to be represented by integer variable, with F stands for the length of bits representing the fractional part. e.g. value 4.5 with F=5 is represent by 10010000 (where the higher 3 bits representing integer value, and the lower 5...
2
4737
by: lily86 | last post by:
i'm very new so i hope all of u can help me. when i debug my webforms this error occur "An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll Additional information: System error." pls help me solve the problem...thanks.. my code: Imports System.Data.SqlClient Imports System.Data.OleDb Imports System.Globalization Imports System.Threading Public Class PhoneBook
0
10589
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...
1
10327
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10085
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
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
7625
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
6857
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
5527
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
5663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3828
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.