User forums > Embedded development

Forwarding functions in dll

(1/1)

cbhte:
Hey all,

I got a problem with CB, because I don't now how CB handles it:

I have a function FuncA defined in MyOldDll.h, which I included in a new dll-project.
Now I want to export this FuncA out of the MyOldDll.h. First I tried:

--- Code: ---#include <MyOldDll.h>

void __declspec(dllexport) FuncA();
--- End code ---

But when I compile it, there is no exported function (controlled with DependencyWalker). I noticed that I have to implement FuncA, but it is already implemented in the old lib, which I linked to my new dll!

In MSVC I could use the .def-file and write EXPORT FuncA = MyOldDll.FuncA
But how can I handle it in CB? It is important that I can reimplement some functions. e.g.: FuncB (which was already there in MyOldDll), but in this dll FuncB does something new and then (to keep it downward compatible) call FuncB:

--- Code: ---#include <MyOldDll.h>

void __declspec(dllexport) FuncA();    // it should call FuncA in MyOldDll
void __declspec(dllexport) FuncB();    // new implementation...

void __declspec(dllexport) FuncB()
{
  DoSomethingNewHere();
  FuncB();  // call FuncB in MyOldDll
}
--- End code ---

I really hope you can help me solving this problem, I have to do it this way and not implementing all functions again :-(
thank you
 cbhte

Jenna:
This question is not releted to C::B.

C::B is "just" an IDE, that works with many compilers and not a compiler.

Please ask this question in a forum related to the comiler you use, or search the internet with your favourite search engine.

Navigation

[0] Message Index

Go to full version