Supported data types

[ Home / PBInvoke library ]


Simple types

The folowing C/C++ types are supported
  • short, int, long, longlong and their signed/unsigned versions
  • char, wchar_t - character types
  • double, float
  • void - return type for procedures

Structure types

  • struct - a record of fields of any type
  • union - a struct whose fields share the same memory.
For structs/unions the packing attribute can be specified. See the reference.

Pointer types

  • pointer to type (*)
  • reference to type (&)

Function prototypes

  • external function prototype
  • pointer to function (callback).
For functions and function pointers a few attributes are supported. See the reference.

User-defined types

A developer can declare any custom C type using one or more C typedef operators separated by ";" and passed as a string to n_pi_core.of_declare(), as follows:
n_pi_core lnv_core
lnv_core.of_declare(" &
	typedef void *LPCITEMIDLIST, *LPITEMIDLIST; &
	typedef int (CALLBACK* BFFCALLBACK)(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData); &
	")

WinAPI types

The most widely used WinAPI types are predeclared in PBInvoke.

These are: TCHAR, TSTR, LPTSTR, LPCTSTR, WCHAR, WSTR, LPWSTR, LPCWSTR, CHAR, STR, LPSTR, LPCSTR, BYTE,BOOL, HWND, HINSTANCE, LPBOOL, INT, UINT, UINT_PTR, DWORD, LPDWORD, HANDLE, LRESULT, LONG, ULONG, WPARAM, LPARAM, HMODULE, HHOOK, WORD, LPWORD, SHORT, USHORT, VOID, PVOID, LPVOID, LPCVOID, FLOAT, LPSECURITY_ATTRIBUTES

Not supported

  • Double, float as a return type for callbacks. However pointers to such types are supported as a return type.
  • Any struct of size of more than 4 bytes as a return type for any function. However pointers to such structures are supported as a return type.
  • Classes.
  • Structures inherited from other structures.

    See also

  • Handling strings (char*, wchar_t*)
  • Handling TCHAR and TSTR. Unicode/ANSI function name suffixes
  • WinAPI constants and types
  • Working with C/C++ structures/unions
  • Working with callbacks
  • Unsupported and unimplemented PBInvoke features
  • PBInvoke
    Home
    Download Demo
    Documentation
    Purchase

    See Also
    Handling strings (char*, wchar_t*)
    Handling TCHAR and TSTR. Unicode/ANSI function name suffixes
    WinAPI constants and types
    Working with C/C++ structures/unions
    Working with callbacks
    Unsupported and unimplemented PBInvoke features


    Copyright (C) 1999 - 2017 Anatoly Moskovsky Report a site problem