Skip to content
Low-level programming · Higher-level thinking
Login Register
Forum / Source Help

import undecorated c++ function

A community discussion post from the original code:zIRON forum.

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

import undecorated c++ function

Hi Mr Colin.

how to import undecorated c++ function that in DLL library and use it with Ziron?

http://www.freewebs.com/ogremagic/index.htm

Replies

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

for example , this give error

imports('DBProSetupDebug.dll') 
{
  function constructor = ?Constructor@@YA_NXZ(): boolean; cdecl; 
}

btw , can not use extern "C" because there are overloaded functions in dll library.

http://www.freewebs.com/ogremagic/index.htm

Colin admin
Posts
928
Threads
49
Location
Bulgaria

Hi Emil, sorry i've not been around to fix some of the issues, however in the latest update i've added hopefully a solution.

imports('DBProSetupDebug.dll') 
{
  function constructor = '?Constructor@@YA_NXZ'(): boolean; cdecl; 
}
Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

thanks,

what about a function with arguments (function parameters)

http://www.freewebs.com/ogremagic/index.htm

Colin admin
Posts
928
Threads
49
Location
Bulgaria
imports('DBProSetupDebug.dll') 
{
  function constructor = '?Constructor@@YA_NXZ'(DWord param1): boolean; cdecl; 
}

?

ps. Welcome back :)

Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

thanks,

have problem with this declaration

function  SetWindowTitle = '?SetWindowTitle@@YAXK@Z'(DWord param1):int32; cdecl; 
Expected ) but found param1 in [testprg.zir] Code: function SetWindowTitle = '?SetWindowTitle@@YAXK@Z'(DWord param1):int32; cdecl;

i think ziron refuse any parameters.

http://www.freewebs.com/ogremagic/index.htm

Colin admin
Posts
928
Threads
49
Location
Bulgaria

OK, try download the beta package and change your mangled name to be parenthesised

imports('DBProSetupDebug.dll') 
{
  function constructor = ('?Constructor@@YA_NXZ')(DWord param1): int32; cdecl; 
}
Emil_halim member
Posts
639
Threads
104
Location
Alex, Egypt

still have the same error

Expected identifier or constant string but found ( in [testprg.zir] Code: function SetWindowTitle = ('?SetWindowTitle@@YAXK@Z')(char* Titel):int32; cdecl;

http://www.freewebs.com/ogremagic/index.htm