[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Translate small pascal to C++/C (D3|DirectX)

Posted on 1998-06-10
2
Medium Priority
?
460 Views
Last Modified: 2010-04-04
Hello guys would you please translate that to C++.
I need these structure to make some directX stuff with C++ Builder.
I did not found them in the directX headers.
Either you translate the thing, or if you know where they are defined
and what I should include in my C++Builder 3 project let me know.

Thanks.

what I do not know especially is the array[0..0] ?

const
  _c_dfDIKeyboard_Objects: array[0..0] of DIOBJECTDATAFORMAT = (
    (  pguid: @GUID_Key;
       dwOfs: 1;
       dwType: DIDFT_BUTTON or DIDFT_ANYINSTANCE;
       dwFlags: 0)
  );

  c_dfDIKeyboard: DIDATAFORMAT = (
      dwSize: Sizeof(c_dfDIKeyboard);
      dwObjSize: Sizeof(DIOBJECTDATAFORMAT);
      dwFlags: 0;
      dwDataSize: SizeOf(DIKEYBOARDSTATE);
      dwNumObjs: High(_c_dfDIKeyboard_Objects)+1;
      rgodf: @_c_dfDIKeyboard_Objects);

type
  DIOBJECTDATAFORMAT = record
    pguid: PGUID;
    dwOfs: DWORD;
    dwType: DWORD;
    dwFlags: DWORD;
  end;
  LPDIOBJECTDATAFORMAT = ^DIOBJECTDATAFORMAT;

  DIDATAFORMAT = record
    dwSize: DWORD;
    dwObjSize: DWORD;
    dwFlags: DWORD;
    dwDataSize: DWORD;
    dwNumObjs: DWORD;
    rgodf: LPDIOBJECTDATAFORMAT;
  end;
  LPDIDATAFORMAT = ^DIDATAFORMAT;

GUID_Key: TGUID = (D1:$55728220;D2:$D33C;D3:$11CF;D4:($BF,$C7,$44,$45,$53,$54,$00,$00));
  DIDFT_BUTTON     = $0000000C;
  DIDFT_ANYINSTANCE = $00FFFF00;

type
  DIKEYBOARDSTATE = array[0..255] of Byte;
0
Comment
Question by:jeurk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Accepted Solution

by:
d003303 earned 200 total points
ID: 1351960
Yo,
here we go:

typedef struct {
    const GUID * pguid;
    DWORD        dwOfs;
    DWORD        dwType;
    DWORD        dwFlags;
} DIOBJECTDATAFORMAT, *LPDIOBJECTDATAFORMAT;

typedef struct {
    DWORD dwSize;
    DWORD dwObjSize;
    DWORD dwFlags;
    DWORD dwDataSize;
    DWORD dwNumObjs;
    LPDIOBJECTDATAFORMAT rgodf;
} DIDATAFORMAT, *LPDIDATAFORMAT;

#define DIDFT_BUTTON            0x0000000C
#define DIDFT_ANYINSTANCE      0x00FFFF00

typedef BYTE[255] DIKEYBOARDSTATE;

REFCLSID GUID_Key =
{
      0x55728220, 0xD33C, 0x11CF,
      0xBF, 0xC7, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0
};

DIOBJECTDATAFORMAT _c_dfDIKeyboard_Objects[] =
{
      {
            &GUID_Key,
            1,
            DIDFT_BUTTON | DIDFT_ANYINSTANCE,
            0,
      },
};

DIDATAFORMAT c_dfDIKeyboard =
{
      sizeof(DIDATAFORMAT),
      sizeof(DIOBJECTDATAFORMAT),
      0,
      sizeof(DIKEYBOARDSTATE),
      (sizeof(_c_dfDIKeyboard_Objects) / sizeof(_c_dfDIKeyboard_Objects[0])),
      &_c_dfDIKeyboard_Objects
};

Slash/d003303

0
 
LVL 4

Author Comment

by:jeurk
ID: 1351961
Thanks for the answer.
CU in an other thread.
Jeurk
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question