Click here to Skip to main content
15,923,087 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionLNK2001 error Pin
QuickDeveloper2-Dec-05 18:20
QuickDeveloper2-Dec-05 18:20 
Answerwarning LNK4098 Pin
sunit52-Dec-05 18:49
sunit52-Dec-05 18:49 
Questionhow to display a transparent gif picture Pin
blackeye20042-Dec-05 15:57
blackeye20042-Dec-05 15:57 
QuestionCan C++ DLL developed with Visual Studio .NET 2003 be used by Delphi, Borland C++ etc Pin
FFKONG2-Dec-05 14:22
FFKONG2-Dec-05 14:22 
AnswerRe: Can C++ DLL developed with Visual Studio .NET 2003 be used by Delphi, Borland C++ etc Pin
Jörgen Sigvardsson2-Dec-05 14:53
Jörgen Sigvardsson2-Dec-05 14:53 
GeneralRe: Can C++ DLL developed with Visual Studio .NET 2003 be used by Delphi, Borland C++ etc Pin
FFKONG2-Dec-05 16:50
FFKONG2-Dec-05 16:50 
GeneralRe: Can C++ DLL developed with Visual Studio .NET 2003 be used by Delphi, Borland C++ etc Pin
Jörgen Sigvardsson2-Dec-05 22:08
Jörgen Sigvardsson2-Dec-05 22:08 
GeneralRe: Can C++ DLL developed with Visual Studio .NET 2003 be used by Delphi, Borland C++ etc Pin
Gary R. Wheeler3-Dec-05 1:47
Gary R. Wheeler3-Dec-05 1:47 
If you wrap your C++ classes in a 'C'-style interface, then Delphi, etc. would be able to use your DLL. Note that you lose the notion of 'classes' then. Here's an example:
// your class:
class MyClass {
public:
  MyClass(int arg1,double arg2);
  ~MyClass();
  void Function1(int arg3);
};
// DLL interface:
extern "C" {
  typedef void *MyClass;
  MyClass *MyClass_constructor(int arg1,double arg2);
  void MyClass_destructor(MyClass *instance);
  void MyClass_Function1(MyClass *instance,int arg3);
};
The DLL interface defines a 'constructor' function that will return a pointer to a MyClass object. The remaining functions take one of those pointers as their first argument. Note that you will need to be careful to explicitly the destructor function, since the user of the DLL is not C++, and doesn't know to call destructors when an object goes out of scope or is deleted.


Software Zen: delete this;
GeneralRe: Can C++ DLL developed with Visual Studio .NET 2003 be used by Delphi, Borland C++ etc Pin
Jörgen Sigvardsson3-Dec-05 9:57
Jörgen Sigvardsson3-Dec-05 9:57 
GeneralRe: Can C++ DLL developed with Visual Studio .NET 2003 be used by Delphi, Borland C++ etc Pin
FFKONG3-Dec-05 13:39
FFKONG3-Dec-05 13:39 
GeneralRe: Can C++ DLL developed with Visual Studio .NET 2003 be used by Delphi, Borland C++ etc Pin
Jörgen Sigvardsson3-Dec-05 14:34
Jörgen Sigvardsson3-Dec-05 14:34 
GeneralRe: Can C++ DLL developed with Visual Studio .NET 2003 be used by Delphi, Borland C++ etc Pin
Gary R. Wheeler4-Dec-05 1:56
Gary R. Wheeler4-Dec-05 1:56 
QuestionSerial Port communication Pin
picazo2-Dec-05 12:58
picazo2-Dec-05 12:58 
AnswerRe: Serial Port communication Pin
Branislav2-Dec-05 23:14
Branislav2-Dec-05 23:14 
GeneralRe: Serial Port communication Pin
picazo3-Dec-05 13:20
picazo3-Dec-05 13:20 
GeneralRe: Serial Port communication Pin
Branislav4-Dec-05 20:37
Branislav4-Dec-05 20:37 
QuestionDialogs and dlls, normal or annoying? (MFC) Pin
T1TAN2-Dec-05 12:58
T1TAN2-Dec-05 12:58 
AnswerRe: Dialogs and dlls, normal or annoying? (MFC) Pin
Roger Allen2-Dec-05 13:27
Roger Allen2-Dec-05 13:27 
GeneralRe: Dialogs and dlls, normal or annoying? (MFC) Pin
T1TAN2-Dec-05 14:01
T1TAN2-Dec-05 14:01 
Questionerror C3861: 'GetEditCtrl': identifier not found Pin
myst4ever2-Dec-05 12:19
myst4ever2-Dec-05 12:19 
AnswerRe: error C3861: 'GetEditCtrl': identifier not found Pin
Gary R. Wheeler3-Dec-05 2:12
Gary R. Wheeler3-Dec-05 2:12 
Questionicons in win32 Pin
pplshero542-Dec-05 9:36
pplshero542-Dec-05 9:36 
AnswerRe: icons in win32 Pin
Gary R. Wheeler3-Dec-05 2:15
Gary R. Wheeler3-Dec-05 2:15 
QuestionCSliderCtrl ? Pin
Jader892-Dec-05 8:51
Jader892-Dec-05 8:51 
GeneralRe: CSliderCtrl ? Pin
Jader892-Dec-05 8:53
Jader892-Dec-05 8:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.