News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Forwarding functions in dll

Started by cbhte, January 15, 2011, 03:02:20 AM

Previous topic - Next topic

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:
#include <MyOldDll.h>

void __declspec(dllexport) FuncA();


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:
#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
}


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.