Problem adding method to GDILibrary

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem adding method to GDILibrary

GF Berry
I added the following method to the GDILibrary class:

transparentBlt: hdc nXDest: x nYDest: y nWidth: w nHeight: h hdcSrc: hdcSrc
nXSrc: sx nYSrc: sy nWidthSrc: sw nHeightSrc: sh crTransparent: transColor

 "The TransparentBlt function performs a bit-block transfer of the color
data corresponding to a rectangle of pixels from the specified source device
context into a destination device context.
  BOOL BitBlt(
     HDC hdcDest, // handle to destination device context
   int nXDest, // x-coordinate of destination rectangle's upper-left corner
   int nYDest, // x-coordinate of destination rectangle's upper-left corner
   int nWidth, // width of destination rectangle
   int nHeight, // height of destination rectangle
   HDC hdcSrc, // handle to source device context
   int nXSrc, // x-coordinate of source rectangle's upper-left corner
   int nYSrc, // y-coordinate of source rectangle's upper-left corner
    int nWidthSrc, // width of source rectangle
    int nHeightSrc, // height of source rectangle
    UINT crTransparent // color to make transparent
  );"

 <stdcall: bool TransparentBlt handle sdword sdword sdword sdword handle
sdword sdword sdword sdword dword>
 ^self invalidCall

But when I attempt to call it while running Dolphin Smalltalk 4.0 PRO under
Windows NT or Windows 98 I get a dialogbox with the message "The specified
procedure could not be found. (16r7F:  The specified procedure could not be
found.).

Can anyone tell me what I might have done wrong or is this a limitation of
Dolphin Smalltalk and the GDI libraries?


Reply | Threaded
Open this post in threaded view
|

Re: Problem adding method to GDILibrary

Bill Schwab
>  <stdcall: bool TransparentBlt handle sdword sdword sdword sdword handle
> sdword sdword sdword sdword dword>
>  ^self invalidCall
>
> But when I attempt to call it while running Dolphin Smalltalk 4.0 PRO
under
> Windows NT or Windows 98 I get a dialogbox with the message "The specified
> procedure could not be found. (16r7F:  The specified procedure could not
be
> found.).
>
> Can anyone tell me what I might have done wrong or is this a limitation of
> Dolphin Smalltalk and the GDI libraries?

Some functions come in ASCII and Unicode form, and have an A or U appended
to the name; others are merely preprocessing tricks that call more
complicated functions (IIRC, CreateWindow is a "fake" function) which you
would have to identify and call directly.  Dumpbin.exe can show you the
exports from a DLL, and any U/A/etc naming will be obvious.

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Problem adding method to GDILibrary

Ian Bartholomew-4
In reply to this post by GF Berry
> I added the following method to the GDILibrary class:

That might be the problem. According to MSDN [1] TransparentBlt is not in
gdi32.dll but is in msimg32.dll. A quick look at this file shows this as
"GDIEXT Client DLL" so I guess it is an extension to the GDI library.

MSDN Also says that TransparentBlt requires Win 98 or later and Win 2000 or
later - implying that Win NT doesn't provide the function (or DLL?)

Dolphin doesn't appear to support this DLL out of the box so I guess that
you will have to add an ExternalLibrary subclass yourself - not too
difficult.

Ian

[1] I haven't checked this anywhere else so MSDN might be wrong (as well as
very, very slow today)


Reply | Threaded
Open this post in threaded view
|

Re: Problem adding method to GDILibrary

Ian Bartholomew-4
In reply to this post by GF Berry
> I added the following method to the GDILibrary class:

That might be the problem. According to MSDN [1] TransparentBlt is not in
gdi32.dll but is in msimg32.dll. A quick look at this file shows this as
"GDIEXT Client DLL" so I guess it is an extension to the GDI library.

MSDN Also says that TransparentBlt requires Win 98 or later and Win 2000 or
later - implying that Win NT doesn't provide the function (or DLL?)

Dolphin doesn't appear to support this DLL out of the box so I guess that
you will have to add an ExternalLibrary subclass yourself - not too
difficult.

Ian

[1] I haven't checked this anywhere else so MSDN might be wrong (as well as
very, very slow today)


Reply | Threaded
Open this post in threaded view
|

Re: Problem adding method to GDILibrary

Andy Bower
In reply to this post by GF Berry
Hi,

> I added the following method to the GDILibrary class:
>
> transparentBlt: hdc nXDest: x nYDest: y nWidth: w nHeight: h hdcSrc:
hdcSrc
> nXSrc: sx nYSrc: sy nWidthSrc: sw nHeightSrc: sh crTransparent: transColor
>
>  "The TransparentBlt function performs a bit-block transfer of the color
> data corresponding to a rectangle of pixels from the specified source
device
> context into a destination device context.
>   BOOL BitBlt(
>      HDC hdcDest, // handle to destination device context
>    int nXDest, // x-coordinate of destination rectangle's upper-left
corner
>    int nYDest, // x-coordinate of destination rectangle's upper-left
corner

>    int nWidth, // width of destination rectangle
>    int nHeight, // height of destination rectangle
>    HDC hdcSrc, // handle to source device context
>    int nXSrc, // x-coordinate of source rectangle's upper-left corner
>    int nYSrc, // y-coordinate of source rectangle's upper-left corner
>     int nWidthSrc, // width of source rectangle
>     int nHeightSrc, // height of source rectangle
>     UINT crTransparent // color to make transparent
>   );"
>
>  <stdcall: bool TransparentBlt handle sdword sdword sdword sdword handle
> sdword sdword sdword sdword dword>
>  ^self invalidCall
>
> But when I attempt to call it while running Dolphin Smalltalk 4.0 PRO
under
> Windows NT or Windows 98 I get a dialogbox with the message "The specified
> procedure could not be found. (16r7F:  The specified procedure could not
be
> found.).
>
> Can anyone tell me what I might have done wrong or is this a limitation of
> Dolphin Smalltalk and the GDI libraries?

According to the MSDN help for this function it is not available under
Windows NT or Win95. You need Win98/ME/2000. Are you sure you tried running
your code under Win98?

Best Regards,

Andy Bower
Dolphin Support
http://www.object-arts.com
---
Are you trying too hard?
http://www.object-arts.com/Relax.htm
---


Reply | Threaded
Open this post in threaded view
|

Re: Problem adding method to GDILibrary

Andy Bower
In reply to this post by Ian Bartholomew-4
Ian,

> That might be the problem. According to MSDN [1] TransparentBlt is not in
> gdi32.dll but is in msimg32.dll. A quick look at this file shows this as
> "GDIEXT Client DLL" so I guess it is an extension to the GDI library.
>
> MSDN Also says that TransparentBlt requires Win 98 or later and Win 2000
or
> later - implying that Win NT doesn't provide the function (or DLL?)
>
> Dolphin doesn't appear to support this DLL out of the box so I guess that
> you will have to add an ExternalLibrary subclass yourself - not too
> difficult.

Ah yes, I missed that.

Best Regards,

Andy Bower
Dolphin Support
http://www.object-arts.com
---
Are you trying too hard?
http://www.object-arts.com/Relax.htm
---


Reply | Threaded
Open this post in threaded view
|

Re: Problem adding method to GDILibrary

GF Berry
In reply to this post by Ian Bartholomew-4
Hi,

"Ian Bartholomew" <[hidden email]> wrote in message
news:nQqX6.175834$[hidden email]...

> That might be the problem. According to MSDN [1] TransparentBlt is not in
> gdi32.dll but is in msimg32.dll.

I did a dumpbin, and as you supposed, it is not in gdi132.dll.  I used  MSDN
Online Library
(http://msdn.microsoft.com/library/default.asp?URL=/library/psdk/gdi/bitmaps
_87eb.htm) for my information source on the function and it does not specify
the specific DLL, but all the Bitmap Functions are grouped under the
"Windows GDI" topic heading.  I assumed (with all that the word implies :) )
that the functions it described would all be in gdi32.dll. I have Win 98 at
home (not at work) so I will have to dumpbin msimg32.dll later to verify its
existence there.

> MSDN Also says that TransparentBlt requires Win 98 or later and Win 2000
or
> later - implying that Win NT doesn't provide the function (or DLL?)
>
Good point.  I will only work with this function on Win 98 as I don't have
Win 2000.

> Dolphin doesn't appear to support this DLL out of the box so I guess that
> you will have to add an ExternalLibrary subclass yourself - not too
> difficult.

Looks like I will do some prodding around to figure out how to do it.  I
believe you when you say it's not too difficult.  Dolphin Smalltalk seems
very well layed out.

>
> Ian
>

Thanks Ian, Bill, and Andy for your help.

-Greg

PS I am beginning to think that Direct X might be the only way to go to do
any interesting graphic work.  I had hoped when I bought 4.0 that it would
come with a Direct X toolkit upgraded for it.  I just started with Dolphin
4.0 Pro (after using the 2.0 free version where I saw various references to
Direct X and well ... I assumed again ;)


Reply | Threaded
Open this post in threaded view
|

Re: Problem adding method to GDILibrary

Ian Bartholomew-4
Greg,

> I did a dumpbin, and as you supposed, it is not in gdi132.dll.  I used
MSDN
> Online Library
>
(http://msdn.microsoft.com/library/default.asp?URL=/library/psdk/gdi/bitmaps
> _87eb.htm) for my information source on the function and it does not
specify
> the specific DLL, but all the Bitmap Functions are grouped under the
> "Windows GDI" topic heading.  I assumed (with all that the word implies
:) )
> that the functions it described would all be in gdi32.dll.

The help page for this function, and all the other functions on MSDN AFAIK,
does mention the dll used - it's about 10 lines up from the end. Through
bitter and time consuming experience I have learnt that it's one of the
first thing than needs checking, along with the A/U suffix that Bill
mentioned, when api interfaces fail to work.

> Looks like I will do some prodding around to figure out how to do it.  I
> believe you when you say it's not too difficult.  Dolphin Smalltalk seems
> very well layed out.

Should be just a matter of adding one class and a class method, #fileName.

> PS I am beginning to think that Direct X might be the only way to go to do
> any interesting graphic work.  I had hoped when I bought 4.0 that it would
> come with a Direct X toolkit upgraded for it.  I just started with Dolphin
> 4.0 Pro (after using the 2.0 free version where I saw various references
to
> Direct X and well ... I assumed again ;)

I've never got involved with DirectX myself but I know there are some people
posting here who use it and may be willing, in the spirit of this newsgroup,
to share.  Andy did explain why they had dropped the package - it was a
moving target that was just moving _too_ fast.

I assume you are aware the OA made the final version available as a free
download from their web site?

Regards
    Ian


Reply | Threaded
Open this post in threaded view
|

Re: Problem adding method to GDILibrary

GF Berry
"Ian Bartholomew" <[hidden email]> wrote in message news:IJtX6.176192
> The help page for this function, and all the other functions on MSDN
AFAIK,
> does mention the dll used - it's about 10 lines up from the end. Through
> bitter and time consuming experience I have learnt that it's one of the
> first thing than needs checking, along with the A/U suffix that Bill
> mentioned, when api interfaces fail to work.

I stand fully corrected.  I appreciate the help.

> Should be just a matter of adding one class and a class method, #fileName.

Great! I believe I am up to that task :)

>Andy did explain why they had dropped the package - it was a
> moving target that was just moving _too_ fast.

I don't doubt it was moving fast.  Seems like only yesterday Direct X 3.0
was the big thing.  I have previously downloaded the Direct Draw package and
played with it a little.  The first three IDirectDraw examples worked.  The
fourth locked my screen after displaying the bitmap.  I will work with what
is there more before making any uninformed comments on what Dolphin provides
with consideration to Direct X.

What a great newsgroup.

-Greg Berry