Thread: need help with opaque programming with struct and addresses.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    So my first question would be which one would it be and how do i comile it.
    If it was going to be a DLL you would know. A DLL is code that is all ready to be executed, so there is no compiling. What you do instead is load the library at some point, using system specific API calls, into RAM to be used by the executable. The person running the program needs to have the DLL being used on his computer.

    What you showed us is almost an opaque pointer. Another way to say it is a pointer to an incomplete type. The details of the struct must be in a different file, so you need to include the extern keyword:
    Code:
    typedef extern struct gps *t_gps;
    Now t_gps is an opaque pointer type: the thing that t_gps points to could be defined in any C source that #include your header.

  2. #2
    Registered User
    Join Date
    Mar 2011
    Posts
    6
    you miss understood what i meant. first i need to know how to compile this dll, and use it in my new program.

    second i need to know how im my dll i can use address from the extarnal program to manipulate the struct from with in the dll if the struct is static in the .c. so im either sending the address incorrecly and recieving it incorrecly and im doing it wrong to declare it in my .h and .c
    Last edited by DarkAngel4ever; 03-27-2011 at 11:03 PM. Reason: error in spelling

  3. #3
    Registered User
    Join Date
    Mar 2011
    Posts
    6
    no one have any clues?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 05-05-2009, 05:35 AM
  2. struct pointer
    By t014y in forum C Programming
    Replies: 5
    Last Post: 01-26-2009, 03:50 PM
  3. Replies: 28
    Last Post: 07-16-2006, 11:35 PM
  4. Help please im stuck
    By ItsMeHere in forum C Programming
    Replies: 7
    Last Post: 06-15-2006, 04:07 AM
  5. pointer to a struct
    By ramdal in forum C Programming
    Replies: 13
    Last Post: 12-15-2005, 09:01 AM