Skip to main content

[Migrated content. Thread originally posted on 11 February 2005]

I am trying to load an image list for an active-x grid from Developer Express.

I used the axdeftool (which is excellent) and looked at the code generated, but I'm getting an error "parameter is incorrect" when I try to access this method.

* AddBitmap
* method AddBitmap
METHOD, 17, @AddBitmap,
"long" @hBitmap, TYPE 3,
"OLE_COLOR" @mask, TYPE 19
RETURNING "short", TYPE 2


COBOL CODE

77 olImageLists handle of IdxImageLists.
77 olImageList handle of IdxImageList.
77 ole-color pic 9(9) comp-5.
77 olhbitmap pic s9(9) comp-5.
77 olImageidx pic s9(4) comp-5.

.....

INQUIRE SS-dxDBGrid @Imagelists() IN olImageLists.

MODIFY olImageLists, @Add() GIVING olImageList.

COMPUTE OLE-COLOR = 192 256 * (192 256 * 192).

Accept IMAGE-PATH from ENVIRONMENT "IMAGE-PATH".
MOVE SPACES TO SCR-S.
STRING IMAGE-PATH, "\\ACTION.BMP" DELIMITED BY " "
INTO SCR-S.
CALL "W$BITMAP" USING WBITMAP-LOAD, SCR-S
GIVING olhBITMAP.

MODIFY olImageList, @Name = "dxImageList1".

INQUIRE olImageLists @Count() IN image-ct.

MODIFY olImageList, @AddBitmap(
by name hBitmap olhBitmap
by name mask ole-color)
Returning olimageidx.

Developer Express Link

[Migrated content. Thread originally posted on 11 February 2005]

I am trying to load an image list for an active-x grid from Developer Express.

I used the axdeftool (which is excellent) and looked at the code generated, but I'm getting an error "parameter is incorrect" when I try to access this method.

* AddBitmap
* method AddBitmap
METHOD, 17, @AddBitmap,
"long" @hBitmap, TYPE 3,
"OLE_COLOR" @mask, TYPE 19
RETURNING "short", TYPE 2


COBOL CODE

77 olImageLists handle of IdxImageLists.
77 olImageList handle of IdxImageList.
77 ole-color pic 9(9) comp-5.
77 olhbitmap pic s9(9) comp-5.
77 olImageidx pic s9(4) comp-5.

.....

INQUIRE SS-dxDBGrid @Imagelists() IN olImageLists.

MODIFY olImageLists, @Add() GIVING olImageList.

COMPUTE OLE-COLOR = 192 256 * (192 256 * 192).

Accept IMAGE-PATH from ENVIRONMENT "IMAGE-PATH".
MOVE SPACES TO SCR-S.
STRING IMAGE-PATH, "\\ACTION.BMP" DELIMITED BY " "
INTO SCR-S.
CALL "W$BITMAP" USING WBITMAP-LOAD, SCR-S
GIVING olhBITMAP.

MODIFY olImageList, @Name = "dxImageList1".

INQUIRE olImageLists @Count() IN image-ct.

MODIFY olImageList, @AddBitmap(
by name hBitmap olhBitmap
by name mask ole-color)
Returning olimageidx.

Developer Express Link
You are using the ACUCOBOL-GT internal bitmap handle. This handle is not compatible with the Windows OS handle which is being referred to in this case, for the method that is.

You may be able to:

INQUIRE acubitmaphandle SYSTEM HANDLE IN apicx4comp-nhandle.

But I am not 100% if this will be accepted on a bitmap.

[Migrated content. Thread originally posted on 11 February 2005]

I am trying to load an image list for an active-x grid from Developer Express.

I used the axdeftool (which is excellent) and looked at the code generated, but I'm getting an error "parameter is incorrect" when I try to access this method.

* AddBitmap
* method AddBitmap
METHOD, 17, @AddBitmap,
"long" @hBitmap, TYPE 3,
"OLE_COLOR" @mask, TYPE 19
RETURNING "short", TYPE 2


COBOL CODE

77 olImageLists handle of IdxImageLists.
77 olImageList handle of IdxImageList.
77 ole-color pic 9(9) comp-5.
77 olhbitmap pic s9(9) comp-5.
77 olImageidx pic s9(4) comp-5.

.....

INQUIRE SS-dxDBGrid @Imagelists() IN olImageLists.

MODIFY olImageLists, @Add() GIVING olImageList.

COMPUTE OLE-COLOR = 192 256 * (192 256 * 192).

Accept IMAGE-PATH from ENVIRONMENT "IMAGE-PATH".
MOVE SPACES TO SCR-S.
STRING IMAGE-PATH, "\\ACTION.BMP" DELIMITED BY " "
INTO SCR-S.
CALL "W$BITMAP" USING WBITMAP-LOAD, SCR-S
GIVING olhBITMAP.

MODIFY olImageList, @Name = "dxImageList1".

INQUIRE olImageLists @Count() IN image-ct.

MODIFY olImageList, @AddBitmap(
by name hBitmap olhBitmap
by name mask ole-color)
Returning olimageidx.

Developer Express Link
I was able to use ImageLists in Active-X controls by using the OpCode 5 in W$BITMAP. Here is an example:

01 BITMAP-HANDLE PIC S9(9) COMP-5 VALUE ZERO.
. . .
CALL "W$BITMAP" USING 5, FILE-NAME, 16, x#C0C0C0 GIVING BITMAP-HANDLE.
MODIFY ACTIVE-X-CONTROL @IMAGES = BITMAP-HANDLE.

Rob

[Migrated content. Thread originally posted on 11 February 2005]

I am trying to load an image list for an active-x grid from Developer Express.

I used the axdeftool (which is excellent) and looked at the code generated, but I'm getting an error "parameter is incorrect" when I try to access this method.

* AddBitmap
* method AddBitmap
METHOD, 17, @AddBitmap,
"long" @hBitmap, TYPE 3,
"OLE_COLOR" @mask, TYPE 19
RETURNING "short", TYPE 2


COBOL CODE

77 olImageLists handle of IdxImageLists.
77 olImageList handle of IdxImageList.
77 ole-color pic 9(9) comp-5.
77 olhbitmap pic s9(9) comp-5.
77 olImageidx pic s9(4) comp-5.

.....

INQUIRE SS-dxDBGrid @Imagelists() IN olImageLists.

MODIFY olImageLists, @Add() GIVING olImageList.

COMPUTE OLE-COLOR = 192 256 * (192 256 * 192).

Accept IMAGE-PATH from ENVIRONMENT "IMAGE-PATH".
MOVE SPACES TO SCR-S.
STRING IMAGE-PATH, "\\ACTION.BMP" DELIMITED BY " "
INTO SCR-S.
CALL "W$BITMAP" USING WBITMAP-LOAD, SCR-S
GIVING olhBITMAP.

MODIFY olImageList, @Name = "dxImageList1".

INQUIRE olImageLists @Count() IN image-ct.

MODIFY olImageList, @AddBitmap(
by name hBitmap olhBitmap
by name mask ole-color)
Returning olimageidx.

Developer Express Link
Thanks for the reply rob... I actually got this to work with another active-x control, but I'm still having problems with this one..

Has anyone ever used a type IPictureDisp*?

If so can you tell me how to access this?


Thanks for the help....


Jason

[Migrated content. Thread originally posted on 11 February 2005]

I am trying to load an image list for an active-x grid from Developer Express.

I used the axdeftool (which is excellent) and looked at the code generated, but I'm getting an error "parameter is incorrect" when I try to access this method.

* AddBitmap
* method AddBitmap
METHOD, 17, @AddBitmap,
"long" @hBitmap, TYPE 3,
"OLE_COLOR" @mask, TYPE 19
RETURNING "short", TYPE 2


COBOL CODE

77 olImageLists handle of IdxImageLists.
77 olImageList handle of IdxImageList.
77 ole-color pic 9(9) comp-5.
77 olhbitmap pic s9(9) comp-5.
77 olImageidx pic s9(4) comp-5.

.....

INQUIRE SS-dxDBGrid @Imagelists() IN olImageLists.

MODIFY olImageLists, @Add() GIVING olImageList.

COMPUTE OLE-COLOR = 192 256 * (192 256 * 192).

Accept IMAGE-PATH from ENVIRONMENT "IMAGE-PATH".
MOVE SPACES TO SCR-S.
STRING IMAGE-PATH, "\\ACTION.BMP" DELIMITED BY " "
INTO SCR-S.
CALL "W$BITMAP" USING WBITMAP-LOAD, SCR-S
GIVING olhBITMAP.

MODIFY olImageList, @Name = "dxImageList1".

INQUIRE olImageLists @Count() IN image-ct.

MODIFY olImageList, @AddBitmap(
by name hBitmap olhBitmap
by name mask ole-color)
Returning olimageidx.

Developer Express Link
Originally posted by Robstan
I was able to use ImageLists in Active-X controls by using the OpCode 5 in W$BITMAP. Here is an example:

01 BITMAP-HANDLE PIC S9(9) COMP-5 VALUE ZERO.
. . .
CALL "W$BITMAP" USING 5, FILE-NAME, 16, x#C0C0C0 GIVING BITMAP-HANDLE.
MODIFY ACTIVE-X-CONTROL @IMAGES = BITMAP-HANDLE.

Rob


This is different, what is returned in this case is a handle to an imagelist. This is different from a bitmap-handle which is what he is getting in his case.

[Migrated content. Thread originally posted on 11 February 2005]

I am trying to load an image list for an active-x grid from Developer Express.

I used the axdeftool (which is excellent) and looked at the code generated, but I'm getting an error "parameter is incorrect" when I try to access this method.

* AddBitmap
* method AddBitmap
METHOD, 17, @AddBitmap,
"long" @hBitmap, TYPE 3,
"OLE_COLOR" @mask, TYPE 19
RETURNING "short", TYPE 2


COBOL CODE

77 olImageLists handle of IdxImageLists.
77 olImageList handle of IdxImageList.
77 ole-color pic 9(9) comp-5.
77 olhbitmap pic s9(9) comp-5.
77 olImageidx pic s9(4) comp-5.

.....

INQUIRE SS-dxDBGrid @Imagelists() IN olImageLists.

MODIFY olImageLists, @Add() GIVING olImageList.

COMPUTE OLE-COLOR = 192 256 * (192 256 * 192).

Accept IMAGE-PATH from ENVIRONMENT "IMAGE-PATH".
MOVE SPACES TO SCR-S.
STRING IMAGE-PATH, "\\ACTION.BMP" DELIMITED BY " "
INTO SCR-S.
CALL "W$BITMAP" USING WBITMAP-LOAD, SCR-S
GIVING olhBITMAP.

MODIFY olImageList, @Name = "dxImageList1".

INQUIRE olImageLists @Count() IN image-ct.

MODIFY olImageList, @AddBitmap(
by name hBitmap olhBitmap
by name mask ole-color)
Returning olimageidx.

Developer Express Link
Originally posted by Jhoward
Has anyone ever used a type IPictureDisp*?
Jason


ACUCOBOL-GT version 7.0 has a new feature WBITMAP-LOADPICTURE that gives you the IPictureDisp object.

It works the same way as the vb LoadPicture function.

[Migrated content. Thread originally posted on 11 February 2005]

I am trying to load an image list for an active-x grid from Developer Express.

I used the axdeftool (which is excellent) and looked at the code generated, but I'm getting an error "parameter is incorrect" when I try to access this method.

* AddBitmap
* method AddBitmap
METHOD, 17, @AddBitmap,
"long" @hBitmap, TYPE 3,
"OLE_COLOR" @mask, TYPE 19
RETURNING "short", TYPE 2


COBOL CODE

77 olImageLists handle of IdxImageLists.
77 olImageList handle of IdxImageList.
77 ole-color pic 9(9) comp-5.
77 olhbitmap pic s9(9) comp-5.
77 olImageidx pic s9(4) comp-5.

.....

INQUIRE SS-dxDBGrid @Imagelists() IN olImageLists.

MODIFY olImageLists, @Add() GIVING olImageList.

COMPUTE OLE-COLOR = 192 256 * (192 256 * 192).

Accept IMAGE-PATH from ENVIRONMENT "IMAGE-PATH".
MOVE SPACES TO SCR-S.
STRING IMAGE-PATH, "\\ACTION.BMP" DELIMITED BY " "
INTO SCR-S.
CALL "W$BITMAP" USING WBITMAP-LOAD, SCR-S
GIVING olhBITMAP.

MODIFY olImageList, @Name = "dxImageList1".

INQUIRE olImageLists @Count() IN image-ct.

MODIFY olImageList, @AddBitmap(
by name hBitmap olhBitmap
by name mask ole-color)
Returning olimageidx.

Developer Express Link
Gisle,

That WBITMAP-LOADPICTURE option in version 7 will be a huge help! Thanks!

Rob

[Migrated content. Thread originally posted on 11 February 2005]

I am trying to load an image list for an active-x grid from Developer Express.

I used the axdeftool (which is excellent) and looked at the code generated, but I'm getting an error "parameter is incorrect" when I try to access this method.

* AddBitmap
* method AddBitmap
METHOD, 17, @AddBitmap,
"long" @hBitmap, TYPE 3,
"OLE_COLOR" @mask, TYPE 19
RETURNING "short", TYPE 2


COBOL CODE

77 olImageLists handle of IdxImageLists.
77 olImageList handle of IdxImageList.
77 ole-color pic 9(9) comp-5.
77 olhbitmap pic s9(9) comp-5.
77 olImageidx pic s9(4) comp-5.

.....

INQUIRE SS-dxDBGrid @Imagelists() IN olImageLists.

MODIFY olImageLists, @Add() GIVING olImageList.

COMPUTE OLE-COLOR = 192 256 * (192 256 * 192).

Accept IMAGE-PATH from ENVIRONMENT "IMAGE-PATH".
MOVE SPACES TO SCR-S.
STRING IMAGE-PATH, "\\ACTION.BMP" DELIMITED BY " "
INTO SCR-S.
CALL "W$BITMAP" USING WBITMAP-LOAD, SCR-S
GIVING olhBITMAP.

MODIFY olImageList, @Name = "dxImageList1".

INQUIRE olImageLists @Count() IN image-ct.

MODIFY olImageList, @AddBitmap(
by name hBitmap olhBitmap
by name mask ole-color)
Returning olimageidx.

Developer Express Link
Gisle,
When 7.0 is released, will the parameters for w$bitmap with op-code WBITMAP-LOADPICTURE be the same as WBITMAP-LOAD-IMAGELIST. For instance:

call "w$bitmap" using WBITMAP-LOADPICTURE , file-name, 16, #C0C0C0 giving h-img.


Or will parameters be different?

[Migrated content. Thread originally posted on 11 February 2005]

I am trying to load an image list for an active-x grid from Developer Express.

I used the axdeftool (which is excellent) and looked at the code generated, but I'm getting an error "parameter is incorrect" when I try to access this method.

* AddBitmap
* method AddBitmap
METHOD, 17, @AddBitmap,
"long" @hBitmap, TYPE 3,
"OLE_COLOR" @mask, TYPE 19
RETURNING "short", TYPE 2


COBOL CODE

77 olImageLists handle of IdxImageLists.
77 olImageList handle of IdxImageList.
77 ole-color pic 9(9) comp-5.
77 olhbitmap pic s9(9) comp-5.
77 olImageidx pic s9(4) comp-5.

.....

INQUIRE SS-dxDBGrid @Imagelists() IN olImageLists.

MODIFY olImageLists, @Add() GIVING olImageList.

COMPUTE OLE-COLOR = 192 256 * (192 256 * 192).

Accept IMAGE-PATH from ENVIRONMENT "IMAGE-PATH".
MOVE SPACES TO SCR-S.
STRING IMAGE-PATH, "\\ACTION.BMP" DELIMITED BY " "
INTO SCR-S.
CALL "W$BITMAP" USING WBITMAP-LOAD, SCR-S
GIVING olhBITMAP.

MODIFY olImageList, @Name = "dxImageList1".

INQUIRE olImageLists @Count() IN image-ct.

MODIFY olImageList, @AddBitmap(
by name hBitmap olhBitmap
by name mask ole-color)
Returning olimageidx.

Developer Express Link
Originally posted by DanM
When 7.0 is released, will the parameters for w$bitmap with op-code WBITMAP-LOADPICTURE be the same as WBITMAP-LOAD-IMAGELIST.


As I said, it is introduced to provide for COBOL programmers what vb programmers achieve with LoadPicture.

With other words, it accepts a full path name to an image file and it returns an IPicture object.

Hence syntax goes like:


CALL "W$BITMAP" USING WBITMAP-LOADPICTURE file-name
GIVING ipicturevar.


It supports all the same image formats as does LoadPicture. Yes it works with Thin Client.
That's it, now you ought to wait for the 7.0 release or apply to volunteer as a beta site.