Sending a blob as parameter to an ocx

Hi I want to create an OCX which converts an blob containing an bmp picture to a picture i jpeg format. When I try to send the blob as an parameter to my ocx, Attain raises an error telling me that the datatype isnt supported. My Ocx is written in VB6 and the sub I’m trying to call looks like this: Public Sub Convert(Blob As Variant) From Attain I call the Ocx like this: PictureExport.Convert(Item.picture); where PictureExport is declared as my Ocx Can anybody tell me what I’m doing wrong? Thanks in advance

Even though a variable of type Variant may hold almost anything in VB, it gets a bit more complicated as soon as COM/ActiveX/OCX/etc. get involved. COM supports a couple of well-defined data types, which are independent of those defined in any specific programming language. My knowledge on these details is somewhat limited, but I’m pretty sure that a BLOB is not a supported COM data type and therefore cannot be passed over a COM interface. You should rather export the BLOB to a file from inside Navision and pass only the path name (which is a simple, well-supported string :wink: to your OCX. – Heinz Herbeck Waagner-Biro AG, Vienna, Austria

Thanks Heinz for your reply. In my first version I did only pass the path name, but I thought that solution was a bit poor. But maybe thats the only way.


Originally posted by bjornhart: …but I thought that solution was a bit poor.

Being an old UNIX hacker, I think it’s really great that even in these days of fancy high-tech distributed object-oriented Web-programming, now and then we have to resort to the good old ways of passing files - or even: column-formatted ASCII-files - around to achieve our goals. Sometimes the old ways are still the best (and only!) ways… Best regards, – Heinz Herbeck Waagner-Biro AG, Vienna, Austria