Gamestudio Links
Zorro Links
Newest Posts
Purchase A8 full licence version
by ukgamer. 08/30/26 14:27
ZorroGPT
by TipmyPip. 08/29/26 06:56
Retrieve optimize() variables order (edited)
by NorbertSz. 08/25/26 13:24
Max Number of Strategies in /Strategy folder
by Martin_HH. 08/17/26 07:54
Pause button for evaluation shell?
by AndrewAMD. 08/13/26 17:16
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 08/10/26 12:46
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 1,333 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Student_64151, Koti
19230 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Strange Error #410894
11/10/12 14:56
11/10/12 14:56
Joined: Nov 2011
Posts: 139
India
Yashas Offline OP
Member
Yashas  Offline OP
Member

Joined: Nov 2011
Posts: 139
India
Code:
int InitilizeApplet(Applet * applet)
{
	if(applet->init) { return error("InitilizeApplet:Applet already initilized."); }
	void * func = applet->Initilize;
	func(); 
	return 0;
}



I get call func_00895 error
func()

What is tat??


Keep smiling laugh
http://translation.babylon.com/ - Translate many languages
Re: Strange Error [Re: Yashas] #410895
11/10/12 15:00
11/10/12 15:00
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
A void pointer is not a function pointer, Lite-Cs type system won't let you make this call unless you explicitly cast it into a function pointer


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Strange Error [Re: WretchedSid] #410949
11/11/12 03:23
11/11/12 03:23
Joined: Nov 2011
Posts: 139
India
Yashas Offline OP
Member
Yashas  Offline OP
Member

Joined: Nov 2011
Posts: 139
India
I want to store a function in a struct that can be assigned to an existing function and then be called.

How do I do tat??


Keep smiling laugh
http://translation.babylon.com/ - Translate many languages
Re: Strange Error [Re: Yashas] #410950
11/11/12 04:04
11/11/12 04:04
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Store the function in a void pointer in the struct.

When you need to call the function first assign it to an appropriate prototype - as JustSid pointed out - and then call that prototype.


Always learn from history, to be sure you make the same mistakes again...
Re: Strange Error [Re: Uhrwerk] #410952
11/11/12 08:22
11/11/12 08:22
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Store the function as string pointer and use the engine function (forgot name atm^^) to call it directly via the stringname.

Re: Strange Error [Re: Ch40zzC0d3r] #410960
11/11/12 12:52
11/11/12 12:52
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
You're talking about engine_getscript? (http://www.conitec.net/beta/engine_getscript.htm) This is actually a pretty bad idea. It's slow and inelegant. And it won't save you assigning the function address to a prototype. Why taking the detour of there is a straight way?


Always learn from history, to be sure you make the same mistakes again...
Re: Strange Error [Re: Uhrwerk] #411106
11/13/12 10:31
11/13/12 10:31
Joined: Nov 2011
Posts: 139
India
Yashas Offline OP
Member
Yashas  Offline OP
Member

Joined: Nov 2011
Posts: 139
India
I don't have a good imaginary skills lyk u all!!
I did function i = (function)app->initiliz....;
i(); did not work.


Just an example will make me understand

Thanks!


Keep smiling laugh
http://translation.babylon.com/ - Translate many languages

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

Gamestudio download | 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