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.

DarkBASIC Professional Discussion / Working with pointers and objects in DLLs

Author
Message
Beavis
23
Years of Service
User Offline
Joined: 15th May 2003
Location: Czech Republic
Posted: 4th Aug 2003 18:01
Hello I try make some DLL for DarkBasic. My problem is this :
I make one function where object is created and pointer to this object is stored into variable. Then I call method which play streaming music. But when my function ends and code return to DBP nothing happen. I tried to make simple app in VC++ where I made this function and called it from main(). All works well when I make object as globals. Can someone help me how to make global object or how to solve this problem?
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 4th Aug 2003 18:55
Any availiable code ?


Logo design by Indi
Its better than a poke in the eye...
Beavis
23
Years of Service
User Offline
Joined: 15th May 2003
Location: Czech Republic
Posted: 5th Aug 2003 09:19
I figured out that all init I can make in LibMain (DLL_ATACH and DLL_DETACH). Today I maybe finish wrapper dll for Audiere.
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 5th Aug 2003 14:57
that won't affect the import/export abilities though

Beavis
23
Years of Service
User Offline
Joined: 15th May 2003
Location: Czech Republic
Posted: 5th Aug 2003 17:20
No, but I need create objects when dll is loaded and keep them in memory until dll is unloaded and now I know how to do this.
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 5th Aug 2003 19:00
you could've just use the global sructure construct/destruct

Beavis
23
Years of Service
User Offline
Joined: 15th May 2003
Location: Czech Republic
Posted: 5th Aug 2003 19:05
yes but I need some initialization code also and I need run it once when DLL is loaded. I have objects as globals but in LibMain I init them.
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 5th Aug 2003 19:38
Stick it in the Constructor function, and not DllMain...


Logo design by Indi
Its better than a poke in the eye...

Login to post a reply

Server time is: 2026-07-23 02:10:38
Your offset time is: 2026-07-23 02:10:38