vb@rchiv
VB Classic
VB.NET
ADO.NET
VBA
C#
vb@rchiv Offline-Reader - exklusiv auf der vb@rchiv CD Vol.4  
 vb@rchiv Quick-Search: Suche startenErweiterte Suche starten   Impressum  | Datenschutz  | vb@rchiv CD Vol.6  | Shop Copyright ©2000-2024
 
zurück

 Sie sind aktuell nicht angemeldet.Funktionen: Einloggen  |  Neu registrieren  |  Suchen

Fortgeschrittene Programmierung
DLL Einbindung in VB6 
Autor: Staffi
Datum: 11.09.05 17:04

Hallo,
habe eine DLL mit der ein "Conrad" FHZ1000PC-USB Funkempfänger/Sender gesteuert werden kann.
Leider gibt es zu dieser DLL nur ein C++Builder6 Beispiel-Programm.
Wie muss ich diese DLL in mein eigenes VB6 Programm einbinden damit ich die Funktionen nutzen kann???
Hier nun das C++Builder6 Beispiel-Programm:

HINSTANCE DLL_Handle;

typedef INT (*TFHZOpen)();
typedef INT (*TFHZClose)();
typedef INT (*TFHZSendData)(int,int,int,int,int,int,int,int,int);
// Achtung, die Parameterübergabe nicht mit array (int[9])!!
// der unbequeme Weg die Variablen einzeln aufzuführen dient der
// Übergabe-Kompatibilität der unterschiedlichen Programmiersprachen
typedef INT (*TFHZReceiveData)(int*,int*,int*,int*,int*,int*,int*,int*,int*);
typedef INT (*TFHZBufferCount)();
typedef INT (*TFHZReset)();
typedef INT (*TFHZActivateReceive)();
typedef INT (*TFHZDeactivateReceive)();
typedef INT (*TFHZSetHC)(int,int);
typedef INT (*TFHZClearFHTBuffer)();
typedef INT (*TFHZGetZentrCode)();
typedef INT (*TFHZSetZentrCode)(int);
typedef INT (*TFHZGetVersion)(int*,int*);
typedef INT (*TFHZSetFHTTime)();
typedef INT (*TFHZRequestFHT)(int,int,int);
typedef INT (*TFHZResetTimeCount)();


TFHZOpen FHZOpen;
TFHZOpen FHZClose;
TFHZSendData FHZSendData;
TFHZReceiveData FHZReceiveData;
TFHZBufferCount FHZBufferCount;
TFHZReset FHZReset;
TFHZActivateReceive FHZActivateReceive;
TFHZDeactivateReceive FHZDeactivateReceive;
TFHZSetHC FHZSetHC1;
TFHZSetHC FHZSetHC2;
TFHZClearFHTBuffer FHZClearFHTBuffer;
TFHZGetZentrCode FHZGetZentrCode;
TFHZSetZentrCode FHZSetZentrCode;
TFHZGetVersion FHZGetVersion;
TFHZSetFHTTime FHZSetFHTTime;
TFHZRequestFHT FHZRequestFHT;
TFHZResetTimeCount FHZResetTimeCount;

int InitFHZDLL()
{
DLL_Handle=LoadLibrary("FHZ1000PC.DLL");
if (DLL_Handle != NULL)
{
FHZOpen = (TFHZOpen) GetProcAddress(DLL_Handle, "FHZOpen");
FHZClose = (TFHZOpen) GetProcAddress(DLL_Handle, "FHZClose");
FHZSendData = (TFHZSendData) GetProcAddress(DLL_Handle, "FHZSendData");
FHZReceiveData = (TFHZReceiveData) GetProcAddress(DLL_Handle, "FHZReceiveData");
FHZBufferCount = (TFHZBufferCount) GetProcAddress(DLL_Handle, "FHZBufferCount");
FHZReset = (TFHZReset) GetProcAddress(DLL_Handle, "FHZReset");
FHZActivateReceive = (TFHZActivateReceive) GetProcAddress(DLL_Handle, "FHZActivateReceive");
FHZDeactivateReceive = (TFHZDeactivateReceive) GetProcAddress(DLL_Handle, "FHZDeactivateReceive");
FHZSetHC1 = (TFHZSetHC) GetProcAddress(DLL_Handle, "FHZSetHC1");
FHZSetHC2 = (TFHZSetHC) GetProcAddress(DLL_Handle, "FHZSetHC2");
FHZClearFHTBuffer = (TFHZClearFHTBuffer) GetProcAddress(DLL_Handle, "FHZClearFHTBuffer");
FHZGetZentrCode = (TFHZGetZentrCode) GetProcAddress(DLL_Handle, "FHZGetZentrCode");
FHZSetZentrCode = (TFHZSetZentrCode) GetProcAddress(DLL_Handle, "FHZSetZentrCode");
FHZGetVersion = (TFHZGetVersion) GetProcAddress(DLL_Handle, "FHZGetVersion");
FHZSetFHTTime = (TFHZSetFHTTime) GetProcAddress(DLL_Handle, "FHZSetFHTTime");
FHZRequestFHT = (TFHZRequestFHT) GetProcAddress(DLL_Handle, "FHZRequestFHT");
FHZResetTimeCount = (TFHZResetTimeCount) GetProcAddress(DLL_Handle, "FHZResetTimeCount");
return(1);
}
else
return(0);
}
alle Nachrichten anzeigenGesamtübersicht  |  Zum Thema  |  Suchen

 ThemaViews  AutorDatum
DLL Einbindung in VB61.463Staffi11.09.05 17:04
Re: DLL Einbindung in VB61.243ModeratorMartoeng12.09.05 00:06
Re: DLL Einbindung in VB61.114Hard14.09.05 07:52
Re: DLL Einbindung in VB61.032ModeratorMartoeng14.09.05 13:10
Re: DLL Einbindung in VB61.002Hard14.09.05 15:59
Re: DLL Einbindung in VB61.013ModeratorMartoeng14.09.05 17:59
Re: DLL Einbindung in VB6994Radeonmaster14.09.05 21:08
Re: DLL Einbindung in VB6988Hard15.09.05 08:03
Eine Lösung (Double Aufruf)1.045[JoE]14.09.05 23:51
Re: DLL Einbindung in VB61.035wb-soft14.09.05 09:27
Re: DLL Einbindung in VB6995Hard14.09.05 09:34
Re: DLL Einbindung in VB61.028[JoE]14.09.05 23:06
Re: DLL Einbindung in VB61.003[JoE]14.09.05 23:15
Re: DLL Einbindung in VB61.000Hard15.09.05 07:57
Re: DLL Einbindung in VB6998[JoE]15.09.05 14:05
Re: DLL Einbindung in VB61.011[JoE]15.09.05 14:07

Sie sind nicht angemeldet!
Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.

Einloggen  |  Neu registrieren

Funktionen:  Zum Thema  |  GesamtübersichtSuchen 

nach obenzurück
 
   

Copyright ©2000-2024 vb@rchiv Dieter Otter
Alle Rechte vorbehalten.
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein.

Diese Seiten wurden optimiert für eine Bildschirmauflösung von mind. 1280x1024 Pixel