.net GdImaging to com GdViewer Image will not display.

Discussions about document viewing.
Post Reply
NicFarrell
Posts: 3
Joined: Fri Jun 28, 2013 1:09 am

.net GdImaging to com GdViewer Image will not display.

Post by NicFarrell » Sat Jul 20, 2013 12:45 am

I have series of object-oriented wrappers in .net code for image specific functionality in GdPicture. My image wrapper maintains the handle returned when a new image is opened by GdPicture and does all of its work on that handle. This is all contained in a .net dll that exposes itself to com.

In my vb6 app, I am using the aforementioned wrapper to open/manipulate an image, which then passes its handle to a GdViewer to display to the user. When I try to display the image I get a return value of Invalid Parameter.

Code: Select all

gdcPhoto.DisplayFromGdPictureImage(pclsCurrImage.handle)
As an alternative I tried getting a HBitmap for the image in question and displaying it using DisplayFromHBitmap, which generates "Class does not support Automation or does not support expected interface."

Code: Select all

Dim lngBitmapPtr As Long
lngBitmapPtr = pclsCurrImage.GetHBitmap
Dim enmStatus As GdPicture_NET_9Ctl.GdPictureStatus
enmStatus = gdcPhoto.DisplayFromHBitmap(lngBitmapPtr)
I suspect something is wrong with my project reference, but I'm not sure how to resolve it.

Note: the com and .net side are both using the interop version of GdPicture .NET 9

SamiKharma
Posts: 352
Joined: Tue Sep 27, 2011 11:47 am

Re: .net GdImaging to com GdViewer Image will not display.

Post by SamiKharma » Sat Jul 20, 2013 2:23 pm

Hi,

There is no way of telling what is wrong. Most definitely it is in the wrapping you are doing, but we cannot tell just like that. If you can create a very simple app that reproduces the problem and the problem only, I can have a look at it for you. Anything else would just be guess work.

Best,
Sami

NicFarrell
Posts: 3
Joined: Fri Jun 28, 2013 1:09 am

Re: .net GdImaging to com GdViewer Image will not display.

Post by NicFarrell » Mon Jul 22, 2013 5:23 pm

The relevant sections from the c# code are as follows:

Code: Select all

    public class Image : _Image
    {
        private int _imageHandle = 0;

        public int handle
        {
            get
            {
                return _imageHandle;
            }
        }

        public bool CreateImageFromFile(string file)
        {
            CloseNativeImage();

            _imageHandle = GDSingleton.Instance.gdPictureImaging.CreateGdPictureImageFromFile(file);
            return _imageHandle != 0;
        }
    }

    public class GDSingleton
    {
        #region Declarations
        private static GDSingleton _instance = null;
        private GdPictureImaging _imaging = null;
        #endregion

        #region Constructors
        private GDSingleton() { }
        #endregion

        #region Properties
        public static GDSingleton Instance
        {
            get
            {
                if (_instance == null)
                {
                    _instance = new GDSingleton();
                }
                return _instance;
            }
        }

        public GdPictureImaging gdPictureImaging
        {
            get
            {
                if (_imaging == null)
                {
                    _imaging = new GdPictureImaging();
                    _imaging.SetLicenseNumber("*********************************");
                }
                return _imaging;
            }
        }
        #endregion
    }
There is nothing complicated happening in the wrapper code. It just makes image operations object oriented by handling the image's handle returned by Gd picture.

SamiKharma
Posts: 352
Joined: Tue Sep 27, 2011 11:47 am

Re: .net GdImaging to com GdViewer Image will not display.

Post by SamiKharma » Tue Jul 23, 2013 11:27 am

Hi,

I looked at what you sent, unfortunately, again, I can do nothing with it.
I saw you said you use V9, lease do the following:
1. Create a simple app that reproduces the problem and the problem only
2. Send the app with a ticket explaining all the details you are encountering to: http://support.orpalis.com/

Best,
Sami

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests