Translate piece of eVC code to VB.NET CF

G

Guest

Hi, I'm using this eVC code in VB.NET CF, but seems last parameter is wrong
defined.

* eVC code:
BOOL WriteBitmapIntoJpegFile(const CString& strOutFileName, const int
nQuality, HBITMAP hBitmap)

* VB.NET CF code:
Public Shared Function WriteBitmapIntoJpegFile(ByVal strOutFileName As
String,
ByVal nQuality As Integer, ByVal hBitmap As System.Drawing.Bitmap) As
Boolean
End Function

How can i "translate" this to VB.NET CF?

Thanks in advance.
Ray
 
I

Ilya Tumanov [MS]

Actually, all parameters except for nQuality are defined incorrectly.

1. CString is a class and thus not supported. Change it to *wchar in native
code.
2. BOOL is not Boolean, but Int32. Change declaration in VB.
3. HBITMAP should be IntPtr. You have to obtain bitmap's handle and pass it
as IntPtr. Please see link below.

http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compac
tframework/browse_frm/thread/cd837fea7bf68e0c/8d7c75987a852ace#8d7c75987a852
ace

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 
C

Chris Tacke, eMVP

Well there is no equivalent object in managed code for an HBITMAP (though
there have been postings of code that will get it). Not sure if a string
maps to a CString directly either. So the short of it is there is no way to
directly translate it.

--
Chris Tacke
Co-founder
OpenNETCF.org
Has OpenNETCF helped you? Consider donating to support us!
http://www.opennetcf.org/donate
 
G

Guest

Thanks Ilya, made that changes and works pretty well.

Regards.
Ray

"Ilya Tumanov [MS]" said:
Actually, all parameters except for nQuality are defined incorrectly.

1. CString is a class and thus not supported. Change it to *wchar in native
code.
2. BOOL is not Boolean, but Int32. Change declaration in VB.
3. HBITMAP should be IntPtr. You have to obtain bitmap's handle and pass it
as IntPtr. Please see link below.

http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compac
tframework/browse_frm/thread/cd837fea7bf68e0c/8d7c75987a852ace#8d7c75987a852
ace

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
Thread-Topic: Translate piece of eVC code to VB.NET CF
thread-index: AcUFaO1LSivbhjZyQMifnuB1cFIMAA==
X-WBNR-Posting-Host: 200.94.128.250
From: =?Utf-8?B?UmF5?= <[email protected]>
Subject: Translate piece of eVC code to VB.NET CF
Date: Fri, 28 Jan 2005 10:41:06 -0800
Lines: 19
Message-ID: <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.framework.compactframework:70004
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Hi, I'm using this eVC code in VB.NET CF, but seems last parameter is wrong
defined.

* eVC code:
BOOL WriteBitmapIntoJpegFile(const CString& strOutFileName, const int
nQuality, HBITMAP hBitmap)

* VB.NET CF code:
Public Shared Function WriteBitmapIntoJpegFile(ByVal strOutFileName As
String,
ByVal nQuality As Integer, ByVal hBitmap As System.Drawing.Bitmap) As
Boolean
End Function

How can i "translate" this to VB.NET CF?

Thanks in advance.
Ray
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top