Is it possible to build dll or lib with dmc to use it in program
builded in microsoft c++ compiler?
On 13 May 2012 22:07, crashtua wrote:
> Is it possible to build dll or lib with dmc to use it in program builded
> in microsoft c++ compiler?
>
Using GDC you can produce libs that VC will attempt to link, it's not so
simple though, the different CRT makes for plenty of incompatibilities, you
hav
On Sunday, 13 May 2012 at 19:07:41 UTC, crashtua wrote:
Is it possible to build dll or lib with dmc to use it in
program builded in microsoft c++ compiler?
Yes you can download Visual D, build a D DLL with DMD, and call
it from a Visual C++ program. Unfortunately you have to use C to
commun
And how to load that dll? I have dll:
module dllmain;
import std.c.windows.windows;
import core.sys.windows.dll;
__gshared HINSTANCE g_hInst;
extern (Windows)
BOOL DllMain(HINSTANCE hInstance, ULONG ulReason, LPVOID
pvReserved)
{
final switch (ulReason)
{
case DLL_PROCESS_ATTACH:
HINSTANCE LoadME;
LoadME = LoadLibrary(L"C:\\Users\\CrashTUA\\Documents\\visual
studio
2010\\Projects\\DynamicLib1\\DynamicLib1\\Release\\DynamicLib1.dll");
func dllprintt;
dllprintt = (func)GetProcAddress(LoadME,"trololo");
int i = dllprintt();
return
On 5/14/2012 5:44 AM, crashtua wrote:
And how to load that dll? I have dll:
module dllmain;
import std.c.windows.windows;
import core.sys.windows.dll;
__gshared HINSTANCE g_hInst;
extern (Windows)
BOOL DllMain(HINSTANCE hInstance, ULONG ulReason, LPVOID pvReserved)
{
final switch (ulReason)
{
c
On 14 May 2012 09:16, Rainer Schuetze wrote:
> Than try to load it:
>> HINSTANCE LoadME;
>> LoadME = LoadLibrary(L"C:\\Users\\**CrashTUA\\Documents\\visual studio
>> 2010\\Projects\\DynamicLib1\\**DynamicLib1\\Release\\**DynamicLib1.dll");
>> func dllprintt;
>> dllprintt = (func)GetProcAddress(Lo
LoadLibrary returns 10(maybe wrong number of zeros,i dont
remember exactly:)). And GetProcAddress returns 0, so dllprintt
fails:(
So, thanks to all. It works after adding 'export' keyword and '_'
symbol before function name.
But it is something strange, one function need '_' and another
dont:(
In D dll i have:
extern (C) int function() f;
alias typeof(f) myfunc;
export extern (C) int retten()
{
return 10;
}
export extern (C) void setf(myfunc ff)
{
f=ff;
}
export extern (C) int ret()
{
return
Dne 14.5.2012 19:59, crashtua napsal(a):
But it is something strange, one function need '_' and another dont:(
In D dll i have:
extern (C) int function() f;
alias typeof(f) myfunc;
export extern (C) int retten()
{
return 10;
}
export extern (C) void setf(myfunc ff)
{
f=ff;
}
export extern (C) i
On 5/14/2012 7:59 PM, crashtua wrote:
But it is something strange, one function need '_' and another dont:(
In D dll i have:
extern (C) int function() f;
alias typeof(f) myfunc;
export extern (C) int retten()
{
return 10;
}
export extern (C) void setf(myfunc ff)
{
f=ff;
}
export extern (C) in
12 matches
Mail list logo