Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Quad, 1 invisible), 721 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Lite-C A8 and Mysql Connection. How? [Re: WretchedSid] #401936
05/26/12 16:25
05/26/12 16:25
Joined: Nov 2007
Posts: 318
Brasil, Paraná
NeoNeper Offline OP
Senior Member
NeoNeper  Offline OP
Senior Member

Joined: Nov 2007
Posts: 318
Brasil, Paraná
Hi guys! tongue
Quote:

There is. You can use the MySQL dll directly (be sure to know about the licensing issues) and use the LoadLibrary() and GetProcAddress() WinAPI functions for dynamically loading the library and the exported functions.
Or you use HTTPS(!) and connect to your webservice which then does the needed transactions (which is preferred for the already a hundred times mentioned security issues)


I decided to use directly the dll of the mysql library such as "JustSid" said!
But now I am experiencing great difficulty with the enguine.
Because I can not resolve an error: "Script Crash in Main"

The Code works with sucess!
The DLL is loaded successfully, but I tried in every way I know and I can not make it load the DLL without generating this error!

According to my script attached, the error message occurs when I run the "mysql_init ();". because if I erase this line of code, it runs normally without the error message.

This script is one of the minimized version, but as I said earlier is working, and run the DLL with sucess. But not I make it work without the error message.

Somebody can help me?

Code:
#include <acknex.h>
#include <default.c>
#include <windows.h>

long WINAPI mysql_init();

function main()
{
	
HINSTANCE h = LoadLibrary("libmysql.dll");
mysql_init = GetProcAddress(h,"mysql_init");
if (h != NULL) {
	//Running
	mysql_init();
	
}
}






Last edited by NeoNeper; 05/26/12 16:28.

Please! Use easy words to be translated. because my English is not very good! Grateful.
_______________________________________________________
Re: Lite-C A8 and Mysql Connection. How? [Re: NeoNeper] #401937
05/26/12 16:42
05/26/12 16:42
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Code:
long WINAPI mysql_init();



Thats hardly how the signature of the function looks like wink
Also, your check if h isn't NULL is too late there and no guarantee if mysql_init is not NULL.

And another note: Are you sure that you understand the security and licensing issues here? Lite-C isn't GPL compatible, so you either have to pay for MySQL or you simply can't use it without fearing legal consequences!

Last edited by JustSid; 05/26/12 16:44.

Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Lite-C A8 and Mysql Connection. How? [Re: WretchedSid] #401938
05/26/12 16:58
05/26/12 16:58
Joined: Nov 2007
Posts: 318
Brasil, Paraná
NeoNeper Offline OP
Senior Member
NeoNeper  Offline OP
Senior Member

Joined: Nov 2007
Posts: 318
Brasil, Paraná
Hi JustSid

First I need to make it work. After i look formal questions!.

Could you show me an example of how I load the DLL without this error message?

As I said earlier, this code that i showed was just an example minimized.
because I tried several other ways, and all return the same error.

I have another script I Connecto me with mysql, but the error persists.


Please! Use easy words to be translated. because my English is not very good! Grateful.
_______________________________________________________
Re: Lite-C A8 and Mysql Connection. How? [Re: NeoNeper] #401939
05/26/12 18:21
05/26/12 18:21
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Like I said, the signature of your mysql_init() message doesn't match the ones provided by the library and thus it fails when you invoke it, as the mysql_init() message expects a parameter and thus takes something from the stack which it shouldn't and tries to work with it.

And those weren't formal question, when you got your ass sued away because you "just wanted it to work", you might think again about our warnings. Same if your server is suddenly empty.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Lite-C A8 and Mysql Connection. How? [Re: WretchedSid] #402007
05/28/12 18:44
05/28/12 18:44
Joined: Nov 2007
Posts: 318
Brasil, Paraná
NeoNeper Offline OP
Senior Member
NeoNeper  Offline OP
Senior Member

Joined: Nov 2007
Posts: 318
Brasil, Paraná
EDIT: (^.^)

I still can not

Last edited by NeoNeper; 05/28/12 19:00.

Please! Use easy words to be translated. because my English is not very good! Grateful.
_______________________________________________________
Re: Lite-C A8 and Mysql Connection. How? [Re: NeoNeper] #402098
05/30/12 02:26
05/30/12 02:26
Joined: Nov 2007
Posts: 318
Brasil, Paraná
NeoNeper Offline OP
Senior Member
NeoNeper  Offline OP
Senior Member

Joined: Nov 2007
Posts: 318
Brasil, Paraná
Hello Friends,.
seeing the difficulty of working directly using the "libmysql.dll" on enguine, I decided to create my own DLL of the conxão with Mysql.
Now it is working OK.

Download for Test:
LiteC_ Connector_Mysql

Files on Zip:
> libmysql.dll
> mysql_v0.1.dll
> litec_connector_ot.c

Function:

Initialize.
Connect
Return Collation type
Close Connection


Currently implemented only the basic functions to initialize, connect, return collation and close connection.

Could please test and tell me occasional mistakes?

I'm waiting. Tankx Guuuyyyyssss!

Moderator! Plz move the POST for LiteC Programing?


Last edited by NeoNeper; 05/30/12 03:08.

Please! Use easy words to be translated. because my English is not very good! Grateful.
_______________________________________________________
Re: Lite-C A8 and Mysql Connection. How? [Re: NeoNeper] #402251
06/01/12 08:17
06/01/12 08:17
Joined: Oct 2005
Posts: 57
P
picoder Offline
Junior Member
picoder  Offline
Junior Member
P

Joined: Oct 2005
Posts: 57
It works great for me.
Keep on the good work!

Re: Lite-C A8 and Mysql Connection. How? [Re: picoder] #402271
06/01/12 12:57
06/01/12 12:57
Joined: Nov 2007
Posts: 318
Brasil, Paraná
NeoNeper Offline OP
Senior Member
NeoNeper  Offline OP
Senior Member

Joined: Nov 2007
Posts: 318
Brasil, Paraná
Taanks Picoder (^.~)

I finishing implement the functions of research and modifying the database.
I'll post an update soon.


Please! Use easy words to be translated. because my English is not very good! Grateful.
_______________________________________________________
Re: Lite-C A8 and Mysql Connection. How? [Re: NeoNeper] #403354
06/18/12 18:29
06/18/12 18:29
Joined: Nov 2007
Posts: 318
Brasil, Paraná
NeoNeper Offline OP
Senior Member
NeoNeper  Offline OP
Senior Member

Joined: Nov 2007
Posts: 318
Brasil, Paraná
Hi Friends.
I posted the update of the Litec Mysql Connector for MySQL 5.5 + and 3dGameStudio A8.

No longer a simple test.
Now you can work with it, and manipulate tables mysql successfully!

Hope you enjoy:
The download and documentation can be viewed in the "Contributions" Topics Forum!

A8 LiteC Mysql Connector v.1


Please! Use easy words to be translated. because my English is not very good! Grateful.
_______________________________________________________
Page 2 of 2 1 2

Moderated by  aztec, Blink, HeelX 

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