fOSSili
28th October 2002 19:17 UTC
Building APE's with Borland C++ Builder
Hi to all APEr's,
I have several ideas for writing APE's. But I dont have MS Visual C++.
So I tried to convert the tutbox example (from NSDN/WVS) to Borland C++ Builder 6.0. I've done it so far that I can compile without error's (using Tools->Visual C++ Conversion Utility), renamed to .ape and sent to avs\plugins\. But it will not be shown in AVS :down: (But also AVS doesn't crash :up: ).
Has anyone got it working already? Can anyone send me c++ builder example-ape with source code? It would also be helpful to send me a miniminimini.ape in MS VC++ source code for conversion trial (without resource, config-screen-stuff, etc.)?
I hope you can help me, because I WANT to make it run.
Thank you everybody,
Andreas
PS: you can find the converted tutbox project attached
UnConeD
28th October 2002 21:10 UTC
Sorry, no Borland here. Make sure you export the AVS_APE_Retr (or something like that) function.
fOSSili
28th October 2002 23:08 UTC
Hmmm,
I looked into the export definition and found extern "C" __declspec (dllexport) int _AVS_APE_RetrFunc(...). That makes me wondering, because you (thanks UnConeD) mentioned AVS_APE_RetrFunc(). Removing preceding "_" fixes the loading problem, so that I can see the plugin under +->Tutorials->Box v1.0 now.
But when I select it, it crashes Winamp with "Runtime Error" (Visual C++ runtime library). It seems to be harder than I thought.
When debugging the .ape, everything works fine until the render() function is called. The "c_thisclass->enabled" flag (Set to "1" in constructor) is always a different _random_ number when I try to activate the plugin. So that it seems to be a problem with the c_thisclass instance (probably casted as c_rbase, and so the class property doeas not exists?). Many open questions here...
I hope, a c++builder guru can assist me in porting this to Borland.
Thank you
Andreas
PS: working, but crashing c++builder project and avstut00.ape attached
jheriko
28th October 2002 23:41 UTC
Originally posted by fOSSili
"Runtime Error" (Visual C++ runtime library).
Maybe you need visual c++.
Which would suck heavily.
fOSSili
29th October 2002 00:15 UTC
No,
I don't think, visual c++ is needed. Shouldn't simple class definitions be equally represented by bcb and vc?
Uh, when i think about it, c++ compilers differ in many way's. And when it comes to _MS_ compilers...
I have a idea to solve this problem: If someone can write a "wrapper-ape" thet can load a .dll dynamically ? Like avi-render or image-render do this with media. In the loaded .dll (the one I will write) only three simple stdcall functions would need to be exported:
- int init();
- int render(char visdata[2][2][576], int isBeat, int *framebuffer, int *fbout, int w, int h);
- int destroy();
Thats all. And it can be heavily ported to other Languages (thinking of Borland C++ Builder and Delphi too) because it doesnt use this C++ Classes Stuff.
It would be REALLY great if someone can think about it, because not everyone can buy Visual Studio, but has access to simpler compilers, which can build .dll's too.
Thanks for your effort on that (hopefully),
Andreas
PS: no attachement this time