1. cards32.ew by Brian Broker: how move cards?

Brian,

I'm trying to use your cards32.ew to make a solitaire game, (actually taking
your demo & altering it as needed), and I wonder if you continued with it
to include moving cards?  I thought it would be easy, until I realized that
it's doing a lot of "record keeping" of cards dealt onto a window, which then
have to be handled correctly when cards are moved, I guess? 

I also discovered it (my alteration of your demo) won't run on a Win98 system,
can't find cards.dll, even though it's present. 

Dan Moyer

new topic     » topic index » view message » categorize

2. Re: cards32.ew by Brian Broker: how move cards?

Dan Moyer wrote:
> 
> Brian,
> 
> I'm trying to use your cards32.ew to make a solitaire game, (actually taking
> your demo & altering it as needed), and I wonder if you continued with it
> to include moving cards?  I thought it would be easy, until I realized that
> it's doing a lot of "record keeping" of cards dealt onto a window, which then
> have to be handled correctly when cards are moved, I guess? 
> 
> I also discovered it (my alteration of your demo) won't run on a Win98 system,
> can't find cards.dll, even though it's present. 
> 
> Dan Moyer

I am not familiar with this program but I do know about cards.dll. There are 2
versions of this DLL, the version that comes with Win98, and the one that comes
with later OS's. They are not compatible. If you have a copy of the later DLL it
should work with the program. Do not replace the original cards.dll as Win98
ganes will not work with it.

Larry Miller

new topic     » goto parent     » topic index » view message » categorize

3. Re: cards32.ew by Brian Broker: how move cards?

Maybe it is also an option for you to use free SVG cards:
   http://david.bellot.free.fr/svg-cards/

Regards,
   Juergen

new topic     » goto parent     » topic index » view message » categorize

4. Re: cards32.ew by Brian Broker: how move cards?

Juergen Luethje wrote:
> 
> Maybe it is also an option for you to use free SVG cards:
>    <a
>    href="http://david.bellot.free.fr/svg-cards/">http://david.bellot.free.fr/svg-cards/</a>
> 
> Regards,
>    Juergen

Thanks Juergen, 
  Can these be used under WinXP?  They're .tar files, which makes me think]
they are only for Linux??

Dan

new topic     » goto parent     » topic index » view message » categorize

5. Re: cards32.ew by Brian Broker: how move cards?

Larry Miller wrote:
> 
> Dan Moyer wrote:
> > 
> > Brian,
> > 
> > I'm trying to use your cards32.ew to make a solitaire game, (actually taking
> > your demo & altering it as needed), and I wonder if you continued with it
> > to include moving cards?  I thought it would be easy, until I realized that
> > it's doing a lot of "record keeping" of cards dealt onto a window, which
> > then
> > have to be handled correctly when cards are moved, I guess? 
> > 
> > I also discovered it (my alteration of your demo) won't run on a Win98
> > system,
> > can't find cards.dll, even though it's present. 
> > 
> > Dan Moyer
> 
> I am not familiar with this program but I do know about cards.dll. There are
> 2 versions of this DLL, the version that comes with Win98, and the one that
> comes with later OS's. They are not compatible. If you have a copy of the
> later
> DLL it should work with the program. Do not replace the original cards.dll as
> Win98 ganes will not work with it.
> 
> Larry Miller


Larry,

Thanks for the info, sounds like I need two versions of the program, one
to work with Win98 cards.dll & another to work with WinXP cards.dll.
(or one that can distinguish between op sys)

Here's the (first?) failure point on W98 of code that works on WinXP, would
you have any suggestion as to what to do to alter it for W98?  As far as I 
remember (I'm on XP right now), "cdtInit" is in the W98 cards.dll.


global constant
eCdtInit = registerw32Function( cards32, "cdtInit", {C_POINTER, C_POINTER},
  C_INT ),

Dan

new topic     » goto parent     » topic index » view message » categorize

6. Re: cards32.ew by Brian Broker: how move cards?

Dan Moyer wrote:
> 
> Larry Miller wrote:
> > 
> > Dan Moyer wrote:
> > > 
> > > Brian,
> > > 
> > > I'm trying to use your cards32.ew to make a solitaire game, (actually
> > > taking
> > > your demo & altering it as needed), and I wonder if you continued with it
> > > to include moving cards?  I thought it would be easy, until I realized
> > > that
> > > it's doing a lot of "record keeping" of cards dealt onto a window, which
> > > then
> > > have to be handled correctly when cards are moved, I guess? 
> > > 
> > > I also discovered it (my alteration of your demo) won't run on a Win98
> > > system,
> > > can't find cards.dll, even though it's present. 
> > > 
> > > Dan Moyer
> > 
> > I am not familiar with this program but I do know about cards.dll. There are
> > 2 versions of this DLL, the version that comes with Win98, and the one that
> > comes with later OS's. They are not compatible. If you have a copy of the
> > later
> > DLL it should work with the program. Do not replace the original cards.dll
> > as
> > Win98 ganes will not work with it.
> > 
> > Larry Miller
> 
> 
> Larry,
> 
> Thanks for the info, sounds like I need two versions of the program, one
> to work with Win98 cards.dll & another to work with WinXP cards.dll.
> (or one that can distinguish between op sys)
> 
> Here's the (first?) failure point on W98 of code that works on WinXP, would
> you have any suggestion as to what to do to alter it for W98?  As far as I 
> remember (I'm on XP right now), "cdtInit" is in the W98 cards.dll.
> 
> 
> global constant
>   eCdtInit = registerw32Function( cards32, "cdtInit", {C_POINTER, C_POINTER},
> C_INT ),
> 
> Dan

Using the cards.dll that comes with Win98 is not easily done. Cards.dll in Win98
is a 16bit dll dating back to Windows 3.0 and can not be directly accessed with
32bit code. Win98 does this by a rather awkward technique known as thunking.
Although it is difficult, the technique is used throughout much of Win98 and
Microsoft decided to use the old DLL rather than develop a new one.

Euphoria can not use thunking without assembly language support. For further
information see: http://www.catch22.net/tuts/cardtut.asp

This is well out of my league but others on the forum may have done this kind of
thing. Condidering the low usage of Win98 it might be best to not support this
platform.

Larry Miller

new topic     » goto parent     » topic index » view message » categorize

7. Re: cards32.ew by Brian Broker: how move cards?

Larry Miller wrote:
> 
> Dan Moyer wrote:
> > 
> > Larry Miller wrote:
> > > 
> > > Dan Moyer wrote:
> > > > 
> > > > Brian,
> > > > 
> > > > I'm trying to use your cards32.ew to make a solitaire game, (actually
> > > > taking
> > > > your demo & altering it as needed), and I wonder if you continued with
> > > > it
> > > > to include moving cards?  I thought it would be easy, until I realized
> > > > that
> > > > it's doing a lot of "record keeping" of cards dealt onto a window, which
> > > > then
> > > > have to be handled correctly when cards are moved, I guess? 
> > > > 
> > > > I also discovered it (my alteration of your demo) won't run on a Win98
> > > > system,
> > > > can't find cards.dll, even though it's present. 
> > > > 
> > > > Dan Moyer
> > > 
> > > I am not familiar with this program but I do know about cards.dll. There
> > > are
> > > 2 versions of this DLL, the version that comes with Win98, and the one
> > > that
> > > comes with later OS's. They are not compatible. If you have a copy of the
> > > later
> > > DLL it should work with the program. Do not replace the original cards.dll
> > > as
> > > Win98 ganes will not work with it.
> > > 
> > > Larry Miller
> > 
> > 
> > Larry,
> > 
> > Thanks for the info, sounds like I need two versions of the program, one
> > to work with Win98 cards.dll & another to work with WinXP cards.dll.
> > (or one that can distinguish between op sys)
> > 
> > Here's the (first?) failure point on W98 of code that works on WinXP, would
> > you have any suggestion as to what to do to alter it for W98?  As far as I 
> > remember (I'm on XP right now), "cdtInit" is in the W98 cards.dll.
> > 
> > 
> > global constant
> >   eCdtInit = registerw32Function( cards32, "cdtInit", {C_POINTER,
> >   C_POINTER},
> > C_INT ),
> > 
> > Dan
> 
> Using the cards.dll that comes with Win98 is not easily done. Cards.dll in
> Win98
> is a 16bit dll dating back to Windows 3.0 and can not be directly accessed
> with
> 32bit code. Win98 does this by a rather awkward technique known as thunking.
> Although it is difficult, the technique is used throughout much of Win98 and
> Microsoft decided to use the old DLL rather than develop a new one.
> 
> Euphoria can not use thunking without assembly language support. For further
> information see: <a
> href="http://www.catch22.net/tuts/cardtut.asp">http://www.catch22.net/tuts/cardtut.asp</a>
> 
> This is well out of my league but others on the forum may have done this kind
> of thing. Condidering the low usage of Win98 it might be best to not support
> this platform.
> 
> Larry Miller


Thanks Larry, I was hoping to be able to work on my app on either machine,
but I see that will pretty near be impossible.

Dan

new topic     » goto parent     » topic index » view message » categorize

8. Re: cards32.ew by Brian Broker: how move cards?

Dan Moyer wrote:

> Juergen Luethje wrote:
>> 
>> Maybe it is also an option for you to use free SVG cards:
>>    <a
>>    href="http://david.bellot.free.fr/svg-cards/">http://david.bellot.free.fr/svg-cards/</a>
>> 
>> Regards,
>>    Juergen
> 
> Thanks Juergen, 
>   Can these be used under WinXP?  They're .tar files, which makes me think]
> they are only for Linux??

Scalable Vector Graphics (SVG) is an open standard created by the World
Wide Web Consortium. It is an XML markup language, an SVG file is
therefore a simple text file, which can be used on any operating system.
Your program just has to know how to handle it. smile
For instance here on Windows XP Firefox shows the contents of the file
"svg-cards.svg", when I drag and drop the file on it. For more info see
e.g. <http://en.wikipedia.org/wiki/SVG>.
I've never used SVG with an Euphoria program myself, so unfortunately I
can't give you more specific tips.

Looking at the author's website, it seems that he personally uses Linux,
so that's probably the sole reason why the archive is in TAR format.
In case you have no program for unpacking TAR files, I've unpacked it
here and (w/o any other changes) put it as ZIP file on my website:
<http://luethje.eu/temp/svg-cards-2.0.1.zip>

Regards,
   Juergen

new topic     » goto parent     » topic index » view message » categorize

9. Re: cards32.ew by Brian Broker: how move cards?

Me wrote:

<snip>

> I've never used SVG with an Euphoria program myself, so unfortunately I
> can't give you more specific tips.

<snip>

Well, of course it's not necessary to use the SVG file itself. You can also
open the SVG file with a good graphics program, and export each single card
or all cards or whatever is appropriate for you to a pixel grahics file such
as BMP, PNG, JPG or whatever -- and then use the pixel graphics file(s) in
your Eu program.

Regards,
   Juergen

new topic     » goto parent     » topic index » view message » categorize

10. Re: cards32.ew by Brian Broker: how move cards?

Juergen Luethje wrote:
> 
> Dan Moyer wrote:
> 
> > Juergen Luethje wrote:
> >> 
> >> Maybe it is also an option for you to use free SVG cards:
> >>    <a
> >>    href="http://david.bellot.free.fr/svg-cards/">http://david.bellot.free.fr/svg-cards/</a>
> >> 
> >> Regards,
> >>    Juergen
> > 
> > Thanks Juergen, 
> >   Can these be used under WinXP?  They're .tar files, which makes me think]
> > they are only for Linux??
> 
> Scalable Vector Graphics (SVG) is an open standard created by the World
> Wide Web Consortium. It is an XML markup language, an SVG file is
> therefore a simple text file, which can be used on any operating system.
> Your program just has to know how to handle it. smile
> For instance here on Windows XP Firefox shows the contents of the file
> "svg-cards.svg", when I drag and drop the file on it. For more info see
> e.g. <<a
> href="http://en.wikipedia.org/wiki/SVG">http://en.wikipedia.org/wiki/SVG</a>>.
> I've never used SVG with an Euphoria program myself, so unfortunately I
> can't give you more specific tips.
> 
> Looking at the author's website, it seems that he personally uses Linux,
> so that's probably the sole reason why the archive is in TAR format.
> In case you have no program for unpacking TAR files, I've unpacked it
> here and (w/o any other changes) put it as ZIP file on my website:
> <<a
> href="http://luethje.eu/temp/svg-cards-2.0.1.zip">http://luethje.eu/temp/svg-cards-2.0.1.zip</a>>
> 
> Regards,
>    Juergen

Thanks Juergen!

  Got your zip, now I just have to see if using it is harder than
what I've been doing with the cards.dll & Brian's demo :)

Dan

new topic     » goto parent     » topic index » view message » categorize

11. Re: cards32.ew by Brian Broker: how move cards?

Dan Moyer wrote:
> 
> Brian,
> 
> I'm trying to use your cards32.ew to make a solitaire game, (actually taking
> your demo & altering it as needed), and I wonder if you continued with it
> to include moving cards?  I thought it would be easy, until I realized that
> it's doing a lot of "record keeping" of cards dealt onto a window, which then
> have to be handled correctly when cards are moved, I guess? 
> 
> I also discovered it (my alteration of your demo) won't run on a Win98 system,
> can't find cards.dll, even though it's present. 
> 
> Dan Moyer

I haven't touched that code (nor Win9x, nor Euphoria) in years but I'm willing
to work with you if Juergen's suggestion isn't better.  Just reply personally
(brian_broker at yahoo.com) and we'll take it offline.

I've finally got some 'vacation' when I noticed my name here on the EUforum...

--Brian

new topic     » goto parent     » topic index » view message » categorize

12. Re: cards32.ew by Brian Broker: how move cards?

Dan Moyer wrote:

> 
> Thanks Larry, I was hoping to be able to work on my app on either machine,
> but I see that will pretty near be impossible.
> 
> Dan

Nothing is impossible... Euphoria can't easily interact with 16-bit dlls but it
doesn't have to...  just copy the 32-bit version (cards32.dll) with your app.  I
seriously doubt that MS would have a problem with that...  Afterall, I don't
think they even support OS's less than XP anymore.

=Brian

new topic     » goto parent     » topic index » view message » categorize

13. Re: cards32.ew by Brian Broker: how move cards?

Juergen Luethje wrote:
> Scalable Vector Graphics (SVG) is an open standard created by the World
> Wide Web Consortium. It is an XML markup language, an SVG file is
> therefore a simple text file, which can be used on any operating system.
> Your program just has to know how to handle it. smile
> For instance here on Windows XP Firefox shows the contents of the file
> "svg-cards.svg", when I drag and drop the file on it. For more info see
> e.g. <<a
> href="http://en.wikipedia.org/wiki/SVG">http://en.wikipedia.org/wiki/SVG</a>>.
> I've never used SVG with an Euphoria program myself, so unfortunately I
> can't give you more specific tips.

Not how to use in Euphoria, but a good SVG editor is Inkscape,
http://www.inkscape.org/

Gary

new topic     » goto parent     » topic index » view message » categorize

14. Re: cards32.ew by Brian Broker: how move cards?

Brian Broker wrote:
> 
> Dan Moyer wrote:
> 
> > 
> > Thanks Larry, I was hoping to be able to work on my app on either machine,
> > but I see that will pretty near be impossible.
> > 
> > Dan
> 
> Nothing is impossible... Euphoria can't easily interact with 16-bit dlls but
> it doesn't have to...  just copy the 32-bit version (cards32.dll) with your
> app.  I seriously doubt that MS would have a problem with that...  Afterall,
> I don't think they even support OS's less than XP anymore.
> 
> =Brian


Hi Brian,

Glad to see you here!  smile
I was just going to ask people if copying 32-bit cards.dll or cards32.dll 
over to Win98, but with a different name & then have app detect which op sys
is present & use either cards.dll on XP or xcards.dll(same one) on Win98, so
as not to make any problem with other apps on 98 expecting 16-bit cards.dll.

But to do that, I need to detect op sys, & I haven't looked into that yet.
Anyone know how to do that?

And I was going to try a "work-around" for moving cards, namely putting cards
back into the deck & re-dealing them to new positions, but I haven't got to
that yet to try it.

I'll email you with specific questions as they arise, as they will smile

Dan Moyer

new topic     » goto parent     » topic index » view message » categorize

15. Re: cards32.ew by Brian Broker: how move cards?

Dan Moyer wrote:

> Brian Broker wrote:
> > 
> > Dan Moyer wrote:
> > 
> > > 
> > > Thanks Larry, I was hoping to be able to work on my app on either machine,
> > > but I see that will pretty near be impossible.
> > > 
> > > Dan
> > 
> > Nothing is impossible... Euphoria can't easily interact with 16-bit dlls but
> > it doesn't have to...  just copy the 32-bit version (cards32.dll) with your
> > app.  I seriously doubt that MS would have a problem with that...  Afterall,
> > I don't think they even support OS's less than XP anymore.
> > 
> > =Brian
> 
> 
> Hi Brian,
> 
> Glad to see you here!  smile
> I was just going to ask people if copying 32-bit cards.dll or cards32.dll 
> over to Win98, but with a different name & then have app detect which op sys
> is present & use either cards.dll on XP or xcards.dll(same one) on Win98, so
> as not to make any problem with other apps on 98 expecting 16-bit cards.dll.
> 
> But to do that, I need to detect op sys, & I haven't looked into that yet.
> Anyone know how to do that?

<snip>
include misc.e
include dll.e
include machine.e

atom Kernel32
integer GetVersionEx

if platform() = WIN32 then
   Kernel32 = open_dll("kernel32.dll")
   GetVersionEx = define_c_func(Kernel32, "GetVersionExA", {C_POINTER}, C_LONG)
end if

constant           -- TYPE OSVERSIONINFO
   dwOSVersionInfoSize =  0,  -- C_ULONG
-- dwMajorVersion      =  4,  -- C_ULONG
-- dwMinorVersion      =  8,  -- C_ULONG
-- dwBuildNumber       = 12,  -- C_ULONG
   dwPlatformId        = 16,  -- C_ULONG
-- szCSDVersion        = 20,  -- String*128
SIZEOF_OSVERSIONINFO = 148

global function win_platform()
   -- out: 1 = Windows 95/98/Me, 2 = Windows NT/2000/XP/Vista
   atom osinfo, void, ret

   osinfo = allocate(SIZEOF_OSVERSIONINFO)
   poke4(osinfo + dwOSVersionInfoSize, SIZEOF_OSVERSIONINFO)
   void = c_func(GetVersionEx, {osinfo})
   ret = peek4u(osinfo + dwPlatformId)
   free(osinfo)
   return ret
end function

? win_platform()

See http://msdn2.microsoft.com/en-us/library/ms724451.aspx for more information.

Regards,
   Juergen

new topic     » goto parent     » topic index » view message » categorize

16. Re: cards32.ew by Brian Broker: how move cards?

Juergen Luethje wrote:
> 
> Dan Moyer wrote:
> 
> > Brian Broker wrote:
> > > 
> > > Dan Moyer wrote:
> > > 
> > > > 
> > > > Thanks Larry, I was hoping to be able to work on my app on either
> > > > machine,
> > > > but I see that will pretty near be impossible.
> > > > 
> > > > Dan
> > > 
> > > Nothing is impossible... Euphoria can't easily interact with 16-bit dlls
> > > but
> > > it doesn't have to...  just copy the 32-bit version (cards32.dll) with
> > > your
> > > app.  I seriously doubt that MS would have a problem with that... 
> > > Afterall,
> > > I don't think they even support OS's less than XP anymore.
> > > 
> > > =Brian
> > 
> > 
> > Hi Brian,
> > 
> > Glad to see you here!  smile
> > I was just going to ask people if copying 32-bit cards.dll or cards32.dll 
> > over to Win98, but with a different name & then have app detect which op sys
> > is present & use either cards.dll on XP or xcards.dll(same one) on Win98, so
> > as not to make any problem with other apps on 98 expecting 16-bit cards.dll.
> > 
> > But to do that, I need to detect op sys, & I haven't looked into that yet.
> > Anyone know how to do that?
> 
> <snip>
> }}}
<eucode>
> include misc.e
> include dll.e
> include machine.e
> 
> atom Kernel32
> integer GetVersionEx
> 
> if platform() = WIN32 then
>    Kernel32 = open_dll("kernel32.dll")
>    GetVersionEx = define_c_func(Kernel32, "GetVersionExA", {C_POINTER},
>    C_LONG)
> end if
> 
> constant           -- TYPE OSVERSIONINFO
>    dwOSVersionInfoSize =  0,  -- C_ULONG
> -- dwMajorVersion      =  4,  -- C_ULONG
> -- dwMinorVersion      =  8,  -- C_ULONG
> -- dwBuildNumber       = 12,  -- C_ULONG
>    dwPlatformId        = 16,  -- C_ULONG
> -- szCSDVersion        = 20,  -- String*128
> SIZEOF_OSVERSIONINFO = 148
> 
> global function win_platform()
>    -- out: 1 = Windows 95/98/Me, 2 = Windows NT/2000/XP/Vista
>    atom osinfo, void, ret
> 
>    osinfo = allocate(SIZEOF_OSVERSIONINFO)
>    poke4(osinfo + dwOSVersionInfoSize, SIZEOF_OSVERSIONINFO)
>    void = c_func(GetVersionEx, {osinfo})
>    ret = peek4u(osinfo + dwPlatformId)
>    free(osinfo)
>    return ret
> end function
> 
> ? win_platform()
> </eucode>
{{{

> See <a
> href="http://msdn2.microsoft.com/en-us/library/ms724451.aspx">http://msdn2.microsoft.com/en-us/library/ms724451.aspx</a>
> for more information.
> 
> Regards,
>    Juergen


Thanks Juergen!!

 From just reading the Euphoria doc, I was convinced distinguishing the flavors
of Windows wasn't possible, so thanks a lot for showing me how!

And copying the 32-bit cards.dll over (with a rename to be careful) works
fine, so your code will be useful.

Dan Moyer

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu