.NETGURU
Variable Types - mainly API declarations
Messages   Related Types
This message was discovered on microsoft.public.dotnet.languages.vb.upgrade.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

Andrew Dunn
Hi Group

I am currently fixing up my first converted project (VB6 to VB.NET)

I am still need to add the required DELEGATE stuff in order to use
enumwindows, however looking at a couple of examples (all different) I
notice that the variable types have changed. i.e. VB6 was using LONG, the
upgrade routine converts these to INTEGER and all the examples I've seen use
IntPtr.

As a comparision, below are (my)VB declaration for SendMessage and an VB.NET
example via Google

VB :

Public Declare Function SendMessage _
Lib "user32" _
Alias "SendMessageA" _
( _
ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any _
) As Long

..NET

Private Shared Function SendMessage( _
ByVal hWnd As IntPtr, _
ByVal wMsg As Int32, _
ByVal wParam As Int32, _
ByVal lParam As Int32) _
As Int32
End Function

I can't even see IntPtr in the list of available variable - Is there
anywhere in the various help files which will inform me that these changes
to types are neccessary and which might enable me to determine what the
correct type should be.

tia

Andrew

Reply to this message...
 
    
Herfried K. Wagner [MVP] (VIP)
* "Andrew Dunn" <Click here to reveal e-mail address> scripsit:
[Original message clipped]

Consuming Unmanaged DLL Functions (.NET Framework Developer's Guide)
<URL:http://msdn.microsoft.com/library/en-us/cpguide/html/cpconconsumingunmanageddllfunctions.asp>

VB.NET for VB Veterans
<URL:http://msdn.microsoft.com/library/en-us/vbcon/html/vboriintroductiontovisualbasic70forvisualbasicveterans.asp>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
<URL:http://dotnet.mvps.org/dotnet/faqs/>
Reply to this message...
 
    
Andrew Dunn
Thanks Herfried

I had already looked at a lot of documentation but nothing jumped out at me,
quite the opposite

i.e. From MSDN

Visual Basic Concepts

Upgrade Recommendation: Adjust Data Types for Win32 APIs
Many APIs can be used exactly as they were in Visual Basic 6.0, with the
caveat that you have to adjust your data types accordingly. The Visual Basic
6.0 Long data type is now the Visual Basic .NET Integer data type, and the
Visual Basic 6.0 Integer data type is now the Visual Basic .NET Short data
type. During the upgrade, these changes are made for you, and simple APIs
work exactly the same as they did in Visual Basic 6.0.

------------------------------------------------------------------------

Not sure what is classified as a simple API, however my VB code has all APIs
declared in a single module - Either I drop everything a re-write as
required or convert and fix everything during my first conversion, and find
it doesn't work at the end. :(

"Herfried K. Wagner [MVP]" <Click here to reveal e-mail address> wrote in message
news:#Click here to reveal e-mail address...

[Original message clipped]

nageddllfunctions.asp>
[Original message clipped]

isualbasic70forvisualbasicveterans.asp>
[Original message clipped]

Reply to this message...
 
 
System.IntPtr




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification