Thanks again for your input. I don't think (unless I'm really missing
something) that I'll have a problem with the floating point being
converted to integers. I will do all the math to convert to pixels in
my script code. The primary reason for this is that each set of
coordinates may have their own "scale" (ie 1"=100'). If I understand
what you're saying, the worst is that a coordinate will be rounded to
the nearest "pixel" not "inch". Quite frankly, I don't think I could
discern the difference on a printout of a half pixel.
I seem to be having a bit of a problem with sending data from my
scripting language (Object Rexx) to a "parameter array" as Larry
If I send the data like Larry suggested -
MyDll.Shade X1,Y1, X2,Y2, X3, Y3
or in Object Rexx
all is well and everything works fine.
However if I attempt to make the list of parameters a variable as in..
params = "x1,y1,x2,y2,x3,y3"
the dll does appear to recognize the data. This method of passing
parameters from Object Rexx to other VB ActiveX dll's works OK when I
know exactly how many parameters there should be and account for them
in the DLL.
xyarray = .array~new
xyarray = x1
xyarray = y1
I get a type mis-match. There are several other types of Object Rexx
"collections" that I haven't had an opportunity to test yet. I know I
can pass a VB array from an ActiveX dll back to a calling Object Rexx
script and Obj Rexx will recognize it as an array.
I guess there's just something "special" about a "parameter array"
I may have to set this "learning project" aside for a short while -
got a big "paying" job coming up; however, I will continue to work
with it as time progresses.
I'll probably send what I have so far directly to the IBM Object Rexx
project team. I just happen to be on a "first name" basis with them
and in the past they have readily "enchanced" Object Rexx to work with
other languages in regards to ActiveX/OLE. Maybe they'll add a new
collection type called "A_Lee_Collection" :-).
Thanks again for all your help.
On Wed, 9 Jul 2003 13:23:52 +0100, "Mike D Sutton"
> Apologies for the late reply, I was working on-site yesterday and had no
>> Thanks to the great help here I've got my ActiveX DLL printing
>> Mike suggested a method to convert my coordinates (which are in
>> inches) to pixels and I'm sure it was a valid solution - I'm just not
>> up enough on VB to follow all of it :-).
>> After a bit of stumbling around I think I may have a solution - please
>> Using the GetDeviceCaps API I can easily determine the "Twips Per
>> Pixel" for both the X & Y axis.
>> Since there are 1440 twips per inch (I believe that to be a constant),
>> I can then easily convert my inches to pixels.
>My previous post on mapping modes was really just to show you haw you go
>about calling the API calls rather than an exact solution (That part's your
>Since you're working with floating point values then you're going to have to
>do some of the re-mapping yourself since these would be rounded by the API
>(All integer based) and everything would be aligned to the nearest inch!
>The API has two mapping modes defined which take pixel (device) coordinates
>and map them to inch-based mapping modes, the first is MM_LOENGLISH which
>would require you to multiply each coordinate by 100 (To maintain some of he
>data from the floating point value.) If you need more precision then
>MM_HIENGLISH gives you 10* the resolution and would require you to multiple
>each coordinate by 1000 thus taking into account more of the original value.
>For more precision still then you can always create your own isometric
>mapping mode (As described in the previous post) and set that onto the
>printer's DC before drawing.
>If you have control over the original point data then IMO this would be the
>preferred solution since you need never worry about accidentally forgetting
>to re-map something and it will reduce the clutter in your own code.
>If you're receiving these values from an external source though or for some
>other reason can't/don't want to change the coordinates then you'll need to
>go on the way you've got currently with manual mapping.
>Of course, if you're using VB's drawing methods rather than GDI drawing
>methods then you can just set the ScaleMode of the printer object and your
>floating point coordinates will work as-is.
>Hope this helps,
> - Microsoft Visual Basic MVP -