Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 03/06/26 07:18
zorro with ccxt?
by opm. 03/03/26 03:17
WFO Training with parallel cores Zorro64
by Martin_HH. 02/26/26 16:03
Zorro version 3.0 prerelease!
by TipmyPip. 02/25/26 16:38
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
4 registered members (TipmyPip, alibaba, the1, 1 invisible), 5,206 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
the1, alx, ApprenticeInMuc, PatrickH90, USER0328
19200 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Acknex Crash (3DGS 8.30.5) #390299
12/26/11 13:47
12/26/11 13:47
Joined: Dec 2011
Posts: 15
Germany
W
Waldnebel Offline OP
Newbie
Waldnebel  Offline OP
Newbie
W

Joined: Dec 2011
Posts: 15
Germany
Hello together,

I have the problem that Acknex it keeps crashing on my script.
The fact is however that the MySQL insert is executed. The line is entered, but immediately afterwards Acknex crashes.
Here is the error code:

Problemsignatur:
Problemereignisname: BEX
Anwendungsname: acknex.exe
Anwendungsversion: 0.0.0.0
Anwendungszeitstempel: 4c1231af
Fehlermodulname: acknex.dll
Fehlermodulversion: 8.3.0.5
Fehlermodulzeitstempel: 4eb13df9
Ausnahmeoffset: 00182c8c
Ausnahmecode: c0000409
Ausnahmedaten: 00000000
Betriebsystemversion: 6.1.7600.2.0.0.768.3
Gebietsschema-ID: 1031
Zusatzinformation 1: 019f
Zusatzinformation 2: 019f0fb0f49029b6b11d19337fe05523
Zusatzinformation 3: 939a
Zusatzinformation 4: 939a6e019afc7c038880dadbb56c3d15

The Script:

Code:
#include <acknex.h>
#include <windows.h>
#include <default.c>
// Dummy prototypes
void *mysql_init(void *foo);
void *mysql_real_connect(void *mysql, const char *host, const char *user, const char *passwd, const char *db, unsigned int port, const char *unix_socket, unsigned long client_flag);
void *mysql_query(void *mysql, const char *q);
void *mysql_num_rows(void *res);
void *mysql_close(void *mysql);
STRING* mysql_error(void *mysql);
BMAP* cursor_pcx = "cursor.pcx";

void main()
{
	
	///////////////////////////LADE LIBYSQL.DLL /////////////////////////////////////
	HINSTANCE dllHandle = LoadLibrary("libmysql.dll");
	if (dllHandle != NULL) 
	{ 

		/////////////////////////GET MYSQL INIT ///////////////////////////////////////
		mysql_error = GetProcAddress(dllHandle, "mysql_error");
		mysql_init = GetProcAddress(dllHandle, "mysql_init");
		if (NULL == mysql_init) 
		{
   		printf("Konnte Function mysql_init nicht laden!");
		}

		/////////////////////////GET MYSQL REAL CONNECT ///////////////////////////////
		mysql_real_connect = GetProcAddress(dllHandle, "mysql_real_connect");
		if (NULL == mysql_real_connect) 
		{
			printf("Konnte Function mysql_real_connect nicht laden!");
		}
		
		/////////////////////////GET MYSQL QUERY//////////////////////////////////////
		mysql_query = GetProcAddress(dllHandle, "mysql_query");
		if (NULL == mysql_query) 
		{
			printf("Konnte Function mysql_query nicht laden!");
		}
		
		//////////////////////////GET MYSQL NUM ROWS //////////////////////////////////		
		mysql_num_rows = GetProcAddress(dllHandle, "mysql_num_rows");
		if (NULL == mysql_num_rows) 
		{
			printf("Konnte Function mysql_num_rows nicht laden!");
		}
		//////////////////////////GET MYSQL CLOSE //////////////////////////////////		
		mysql_close = GetProcAddress(dllHandle, "mysql_close");
		if (NULL == mysql_num_rows) 
		{
			printf("Konnte Function mysql_close nicht laden!");
		}
	}	else	{
		printf("Konnte libmysql.dll nicht laden!");
	}


	/////////////////////////////Testabfrage//////////////////////////////////////
	if (mysql_init != NULL && mysql_real_connect != NULL && mysql_query != NULL && mysql_num_rows != NULL) // Konnten alle Funktionen gelinkt werden?
	{
		void *mysql = mysql_init(NULL); // MySQL Inizialisierung
		if(!mysql) // Konnte Initialisiert werden?
		{
			printf("MySQL Initialization Failed");
		} else {
			void *mysql = mysql_real_connect(mysql, "localhost", "root", "", "cdcol", 3306, NULL, 0); // Baue Verbindung zum MySQL Server auf
			if(!mysql) // Konnte verbunden werden?
			{
				printf("Connection Failed!");
			} else {
//				const char abfrage; // Erstelle const Char für die Abfrage
//				str_cpy(abfrage, "select * from cds"); // Kopiere die Abfrage in die vordefinierte Const Char
				void *res = mysql_query(mysql, "INSERT INTO cds (titel, interpret, jahr) VALUES ('Nightwish', 'muh', '999');"); // führe Abfrage aus
				STRING *Errortext =mysql_error (res);
				if(!res) // Konnte Abfrage ausgeführt werden?
				{
					printf(Errortext);
				//	mysql_close(mysql);
				}	else {
					void *numrows = mysql_num_rows(res); //Zeige anzahl Reihen
					if(!numrows) // Konnten die Reihen gezählt werden?
					{
						printf("Get numrows Failed!");
					} else {
						printf("test"); // Gebe Reihen aus
					}
					
				}
			}
		}
	}
 

 video_screen = 2; // start window mode
	video_mode =8;
	screen_color.blue = 150;
	mouse_mode = 4; // show the mouse pointer
	mouse_map = cursor_pcx; // set the mouse pointer bitmap

	while (1)
	{
		mouse_pos.x = mouse_cursor.x; // allow the mouse pointer to move
		mouse_pos.y = mouse_cursor.y; // on the x and y axis

		
		wait (1);

	}



}



acklog.txt:

Log of A8 Engine 8.30.5 run at Mon Dec 26 14:31:14 2011
Waldnebel on Windows NT/2000/XP version 6.1 Build 7600
Options -diag
App: J:\Projekt X\Game Daten\Start\testx.cd\testx.exe in J:\Projekt X\Game Daten\Start\testx.cd\
Author: (Name replaced wink )

MM mixer opened
DSOUND device opened
DI interface opened
Start Window opened(c) Conitec - www.3dgamestudio.com
A8 Engine - Commercial Edition V8.30.5 - Nov 2 2011
Linking J:\Projekt X\Game Daten\Start\testx.cd\testx.exe...

Mouse found
Kopfhörer (3- Microsoft LifeChat LX-3000 ) opened
ATI Radeon HD 5450 pure T&L device 1ff9 detected
D3D device ATI Radeon HD 5450 1ff9 selected.
mysql_close: function not found
mysql_error: function not found
mysql_init: function not found
mysql_num_rows: function not found
mysql_query: function not found
mysql_real_connect: function not found
pX_stats: function not found.
Running TESTX.EXE.
Main started at 1.267

Anyone a Idea?

I tried to deaktivate the Firewall and Virusscan. Didnt work.

Thx a lot...
Waldnebel

Re: Acknex Crash (3DGS 8.30.5) [Re: Waldnebel] #390300
12/26/11 13:51
12/26/11 13:51
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Is the mysql dll in your testx.cd folder?


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Acknex Crash (3DGS 8.30.5) [Re: Superku] #390301
12/26/11 14:08
12/26/11 14:08
Joined: Dec 2011
Posts: 15
Germany
W
Waldnebel Offline OP
Newbie
Waldnebel  Offline OP
Newbie
W

Joined: Dec 2011
Posts: 15
Germany
Yes it is... How i sad: the Insert works...

Re: Acknex Crash (3DGS 8.30.5) [Re: Waldnebel] #390307
12/26/11 18:35
12/26/11 18:35
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
How is this supposed to work? mysql_error() doesn't return a STRING object and printf() still expects a const char format string as first argument!
Code:
STRING *Errortext =mysql_error (res);
				if(!res)
				{
					printf(Errortext);
                                 }



Beside that, don't try to evaluate a third party string with printf!


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Acknex Crash (3DGS 8.30.5) [Re: WretchedSid] #390308
12/26/11 19:15
12/26/11 19:15
Joined: Dec 2011
Posts: 15
Germany
W
Waldnebel Offline OP
Newbie
Waldnebel  Offline OP
Newbie
W

Joined: Dec 2011
Posts: 15
Germany
Tried to remove that too, but didn't work too.
It bring only a empty Box.


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