CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 1999
    Posts
    1

    Passing a picture object between processes

    I have a ActiveX EXE which has the following code


    public Function GetPic(sPicPath as string) as Picture
    Dim pic as Picture
    set pic = LoadPicture(sPicPath)
    set GetPic = pic
    End Function




    But this just gives me an 'Automation Error' or 'Method Failed' error, can i achieve this through any other means as i want to pass the picture object from the server to the client.





  2. #2
    Join Date
    Oct 1999
    Location
    INDIA
    Posts
    2

    Re: Passing a picture object between processes

    USE THE CLIPBOARD FOR THE PURPOSE.
    THE ALGO GOES AS FOLLOWS

    FROM THE SENDING PROCESS SET THE PICTURE PROPERTY OF THE PICTURE CONTROL TO THE IMAGE TO BE TRANSFERRED.

    THEN OPEN THE CLIPBOARD USING API CALLS

    SET THE CLIPBOARD DATA TO CF_BITMAP

    TRANSFER THE IMAGE TO THE CLIPBOARD

    AT THE RECIEVING END GET THE CLIPBOARD DATA AGAIN TO A PICTURE CONTROL


  3. #3
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: Passing a picture object between processes

    Try defining it as an Object

    public Function GetPic(sPicPath as string) as Object
    Dim pic as Picture
    set pic = LoadPicture(sPicPath)
    set GetPic = pic
    End Function




    While using, make sure you "cast" it back into approp type, as : (Client code)
    dim IPic as Picture
    set IPic = GetPic(somepath)
    ... use it
    set IPic = Nothing

    Also make sure you set it to Nothing after done with it!

    RK

  4. #4
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: Passing a picture object between processes

    Hi,

    sorry, that piece of code i wrote before doesn't work. I checked it!. I will let you know more, if i happend to find out. Sorry again, for the wrong answer


    RK

  5. #5
    Guest

    Re: Passing a picture object between processes

    But what happens if the Activex server is running on the Remote machine how can you get the access to the server clipboard

    Nilesh


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured