i have one more times a problem with translate a C++ code to PB.
I import functions from a *.lib
My translation shows like this:
original C++ *.h:
Code: Select all
..
SimConnect_Text(HANDLE hSimConnect, SIMCONNECT_TEXT_TYPE type, float fTimeSeconds, SIMCONNECT_CLIENT_EVENT_ID EventID, DWORD cbUnitSize, void * pDataSet);
..
Code: Select all
Import "SimConnect.lib"
...
SimConnect_Text(hSimConnect.l, type.l, fTimeSeconds.f, EventID.l, cbUnitSize.l, *pDataSet.l)
...
EndImport
Code: Select all
static const char szTitle[] = "Facilities Data";
.....
SimConnect_Text(hSimConnect, SIMCONNECT_TEXT_TYPE_SCROLL_RED, 15, 0, sizeof(szTitle), (void*)szTitle);
....
Code: Select all
Global Dim MyText.s(0)
MyText(0) = "Facilities Data"
....
SimConnect_Text(SC_handle, #SIMCONNECT_TEXT_TYPE_SCROLL_RED, 0.0, #EVENT_TEXT_1, Len(MyText(0)), @MyText())

And here is the doku for the Function "SimConnect_Text()"
I hope you can help me.The SimConnect_Text function is used to display a text menu, or scrolling or static text, on the screen.
Syntax
HRESULT SimConnect_Text(
HANDLE hSimConnect,
SIMCONNECT_TEXT_TYPE type,
float fTimeSeconds,
SIMCONNECT_CLIENT_EVENT_ID EventID,
DWORD cbUnitSize,
void* pDataSet
);
Parameters
hSimConnect
[in] Handle to a SimConnect object.
type
[in] One member of the SIMCONNECT_TEXT_TYPE enumeration type.
fTimeSeconds
[in] The timeout value for the text or menu, in seconds. If zero is entered, the text or menu will not timeout. For text only, this timeout value can be overridden if there are other text requests waiting in the queue (see the Remarks below). If the timeout requested exceeds the minimum display time, and another text request is waiting, the timeout value is overridden and the text will only be displayed for the minimum display time. The default minimum display time is two seconds for static text and 10 seconds for scrolling text. These can be changed in the [SimConnect] section of FSX.cfg file using the TextMinPrintTimeSeconds and TextMinScrollTimeSeconds settings.
EventID
[in] Specifies the client defined event ID, which will be returned along with the SIMCONNECT_TEXT_RESULT (in the dwData parameter) of a SIMCONNECT_RECV_EVENT structure.
cbUnitSize
[in] Specifies the size of pDataSet in bytes.
pDataSet
[in] Specifies the array of string data for the menu or text. For text simply enter the string, for a menu the format of the string is a list of null-terminated string entries, with the menu title and prompt as the first two entries, for example: "Title\0Prompt\0Menu item 1\0Menu item 2\0", with a maximum of ten menu items. If an empty string is sent in pDataSet along with an EventID that matches a menu or text in the queue (see Remarks below), that entry will be removed from the queue, with the SIMCONNECT_TEXT_RESULT_REMOVED event being returned to the client. If a new set of menu items, or new text string, is sent with an EventID that matches an entry in the queue, that entry will be replaced in the queue, with the SIMCONNECT_TEXT_RESULT_REPLACED event being returned to the client. The entry will not lose its place in the queue. This change will take place even if the text or menu is being rendered on the screen.
Return Values
The function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Thanks,
Nico