globalalloc function pass

This is a discussion on globalalloc function pass within the Windows Programming forums, part of the Platform Specific Boards category; testd( char *tempd ) { ... } tempd = (char*)GlobalAlloc( GPTR, ( ( len + 1 ) * 9 ) ...

  1. #1
    Registered User kryptkat's Avatar
    Join Date
    Dec 2002
    Posts
    638

    Smile globalalloc function pass

    testd( char *tempd )
    {

    ...

    }



    tempd = (char*)GlobalAlloc( GPTR, ( ( len + 1 ) * 9 ) );


    GetDlgItemText(hwnd, IDC_CHILD_EDIT, tempd, len + 1);


    for(a=0;a<temp;a++){
    testd( tempd );
    }



    i get type mismatch errors when i try to compile the whole code. these are just excerpts or the problemed part of the code

    this should be just a normal pointer pass from testd but the proto typeing is wrong. the problem is with the GlobalAlloc

    it is the globalallic that is messing this up. i have tryed many ways such as prototypeing it like testd( gptr *tempd ) etc.

    and many others suchas testd( (char*)GlobalAlloc *tempd ))



    meow!

    thank you in advance

    -kk

    can you pass to a globalalloc to a function?

  2. #2
    Registered User kryptkat's Avatar
    Join Date
    Dec 2002
    Posts
    638
    return_type function_name(list of parameters);

    int max(int n1, int n2); /* A programmer-defined function */
    int printf(const char *format,...); /* From the standard library */
    int fputs(const char *buff, File *fp); /* From the standard library */


    problem was in return type meow!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 01:13 AM
  2. Replies: 28
    Last Post: 07-17-2006, 12:35 AM
  3. Calling a Thread with a Function Pointer.
    By ScrollMaster in forum Windows Programming
    Replies: 6
    Last Post: 06-10-2006, 09:56 AM
  4. Bisection Method function value at root incorrect
    By mr_glass in forum C Programming
    Replies: 3
    Last Post: 11-10-2005, 09:10 AM
  5. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 06:06 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21