Allocating memory in D shared library when accessed from C++
Martin Drašar
drasar at ics.muni.cz
Mon Dec 19 13:50:48 PST 2011
Dne 19.12.2011 19:39, Simon napsal(a):
> On 19/12/2011 18:01, Andrej Mitrovic wrote:
>> Check if GetProcAddress returns null? It seems to me you're looking
>> for _magicFunction but defining magicNumber, two different names.
>
> that's be it. can't remember the rules for whether it will have a
> leading underscore, but you can always use dependency walker to find out:
>
> http://dependencywalker.com/
>
Hi guys,
thanks for your response... but it is not the problem. I must have made
a mistake writing this down.
It actualy returns a procedure address and the procedure is called. It
lands inside export extern (C) int magicNumber() and crashes when
attempting to allocate memory for Something.
I have used dependency walker, that is why I asked why only the first
function is exported with underscore and the others are not.
Martin
More information about the Digitalmars-d-learn
mailing list