Professional Web Applications Themes

Getting machine type - Mac Programming

Quick question: In Classic, I used the following code to get the machine type: err = Gestalt(gestaltMachineType, &myGestalt); if ( err == noErr ) { GetIndString(tempStr, kMachineNameStrID, (short)myGestalt); BlockMove(&(tempStr[1]), &(szcomputer_name[0]), tempStr[0]); szcomputer_name[tempStr[0]] = '

Thread: Getting machine type

'; } In OSX, this doesn't work---I get an err = -5551 from Gestalt. This does seem to be an OSX-safe call, so I'm not sure what the problem is. TIA, -Mike Hunson...

  1. #1

    Default Getting machine type

    Quick question:

    In Classic, I used the following code to get the machine type:

    err = Gestalt(gestaltMachineType, &myGestalt);

    if ( err == noErr )
    {
    GetIndString(tempStr, kMachineNameStrID, (short)myGestalt);
    BlockMove(&(tempStr[1]), &(szcomputer_name[0]), tempStr[0]);
    szcomputer_name[tempStr[0]] = '\0';
    }

    In OSX, this doesn't work---I get an err = -5551 from Gestalt.

    This does seem to be an OSX-safe call, so I'm not sure what the problem is.

    TIA,

    -Mike Hunson

    Mike Guest

  2. #2

    Default Re: Getting machine type

    In article <BBAC40DE.29120%org>,
    "Mike H." <org> wrote:
     

    See:
    <http://developer.apple.com/doentation/ReleaseNotes/Carbon/CarbonCore.
    html>

    The germane quote is: "Not all gestalt selectors are implemented under
    OSX. Notable amongst these are: gestaltMachineType and
    gestaltROMVersion. "
    Tom Guest

  3. #3

    Default Re: Getting machine type

    So it turns out that it's not available under Carbon...

    But, is there a way to get the machine type (NOT the machine name) under
    Carbon in OSX?

    Thanks,

    Alex

    in article BBAC40DE.29120%org, Mike H. at org
    wrote on 10/10/03 10:55 AM:
     


    Mike Guest

  4. #4

    Default Re: Getting machine type

    In article <BBAC457A.29124%org>, Mike H.
    <org> wrote:
     

    It's not trivial, but you can get a machine identifier string using
    IOKit.
    James Guest

Similar Threads

  1. filecopy from remote machine to local machine
    By anu in forum PERL Modules
    Replies: 5
    Last Post: February 8th, 03:49 PM
  2. Replies: 2
    Last Post: June 17th, 12:08 AM
  3. Getting files from a Win 2000 machine to a Windows XP machine
    By John Mycroft in forum Windows Networking
    Replies: 0
    Last Post: July 11th, 11:52 AM
  4. can't get 2000 machine to read xp pro machine
    By andy in forum Windows Networking
    Replies: 0
    Last Post: July 2nd, 11:31 PM
  5. Replies: 2
    Last Post: December 30th, 07:40 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139