Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / Global variables in a dll.

Author
Message
coolgames
19
Years of Service
User Offline
Joined: 26th Sep 2005
Location: Oregon, USA
Posted: 9th May 2006 01:12
I've figured out how to use dev-c++ to make a dll for darkbasic. I have a question, how could I make somthing that everytime a call a function, it increases a variable within the dll by 1. I can't figure it out. I'm programming in c.

CattleRustler
Retired Moderator
22
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 9th May 2006 15:51
you need to declare the variable to be some sort of global and persisted in the dll, not sure how to do that in c. but it works in other languages for dbp dlls (C++,vb.net,vb6,c#, etc)

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 9th May 2006 15:54
Simple - You declare your variable outside of all functions.

For free Plug-ins and source code http://www.matrix1.demon.co.uk
coolgames
19
Years of Service
User Offline
Joined: 26th Sep 2005
Location: Oregon, USA
Posted: 9th May 2006 16:29
Thanks a lot. It works now!

Login to post a reply

Server time is: 2025-08-08 17:27:39
Your offset time is: 2025-08-08 17:27:39