Board index » cppbuilder » Using BCB6 Dll in VB
Jan
CBuilder Developer |
Using BCB6 Dll in VB2004-06-11 09:45:55 PM cppbuilder110 Hi, I have made this testdll witch should run in my own BCB6 application and inVB. extern "C" void __export __pascal TestDll2 (char *file) { int i, x, y = 0; String S; String Message; TStringList *TempList = new TStringList(); S = file; TempList->LoadFromFile(S); x = TempList->Count; for (i=0; i<x; i++) { y += TempList->Strings[i].Length(); } Message = "The file"; Message += S; Message += " has "; Message += y; Message += " characters"; MessageDlg(Message, mtInformation, TMsgDlgButtons() << mbOK,0); } 1) It runs well in my application, but what do I have to change that it runs in VB? 2) The 'pascal' calling convention should be the most universal calling method used by WIN 32API functions? 3) I suppose I have to set also Project/Options/Advanced Compiler/Calling convention to 'pascal'? 4) If I built this dll with 'Use Dynamic RTL' UNchecked, it's OK. But if I also have 'Build with Runtime Packages' UNchecked, I get: [Linker Error] Unresolved external '__fastcall Dialogs::MessageDlg(const System::AnsiString, Dialogs::TMsgDlgType, System::Set<Dialogs::TMsgDlgBtn, 0, 10>, int)' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\PROJECTS\TESTDLL2\TESTDLL2.OBJ 5) And last, where can I find some info of how to implement my dll in VB. Thankyou very much, Jan Vandyck |