Board index » cppbuilder » Windows DLL in BCB5, Variants, etc.
tchris
![]() CBuilder Developer |
Windows DLL in BCB5, Variants, etc.2003-10-17 11:41:03 PM cppbuilder33 I have a DLL with minimal documentation and examples in VB. I have succesfully (I think) used "impdef" and "implib" to create a useable LIB file for linking. ...at least the linker doesn't complain, and the application runs. I DO get an AV and variant conversion exception though. Here's the VB function definition: Public Declare Function DoReadC Lib "api.dll" (ByVal DataPath As String, ByVal BufferLen As Integer, Buffer As Any, ReturnLen As Integer) As Integer ...and the associated prototype in my header: extern "C"{ __declspec(dllimport) int DoReadC(char *DataPath, int BufSize, Variant *Buf, int *RetSize); } ...then I do something like this in the code: void __fastcall TfMain::OnShow(TObject *Sender) { int Status; int ByteCount; Variant DblVal; Status = DoReadC("/DataPath", sizeof(double), &DblVal, &ByteCount); } Am I totally messed up here? I don't know exactly what the VB code means, so I don't know what the function prototype should be. Any help would be greatly appreciated! -Terry |