use Loaded layer in other application

mesgarmesgar Global Mapper UserPosts: 13Trusted User
edited April 2011 in SDK
hi
in my application 1 , load one layer and i send layer handle to application 2.
i want use, loaded layer application 1, in application 2.
any way to do it?
Intptr Layer Handler must be set to layer application 2.
how i do it?

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited April 2011
    A layer handle is a pointer into memory in the address space of your first application, there isn't any way to transfer that to another running application. You would need to reload the layer in your second application.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • mesgarmesgar Global Mapper User Posts: 13Trusted User
    edited April 2011
    But the pointer that i have can be used from another application, because it's the memory address of the object and is the same for any application and there is way to transfer that to another running application.
    in sdk global mapper must be where a function that set layer handle.
    how i do it?
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited April 2011
    That's not how memory works (at least not since the 16-bit Windows days). The memory pointers are virtual memory addresses that are only valid within the address space of a single process. You can't transfer pointers between running applications.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • mesgarmesgar Global Mapper User Posts: 13Trusted User
    edited April 2011
    i have a pointer into memory address in application 1,same pointer can be used in another running application.
    in language c and c++ is very usual doing it, because we use a pointer into memory address.

    may in SDK Global Mapper set pointer layer handle instead of load layer?
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited April 2011
    That's simply not true, you cannot simply pass pointers from one running process to another, each process has it's own independent memory space, otherwise you could easily corrupt the memory space of other running processes simply by writing to memory being used by that process.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
Sign In or Register to comment.