PDA

View Full Version : Bubbles-Particle-Infection



peter
10-06-2013, 23:39
Hello, is summer.

ReneMiner
11-06-2013, 00:05
peter, I tried - because I'm nosy - but it only shows 2 or 3 times the same messagebox, caption O2H, text: ttf.dll (see image)
thereafter it halts because it can not find the ss.dll - but I saved the testfile next to the content of the downloaded folder as you can see in thinAir-explorer on my screenshot and I think that's the way I did with all your examples and they always worked that way. ss.dll is for sure inside the same folder as all the other files - What did I do wrong?

And, while reading through your sdl.inc I get confused about lines 50 and 52
50: Is it really FileExits or should it be FileExists?
52: SDL_SaveBytes Alias "SaceBytes" a typo or purpose?

peter
11-06-2013, 01:27
Hi Rene,

The error message means: I cannot find the sdl.inc !
Put the sdl.inc together with the source code in a directory. Don't forget the other dll's.

I have all in my ThinBasic directory.

ReneMiner
11-06-2013, 09:16
Hab ich doch- it's ALL in one folder. That's what mich so wundert :confused:
If you read the Error-message you'd see that it occured in SDL.INC, Line 3, Declare SDL_Window... so it's loaded and about to start but tells it can not find ss.dll - wobei that in the folder is. I also moved the whole sdl-folder into my c:\thinBasic-folder, same result. 3 times O2H-messagebox, then crash at line 3 of sdl.inc

peter
11-06-2013, 11:09
Hi Rene,

Just start bubbles.tbasic. Do not move something out of this directory into another directory.

Rene, Du muss alle Dateien zusammenhalten, Ich denke, dass Du die "sdl.inc" in das ThinBasic Verzeichnis " INC" legst, aber das ist falsch!

Ich habe noch die alte stabile ThinBasic Version 1.8.0.9 oder so.

ReneMiner
11-06-2013, 11:23
I did- started from this folder- same result :(

Somehow does not find the .dll - but it is there!

I use tB-Version 1.9.7.0 - and it does not work :unguee:

Someone else similar problems?

ErosOlmi
11-06-2013, 12:53
Same problem here.
For some reason LoadLibrary is failing.
I will test this night when back home and see what error is the operating system returning.

peter
11-06-2013, 13:21
Good idea Eros!
It looks like this here:

ErosOlmi
11-06-2013, 21:53
Peter,

can you please provide DLLs without message box inside?

Thanks
Eros

peter
11-06-2013, 23:29
Okay Eros,

ErosOlmi
12-06-2013, 07:22
I still can see message boxes with those dlls.


Anyway, I think the problem why thinBasic says it cannot find the DLL is because ss.dll loads other dlls but using standard window way in searching needed dll and Windows is not able to find those dll even if they are in the same directory due to the method used by the operating system when it search for dlls.

thinBasic uses many ways to find needed DLL, all the one listed in Declare help: http://www.thinbasic.com/public/products/thinBasic/help/html/index.html?declare.htm
But when the loaded DLL needs another DLL, it uses the classical Windows way that are described into LoadLibrary function: http://msdn.microsoft.com/en-us/library/windows/desktop/ms684175(v=vs.85).aspx
In this case thinBasic gets back an error because Windows is not able to find the secondary needed dll.

I think SS.DLL needs SDL_ttf.dll and SDL_ttf.dll needs sdl.dll creating a dependency

The problem can be seen also opening any of those dlls using "Dependency walker" http://www.dependencywalker.com/

There are some ways to solve the problem:

put all dll in the same directory of the main executable (thinBasic.exe). But this is not good
put all dll in \windows\system32\ directory. But this is not good
create bundled thinBasic scripts because in this case thinBasic.exe executable and dll are all into the same directory. But for an interpreter this is not always the case
create atomic dlls, that is dlls that does not need any other dll (other that the operating system ones). Creating atomic dlls is always a good choice.


Ciao
Eros

ErosOlmi
12-06-2013, 08:50
Usually the so called "DLL Hell" is created by the developers of the dll and not by the operating system.

There are some rules to follow plus some good programming practices.

thinBasic is composed by one executable and tens of dlls but you will never have problems because: there are some rules to follow and all thinBasic dlls are atomic (that is every dll never calls function inside other dlls creating cross dependencies but only internal functions and/or functions exported by native operating system dlls)

That is the reason why many well known library are quite big: they needs to be atomic without any cross dependencies.

Anyway, I always follow these rules:
If I develop a dll for myself and for my application only, no problem, I can do whatever I want;
If I develop dlls to be distributed and used by others, always create atomic dlls without any cross dependencies between dlls.

Ciao
Eros




Sent from my iPhone using Tapatalk

peter
12-06-2013, 12:41
Hi Eros,

Is okay, I give up now.