Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by Zheka. 06/20/24 14:26
Lapsa's very own thread
by rki. 06/19/24 11:27
A simple game ...
by VoroneTZ. 06/18/24 10:50
Face player all the time ...
by bbn1982. 06/18/24 10:25
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 692 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Mino, squik, AemStones, LucasJoshua, Baklazhan
19061 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 | 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