No announcement yet.

C struct conversion question

  • Filter
  • Time
  • Show
Clear All
new posts

  • C struct conversion question

    Sorry for the basic question here folks. It's been a while and wheels are turning slowly this morning.

    I'm translating a header file and have the following structure:

    'typedef struct ss_ct_createeditorcontrol_args
    '   LPTSTR lpszName;   // in: name of custom celltype
    '   HWND   hWndSpread; // in: HWND of Spread control
    '   long   lStyle;     // in: style for custom celltype
    '   int    CtrlId;     // in: Value to use for control id
    '   HWND   hWndEditor; // out: HWND of editor control
    I'm wondering how best to handle the first field in the corresponding PB TYPE declaration. Should I define lpszName as a DWORD or would an ASCIIZ PTR work?
    Bernard Ertl
    InterPlan Systems

  • #2
    Personally I'd go with ASCIIZ PTR.

    But you may use whatever you want, as long as the VALUE of that member ( a 32-bit integer) represents the address of a null-terminated string and you make your assignments in a manner consistent with your datatype choice.
    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]


    • #3
      ASCIIZ PTR is correct, DWORD or LONG could also be used also but it depends whether you will be referencing the string content of the pointer (@lpszName) after assignment, in which case you'd need ASCIIZ PTR. | Slam DBMS | PrpT Control | Other Downloads | Contact Me