Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
unable to recreate a pointer
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
rogerdpack  
View profile  
 More options Feb 23 2010, 4:49 pm
From: rogerdpack <rogerdp...@gmail.com>
Date: Tue, 23 Feb 2010 13:49:21 -0800 (PST)
Local: Tues, Feb 23 2010 4:49 pm
Subject: unable to recreate a pointer
In this code:

http://pastie.org/839395

I read in an HWND, attempt to copy it, and use the copy.  However, the
copy doesn't seem to work.
Anyone have any insights here?
Thanks.
-rp


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
rogerdpack  
View profile  
 More options Feb 26 2010, 7:43 pm
From: rogerdpack <rogerpack2...@gmail.com>
Date: Fri, 26 Feb 2010 16:43:07 -0800 (PST)
Local: Fri, Feb 26 2010 7:43 pm
Subject: Re: unable to recreate a pointer

> http://pastie.org/839395

> I read in an HWND, attempt to copy it, and use the copy.  However, the
> copy doesn't seem to work.

So it appears the problem is that doing a
(HWND).read_int

isn't allowed by windows at all...

a HANDLE maybe is like a pointer into some deep dark internal
(unreadable, unwritable) windows memory structure.

It's a "special" pointer.  It's not what it points to that matters,
but rather that you are pointing to the "right" location.

As a work around you can specify long's for HWND and it works great.
Either that or at least don't try to copy them :)

The only way to copy them (if you're using pointers) is like

new_pointer = FFI::Pointer.new (Top.GetForegroundWindow.address)

Thanks for your patience.

-r


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Wayne Meissner  
View profile  
 More options Feb 26 2010, 10:51 pm
From: Wayne Meissner <wmeiss...@gmail.com>
Date: Sat, 27 Feb 2010 13:51:11 +1000
Local: Fri, Feb 26 2010 10:51 pm
Subject: Re: [ruby-ffi] Re: unable to recreate a pointer
On 27 February 2010 10:43, rogerdpack <rogerpack2...@gmail.com> wrote:

> a HANDLE maybe is like a pointer into some deep dark internal
> (unreadable, unwritable) windows memory structure.

> It's a "special" pointer.  It's not what it points to that matters,
> but rather that you are pointing to the "right" location.

> As a work around you can specify long's for HWND and it works great.
> Either that or at least don't try to copy them :)

> The only way to copy them (if you're using pointers) is like

> new_pointer = FFI::Pointer.new (Top.GetForegroundWindow.address)

So, the question is, why are you trying to do this at all?

What is the use case where this causes problems?

fg_window = Top.GetForegroundWindow
new_pointer = fg_window


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Arvicco  
View profile  
 More options Feb 23 2010, 9:24 pm
From: Arvicco <arvitall...@gmail.com>
Date: Tue, 23 Feb 2010 18:24:08 -0800 (PST)
Local: Tues, Feb 23 2010 9:24 pm
Subject: Re: unable to recreate a pointer
Since HWND represents window handle (which is never used for pointer
operations),
I just declare it as :ulong and never bother to do any pointer
gymnastics around it.
Everything seems to work well with this approach so far.

Regards,
Arvicco

On Feb 24, 12:49 am, rogerdpack <rogerdp...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »