Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
1 registered members (Grant), 999 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Using FreeImage DLL in proper way #424451
06/16/13 14:56
06/16/13 14:56
Joined: Sep 2009
Posts: 987
Budapest
Aku_Aku Offline OP
User
Aku_Aku  Offline OP
User

Joined: Sep 2009
Posts: 987
Budapest
Hi, i am totally new to using dlls in lite-c. I read the manual but i am still confused.
I ask the help of the community, how should use the FreeImage dll in my lite-c project to properly open an image file.
Here is the link what i have got: FreeImage
Thanks in advance.

Re: Using FreeImage DLL in proper way [Re: Aku_Aku] #424452
06/16/13 15:02
06/16/13 15:02
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline
Serious User
PadMalcom  Offline
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
Hi, you can't use a DLL in Lite-C as long as it doesn't export functions in the expected way. What you can do is to write a wrapper DLL that uses the functions from FreeImage.

Some weeks ago I finished a Gamestudio DLL to use cImg with BMAP*. It is part of TUST so you can easily have a look at the source code:

https://github.com/MasterQ32/TUST/tree/master/Library%20Source/ProceduralGS

Re: Using FreeImage DLL in proper way [Re: PadMalcom] #424453
06/16/13 15:07
06/16/13 15:07
Joined: Sep 2009
Posts: 987
Budapest
Aku_Aku Offline OP
User
Aku_Aku  Offline OP
User

Joined: Sep 2009
Posts: 987
Budapest
Thanks PadMalcolm. I'll see your link.
Where can i find the exact description of that "expected way"?

Edit:
This topic was a little bit detoured to this direction: is a dll eligible to serve lite-c calls.
Now back to the original problem. I assume this dll is ok.
How should i use in my lite-c program?

Last edited by Aku_Aku; 06/16/13 15:16.
Re: Using FreeImage DLL in proper way [Re: PadMalcom] #424455
06/16/13 15:40
06/16/13 15:40
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Originally Posted By: PadMalcom
Hi, you can't use a DLL in Lite-C as long as it doesn't export functions in the expected way.

That's not actually true. The biggest problem is that the Lite-C compiler doesn't create a proper IAT, so the runtime link editor won't do any work for you. However, you can do that manually via LoadLibrary and GetProcAddress.

Since we are linking to GitHub projects, here is an example of do something like that: https://github.com/JustSid/Lite-C/tree/master/Bulldozer. Specifically everything starting here


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Using FreeImage DLL in proper way [Re: WretchedSid] #424458
06/16/13 16:00
06/16/13 16:00
Joined: Sep 2009
Posts: 987
Budapest
Aku_Aku Offline OP
User
Aku_Aku  Offline OP
User

Joined: Sep 2009
Posts: 987
Budapest
What is about this?
It seems to really simple. No hocus-pocus...
Why should not i use this way?
From the Manual
Code:
void WINAPI myFunction(int i); // declare function prototypeAPI(Test,myDLL)

function main()
{
   myFunction(777); // call the DLL function
}


Re: Using FreeImage DLL in proper way [Re: WretchedSid] #427963
08/15/13 20:08
08/15/13 20:08
Joined: Sep 2009
Posts: 987
Budapest
Aku_Aku Offline OP
User
Aku_Aku  Offline OP
User

Joined: Sep 2009
Posts: 987
Budapest
How should i handle when a function gives back something, maybe a boolean value?


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1