From: <cod...@ho...> - 2004-03-30 15:10:10
|
Just to be clear, all of that is only true when mixing compilers, and generally if both the application and DLL are built using MinGW then it will work, i.e. exporting classes, exceptions crossing DLL boundaries, basic memory allocation, etc. Luke ----- Original Message ----- Wrom: REXCAXZOWCONEUQZAAFXISHJEXXIMQZUIVOTQNQEMSFDUL To: <min...@li...> Sent: Tuesday, March 30, 2004 9:37 PM Subject: Re: [Mingw-users] Re: Using MinGW DLLs with BCB. > Hi, > > Structs and enums are usable across a DLL interface, but namespaces, > templates and classes are not. Namespaces get ignored. Not sure what > happens to templates or classes. You may find Microsoft documentation > that says you can export classes, but this is only true for apps+DLLs > compiled with the M$ compiler. > > Similarly, exceptions cannot cross the DLL interface. > > Important: If you are passing data by pointer then be aware that your > memory must be allocated on the same side of the DLL interface. Ie, > either in the DLL, OR within your application that is calling your DLL > you cannot create memory in your app then destroy it in your DLL, or > vice versa. If you're lucky it might work, but most likely you will > receive confusing errors. > > Apart from that, it doesn't matter what toolset you use to compile your > DLL. > > w.r.t your original question, remember that std::string has the member > function c_str(), so you can still use std::strings when you call your > function. For example, instead of doing this: > myFunction( myString ); > > just do this: > myFunction( myString.c_str() ); > > Hope this has helped! :-) > > Why can't anything be simple with windows?!... ;-) > > Cheers, J. > > John Adamson. > Vehicle Dynamics Engineer. > Renault F1 > Enstone, Oxfordshire, OX7 4EE > Tel. +44 (0)1608 678000 > Mobile: +44 (0)7818 471 543 > |