Andrew,

I tried it with normal ,Net imagelist, and that failed. I tried the
IPictureDisp trick, because that is what we have to do (via AxHost) to
put bitmap images on Outlook buttons so wondered if it was the same COM
issue.

Also, I'm creating the imagelist on the fly in the constructor of the
control that is displaying in the COM control - so I figured it wouldn't
be marshalled or anything, but still didn't work.

Well outside my depth here though - it's the first time I have ever
tried the Theme APIs etc and visual stuff is not my forte.

Dino

-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Eames, Andrew
Sent: Thursday, 10 August 2006 01:24
To: [email protected]
Subject: [ADVANCED-DOTNET] ImageList problems with COM

IPictureDisp cannot be marshaled between COM apartments - I'll bet it
has something to do with that
  Andrew

-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Dean Cleaver
Sent: Tuesday, August 08, 2006 9:16 PM
To: [email protected]
Subject: [Spam:***** SpamScore] [ADVANCED-DOTNET] ImageList problems
with COM

Hi,

Just wondered if anyone can point me in the right direction here.

I've create a control that draws a variable number of buttons onto a
Picturebox, which allows me to have vastly more controls on the screen
that window handles would safely allow (have tested it with 500
buttons).

I'm using DrawThemeBackground etc to do it and it works well.

DrawThemeIcon however is striking problems - works perfectly when the
control is running within a .Net environment, but I also use the same
control in a COM environment - specifically a COM visible control in the
project is created from an HTML page, and that control dynamically adds
this control onto itself, however the images will not display - the
buttons all drawn, but DrawThemeIcon returns 80004005.

I've tried using ImageList_Create to create my own image list, and
populated it with IPictureDisp handles, but it still only works well on
.Net and displays no images in COM. Error once again is 80004005 which
seems like a generic COM error message.

Is there anything obvious I have missed?

Dino

===================================
This list is hosted by DevelopMentor(r)  http://www.develop.com

View archives and manage your subscription(s) at
http://discuss.develop.com

===================================
This list is hosted by DevelopMentor(r)  http://www.develop.com

View archives and manage your subscription(s) at
http://discuss.develop.com

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to