Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (AndrewAMD, Ayumi, NewbieZorro), 14,141 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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