DvbDream Community

- No topics related to illegal ways of watching TV ! -
It is currently Fri May 24, 2013 9:03 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sun Mar 02, 2008 4:32 am 
Offline
Just popping in

Joined: Sun Jan 13, 2008 1:14 pm
Posts: 4
Hello,

i´m trying to create an OSD surface using an C++ DLL. Here is the code:

int OSDTEST(HWND DDHWND, DWORD dwHeight, DWORD dwWidth, DWORD dwLeft, DWORD dwTop, BYTE Transparency)
{

TOSDSurface osd;
osd.dwSize = sizeof(osd);
osd.dwHeight = dwHeight;
osd.dwWidth = dwWidth;
osd.dwTop = dwTop;
osd.dwLeft = dwLeft;
osd.Transparency = Transparency;
int hOSD = SendMessage(hAPP, WM_MODULE_MSG, DDMODAPI_OSD_CREATE_SURFACE, (LPARAM)&osd);
return hOSD;
//SendMessage(hAPP, WM_MODULE_MSG, DDMODAPI_OSD_SHOW_SURFACE, hOSD);

}

I call this function from my C# application. The code:

[DllImport("DDOSDHelper.dll")]
static extern int OSDTEST(IntPtr DDHWND, UInt32 dwHeight, UInt32 dwWidth, UInt32 dwLeft, UInt32 dwTop, byte Transparency);

...
OSDTEST(xxx, 50, 50, 10, 10, 1);
...

Evertime i call this code an error occurs in DD (see attached file).

Can anyone help?

Thanks
Isch


Attachments:
File comment: ERRORLOG
DD_ERRORLOG.TXT [36.31 KiB]
Downloaded 32 times

_________________
TT-budget S2-3200
Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 02, 2008 6:43 am 
Offline
relocation
User avatar

Joined: Fri Jun 16, 2006 9:50 am
Posts: 1563
the parameter you send through SendMessage should be in the same memory space with DvbDream.

so you can call this function only from a module (*.mod placed into \modules) otherwise there will be access-violations. (different apps = different memory space = different addressing)

_________________
DVB Dream - because I have to dream about having time to code it


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 05, 2008 7:39 am 
Offline
Just can't stay away

Joined: Tue Apr 17, 2007 12:52 pm
Posts: 35
You can do it with standalone app.

You need to allocate memory in DD process (with VirtualAllocEx API) of sizeof(TOSDSurface) size, fill local structure, copy the structure to the DD process with WriteProcessMemory API and then send message while passing the address of allocated memory in DD process.

Don forget to free DD memory when you finished, otherwise there will be memory leak in DD :)

_________________
DFI RS482 Mobo - AMD 3200 Venice core - SS2 2.6B - Vista Ultimate 32bit - DD 1.3c


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 08, 2008 4:51 am 
Offline
Just popping in

Joined: Sun Jan 13, 2008 1:14 pm
Posts: 4
Thanks for your tip.

Creating the OSD is working now!

Now my problem is to read the bitmap from DD´s memspace.
I use ReadProcessMemory, but how can i get the size of the OSD bitmap?

Any ideas?

_________________
TT-budget S2-3200


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group