AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Win32/Win64 API (native code) Delphi iMon VFD von soundgraph ansteuern
Thema durchsuchen
Ansicht
Themen-Optionen

iMon VFD von soundgraph ansteuern

Ein Thema von Abe_Oddysee · begonnen am 13. Jun 2006
Antwort Antwort
Benutzerbild von Abe_Oddysee
Abe_Oddysee

Registriert seit: 4. Mär 2005
Ort: Bad Sachsa
3 Beiträge
 
Delphi 2005 Personal
 
#1

iMon VFD von soundgraph ansteuern

  Alt 13. Jun 2006, 07:43
Hallo!

Ich bin Hobby Programmierer und benutze Delphi 2005 Personal, meine Kenntnisse in C und C++ sind gleich null.

Was will ich realisieren?

Ich habe ein Gehäuse von Silverstone mit einem Display: iMON VFD von Soundgrah, auf diesem Display möchte ich Text anzeigen lassen. Vom Hersteller Soundgrah gibt es eine API in C++. Da meine kenntnisse und interesse in Richtung Delphi geht, wollte ich ein Programm in Delphi schreiben und nicht in C++.

Meine Vorgehnsweise:

- DLL finden
-> SG_VFD.dll

- funktionen und prozeduren finden
-> SG_VFD.h

///////////////////////////////////////////////
// Open VFD driver and initialize parameters.
// Call this method, when application starts.
// Return value informs driver is open or not
IMONVFD_API bool iMONVFD_Init(int vfdType, int resevered=0);

///////////////////////////////////////////////
// Close VFD driver.
// Call this method, when application destroyed.
IMONVFD_API void iMONVFD_Uninit(void);

///////////////////////////////////////////////
// Check if VFD driver is opened.
IMONVFD_API bool iMONVFD_IsInited(void);

///////////////////////////////////////////////
// Send text data to VFD. VFD supports only English character set.
IMONVFD_API bool iMONVFD_SetText(char* szFirstLine, char* szSecondLine);

///////////////////////////////////////////////
// Send EQ data to VFD.
// Total 16band, each band ranges from 0 to 100
// make EQ data with integer array.
IMONVFD_API bool iMONVFD_SetEQ(int* arEQValue);

- Funktionen und Prozeduren in Delphi einbinden

function iMONVFD_Init(vfdType, resevered: Integer): Boolean; external 'SG_VFD.dll';
procedure iMONVFD_Uninit(); external 'SG_VFD.dll';
function iMONVFD_IsInited(): Boolean; external 'SG_VFD.dll';
function iMONVFD_SetText(szFirstLine, szSecondLine: PChar):Boolean; external 'SG_VFD.dll';

Ich kann den Treiber öffnen "iMONVFD_Init", schließen "iMONVFD_Uninit()" und abfragen "iMONVFD_IsInited()" ob er gestartet ist, aber das mit dem Text anzeigen klappt nicht, nur unidentifizierbare zeichen.

Mein Problem ist: "Char*", ich kann es nicht in Delphi umsetzen

Zweites Problem im Original (iMON_VFD_DemoDlg.cpp)wird der Text so gesendet:

void CIMON_VFD_DemoDlg::OnButtonSet()
{
CString str1 = _T("");
CString str2 = _T("");

((CEdit*)GetDlgItem(IDC_EDIT1))->GetWindowText(str1);
((CEdit*)GetDlgItem(IDC_EDIT2))->GetWindowText(str2);


if( !iMONVFD_SetText((LPSTR)(LPCTSTR)str1, (LPSTR)(LPCTSTR)str2))
{
KillTimer(100);
iMONVFD_Uninit();
CString err = _T("Fail to display text.\n iMON H/W is NOT connected \nor iMON VFD is using VFD");
AfxMessageBox(err);
EndDialog(IDOK);
}

// off timer
m_nTimerOff = SetTimer(101, 700, NULL);
}

Was bedeutet "LPSTR" bzw. "LPCTSTR" und wie muss ich es in Delphi umsetzen?
Angehängte Dateien
Dateityp: zip imon2_200.zip (303,5 KB, 29x aufgerufen)
Dateityp: zip imon_vfd_api_112.zip (59,2 KB, 26x aufgerufen)
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 06:37 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz