Subj : DLL Hell (how to mix visual and borland dlls) To : borland.public.cpp.borlandcpp From : "Thierry Franzetti" Date : Mon Feb 23 2004 04:04 am Hi there, I'm running into serious issues when using a dll compiled Visual .NET 2003 with BCC 5.5.1 (on WinXP). Here is the include file of my DLL (compiled with .net): #ifdef MXF_TK_EXPORTS #define mxf_tk_API __declspec(dllexport) #else #define mxf_tk_API __declspec(dllimport) #endif class I_file { protected: I_file(); public: virtual ~I_file(); virtual void output_xml(const char*)=0; }; extern "C" mxf_tk_API bool NewFileInterface(I_file**, const char*); I have a pure virtual class "I-file" hiding some of my implementation and a "C" style function to instantiate the class. Using the implib tool from bcc I could get an OMF-like import library from my DLL. On the bcc side here is what my code looks like: int main(int argc, char* argv[]) { I_file* pi_file = NULL; NewFileInterface(&pi_file, argv[1]); pi_file->output_xml(argv[2]); return 0; } When I try to compile and link, it works perfectly fine. Then if I run the exe, NewFileInterface goes fine, then entering output_xml I can effectively run into the correct function but whenever I try to access some the function's parameter (argv[2]) I get a crash. My entire DLL has the same behavior ("C" style functions work perfectly fine while all the member functions of my classes crash whenever they access their parameters. I know this is a tricky one but if anyone around here already compiled Visual dll with Borland bcc I thought he might have a clue on what's going wrong with code! (if that can help, my DLL works fine with Visual 6.0, .net 2003 and .net 2003 even using different runtime libraries). Thanks in advance... Thierry Franzetti .