Thread: copying SHELLEXECUTEINFO structure

  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    222

    copying SHELLEXECUTEINFO structure

    I know this may be off-topic, but I'm trying to get some C++/C fundamentals straight here. I'm trying to copy a into b. Below shows the line of thinking that I have so far:

    Code:
    SHELLEXECUTEINFO a;
    
    // some manipulation on a
    
    SHELLEXECUTEINFO b = a;            // I'm trying to perform the copying operation
    Would there be anything seriously wrong with doing this?

  2. #2
    int x = *((int *) NULL); Cactus_Hugger's Avatar
    Join Date
    Jul 2003
    Location
    Banks of the River Styx
    Posts
    902
    No, that's fine.
    However, SHELLEXECUTEINFO does contain some pointers. If you then choose to use the resultant copy, you just have to ensure the pointers are still valid while the copy is in use.

    Note that if you copy that way, any operations on the pointed-to data of a will affect b, and vice-versa. Normal pointer rules.
    long time; /* know C? */
    Unprecedented performance: Nothing ever ran this slow before.
    Any sufficiently advanced bug is indistinguishable from a feature.
    Real Programmers confuse Halloween and Christmas, because dec 25 == oct 31.
    The best way to accelerate an IBM is at 9.8 m/s/s.
    recursion (re - cur' - zhun) n. 1. (see recursion)

  3. #3
    Registered User
    Join Date
    Jul 2004
    Posts
    222
    Thanks for confirming on this. However, I have managed to structure my routines in a way that I don't need to copy the structures, hence don't need to deal with ensuring that the pointers are pointing to appropriate contents.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Copying pointers in structures instead of the structure data?
    By Sparrowhawk in forum C++ Programming
    Replies: 7
    Last Post: 02-23-2009, 06:04 PM
  2. Problem referencing structure elements by pointer
    By trillianjedi in forum C Programming
    Replies: 19
    Last Post: 06-13-2008, 05:46 PM
  3. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  4. Serial Communications in C
    By ExDigit in forum Windows Programming
    Replies: 7
    Last Post: 01-09-2002, 10:52 AM
  5. C structure within structure problem, need help
    By Unregistered in forum C Programming
    Replies: 5
    Last Post: 11-30-2001, 05:48 PM