We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

problem to call a dll function in .NET

Thread ID:

Created:

Updated:

Platform:

Replies:

5705 Jul 14,2003 08:26 PM Sep 2,2003 04:07 AM Windows Forms 1
loading
Tags: FAQ
bears
Asked On July 14, 2003 08:26 PM

I have the following code in VB6 to create a picture object: Dim IPic As IPicture Private Declare Function OleCreatePictureIndirect _ Lib "olepro32.dll" ( PicDesc As PicBmp, RefIID As GUID, _ ByVal fPictureOwnsHandle As Long, IPic As Image) As Long The IPic is to store the picture object created. After I convert this code to VB.NET, it becomes Dim IPic As Image Private Declare Function OleCreatePictureIndirect _ Lib "olepro32.dll" ( PicDesc As PicBmp, RefIID As GUID, _ ByVal fPictureOwnsHandle As Integer, IPic As Image) As Integer r = OleCreatePictureIndirect(Pic, IID_IDispatch, 1, IPic) The problem is that IPic is now the data type of Image while the last parameter of the OleCreatePictureIndirect () function in olepro32.dll is still expecting a data type IPicture. So, when running the code, the program thows an execption that the data type is not matched. Can someone help: how to solve this problem. To see the all the code, please go to: http://support.microsoft.com/default.aspx?scid=kb;en-us;161299 (This is to capture and print a VB6 form. Now I hope I could upgrade it to VB.NET) Thanks,

Inquisitor Jax
Replied On September 2, 2003 04:07 AM

I have the same problem. Does anyone have an answer??

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;