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
Creating OSD from an C# Application
Moderators:X05, Dreamer, FredB
- Attachments
-
- DD_ERRORLOG.TXT
- ERRORLOG
- (36.31KiB)Downloaded 583 times
TT-budget S2-3200
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)
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
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
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
Return to “Module / Plugin Programming”
Who is online
Users browsing this forum: No registered users and 1 guest