Knight Chat X Posted April 1, 2004 Posted April 1, 2004 If I use APIViewer 2003 or the built-in VB6 to VB.Net convertor it produces the declare below. Declare Function GetDIBits Lib "gdi32.dll" ( _ ByVal aHDC As Int32, _ ByVal hBitmap As Int32, _ ByVal nStartScan As Int32, _ ByVal nNumScans As Int32, _ ByRef lpBits As Any, _ ByRef lpBI As BITMAPINFO, _ ByVal wUsage As Int32) As Int32 Giving an error: 'As Any' is not supported in 'Declare' statements What needs to be done to properly declare the function? Quote
TechnoTone Posted April 1, 2004 Posted April 1, 2004 "As Object" maybe? Quote TT (*_*) There are 10 types of people in this world; those that understand binary and those that don't.
*Gurus* divil Posted April 1, 2004 *Gurus* Posted April 1, 2004 VB.NET is a typesafe language. You cannot have "as any". Instead, replace that with the actual type of whatever you want to pass. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
ThePentiumGuy Posted April 22, 2004 Posted April 22, 2004 or if you dont have option strict on, delete "As Any" to make it ByRef lpBits or if you cant do that in a function;s argument just type in ByRef lpBits As Object as technotone said Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
Arch4ngel Posted April 22, 2004 Posted April 22, 2004 I recommand your second option ThePentiumGuy. Being sure of what you use is really important. The first thing to do when I create a VB Project is to turn on OPTION STRICT. This help thing a lot. so... Option #2 Quote "If someone say : "Die mortal !"... don't stay to see if he isn't." - Unknown "Learning to program is like going out with a new girl friend. There's always something that wasn't mentioned in the documentation..." - Me "A drunk girl is like an animal... it scream at everything like a cat and roll in the grass like a dog." - Me after seeing my girlfriend drunk and some of her drunk friend. C# TO VB TRANSLATOR
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.