What's new

For those diverse in the .NET Framwork

remmy

reenignE
I've just started playing around with C# and as my first project, I decided to write a sample application that loads the THP Dynamic Library I created based on thakis' thpplay source.

The DLL is loading and initializing properly, however, do to the lack of a callback, I'm currently only able to play the first Frame of a THP via C#.

For instance, in thakis' original source, he used:

Code:
LRESULT CALLBACK eventListener(HWND hWnd, UINT msg, WPARAM wP, LPARAM lP)

Now my question is how would this be implemented in C#? I'm guessing I'd have to use pInvoke, but being completely new to C#, I'm just guessing.

Attached is the test application in its current state along with the Dynamic Link Library for anyone who is interested in the Library. It's a C++ Dynamic Link Library.

Check dumpbin for exports and thpplay's source for implementation ideas.

-Edit

Forgot to mention that the purpose of doing the application in C# is just to provide THP playing functionality to those who wish to use it in the .NET Framework.

-Edit 2

Once I can iron out the callback, I'll be happy to share the source for the class with whomever wants it.
 
Last edited:
OP
remmy

remmy

reenignE
Well, I've made progress, but had to rewrite quite a bit of code. Attached is the current progress. (!) Note the name Debug. I've managed to get videos to play completely through without a problem, however, audio is still limited to the cached frames (10).

Also, it's not multi threaded yet. That's not an over site, just laziness, so the form does not redraw while playing just yet/the form is unresponsive while playing, however it speed is comparable to it's C++ counterpart. memory usage, not so much. There are no optimizations being used yet, so it's a little large in the memory department right now.

Should have the rest of it patched together soon.
 

Top