Hey all,
Charlie Russel has convinced me that it would be cool to have a 64-bit
version of DQSD.
Just shipping it as-is won't work, because a 64-bit process cannot load a
32-bit DLL, apparently.
So, I've experimented with building DQSDTools in VC7.1 (VS.NET 2003) with
the /Wp64 switch on. That switch performs portability checks for 64-bit
platforms, so unless the compiler complains, the code should be more or less
apt to recompile with a compiler targetting a 64-bit architecture.
I started out with 29 warnings -- stuff like casting HINSTANCEs to INTs,
etc. Most of those are easily solved by choosing less ambiguous types
(INT_PTR instead of INT, LRESULT instead of INT, etc).
Now I'm down to 16 warnings, all in MenuBuilder.cpp... The problem seems to
be that it passes HMENU handles around as long-pointers. Since they're just
opaque handles, roundtripping them through JScript works great on a 32-bit
architecture, but on AMD64, HANDLEs are 64-bit entities, and JScript longs
are still just 32 bit, as far as I can tell.
I've been playing with the thought of building a minimal COM object to wrap
a menu handle, that we can return from the methods, instead of returning raw
pointers. Something like:
[local]
interface IMenuHandle
{
HRESULT GetHMenu([out] HMENU* phMenu);
}
class CMenuHandle :
public CComObjectRootEx< ... >,
public IDispatchImpl< ISomeInterfaceCanBeEmpty, ...>,
public IMenuHandle
{
// Impl follows
};
Given that the object has a dispatch interface, it can be returned to
script. But it also has a local, C++-only IMenuHandle interface that we can
use to get the handle back.
Does this seem reasonable, or is there a simpler solution?
Cheers,
- Kim
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Archive: https://lists.sourceforge.net/lists/listinfo/dqsd-devel