|
|
#1 |
|
Forum King
|
API Service + Borland
I'm still hitting a brick wall with trying to get the api service. It seems so odd to me that it's so problematic to use the functions from what is still relatively very popular compiler. It's really frustrating. Is there any possible way I can emulate what the MSVC code is doing? Even under a kludge? Is there some piece of information that I'm not researching myself that is causing me not to realize how MSVC handles that code that I can try to emulate? I will go to hell and back if I can get this to work. Hell, I'll make my own Borland compatible headers of all the services if I have to.
Any help or pointers or research links would be appreciated. |
|
|
|
|
|
#2 |
|
Forum King
|
/bump
|
|
|
|
|
|
#3 |
|
-
Join Date: Sep 2003
Location: UK
Posts: 22,244
|
in brutal honesty i just don't think it's going to work as what i remember is Borland's abi isn't the same as MSVC's (but that's basing things on years ago when i did use Borland and just went to MSVC since i knew it'd work and was told to do so inorder to access things by people on the original dev team).
-daz |
|
|
|
|
|
#4 |
|
Forum King
|
I think I've managed a kludge:
code: Example to retrieve the memmngr api class pointer using the above kludge: code: Thus far I've had absolutely no crashes. And yes, the asm code is absolutely necessary since (at least from what I read) MSVC classes use the ECX register for the this pointer for class member function calls. If I took out the asm code it crashes Winamp. | SHOUTcast Flash Player | X-Fade Crossfading | LiveWire Microphone Voice-overs | ZeroPointer Null Ouput | | SHOUTcast Auto-Installer Linux Script | Do Not Install 'Till You Save Your Playlist First | Flash Socket Policy Server for Windows | | Embeded Album Art!!!1! | -->Opus Codec Support<-- | Last edited by thinktink; 1st July 2012 at 00:03. |
|
|
|
|
|
#5 |
|
Forum King
|
Revision:
Change the calling convention of the typedef AWASABIDispatch in the above example code from __cdecl to __stdcall. I discovered the error while creating a reverse of the kludge for callbacks. And, of course, the obviously wrong reference to RetVal being a pointer to the api_memmgr service when it's actually a pointer to the api_memmgr's waServiceFactory object at the end of execution. |
|
|
|
|
|
#6 |
|
Forum King
|
k, I think I've created a solid and stable way for Borland plugin writers to use the API services. I've attached a zip file containing two C++ files (1 whole unit.) You can't put it all in the header or it will make compile times longer and create more headaches with size, recompiles, what-not. It means you will need to add the CallWasabi.cpp file to your project or you'll get linker errors.
Example code to allocate 24 bytes of memory (for no particular reason): code: Example code to create a callback class (this example will use playlist enumeration.): code: Any thoughts DrO? | SHOUTcast Flash Player | X-Fade Crossfading | LiveWire Microphone Voice-overs | ZeroPointer Null Ouput | | SHOUTcast Auto-Installer Linux Script | Do Not Install 'Till You Save Your Playlist First | Flash Socket Policy Server for Windows | | Embeded Album Art!!!1! | -->Opus Codec Support<-- | Last edited by thinktink; 20th July 2012 at 18:23. |
|
|
|
|
|
#7 |
|
Forum King
|
I found a flaw in the callback creator macro that could potentially cause problems if the developer selects a different project default calling convention than that of the standard default. Attached corrected version.
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|