Module does not show up in Module List

Module API help / support section for programmers.

Moderators: FredB, X05, Dreamer

rusti
Posts: 2
Joined: Fri Oct 14, 2011 5:30 am

Module does not show up in Module List

Postby rusti » Fri Oct 14, 2011 5:40 am

Hello community,

i recently became interestend in module-development (c++) for dvbdream.
For this reason, i wrote a test mod which has no function apart from showing up in the modules list. Unfortunately, the mod doesnt even show up there.
I would be glad if someone could help me to correct my code!

cheers

rusti

.h File:
----------------------

#pragma once
#pragma comment(lib, "user32.lib")
#include
#include
#include "Include\moduleAPI.h"

#if (!defined( MAKEINTRESOURCE ))
#define MAKEINTRESOURCE( res ) ((ULONG_PTR) (USHORT) res)
#endif

int __stdcall OnGetModuleInfo (TModuleInfo *pModuleInfo);
int __stdcall OnInit (TInitInfo *pInitInfo);
int __stdcall OnClose ();
int __stdcall OnShow ();
int __stdcall BeforeChannelChange (TChannelInfo *pChannelInfo);
int __stdcall AfterChannelChange (TChannelInfo *pChannelInfo);
int __stdcall OnDDEvent(DWORD EventType, void *EventParams);

---------------------

.cpp File:
---------------------

#include "stdafx.h"
#include "dvbdream_remote.h"

int DlgProc (HWND hWin, DWORD uMsg, DWORD wParam, DWORD lParam); ***EDIT: this line is actually not included anymore***

HWND hwndDD;
HINSTANCE hInstance;

#pragma unmanaged
bool APIENTRY DllMain (HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
{
hInstance = (HINSTANCE)hDll;

return TRUE;
}

int __stdcall OnGetModuleInfo (TModuleInfo *pModuleInfo)
{

pModuleInfo->dwModuleAPI = MODULE_API_1_9;
pModuleInfo->dwModuleVer = 0x01010000; // v1.1

lstrcpy((LPWSTR)(TModuleInfo*)&pModuleInfo->szModuleAuthor, (LPCWSTR)"rusti");
lstrcpy((LPWSTR)(TModuleInfo*)&pModuleInfo->szModuleEmail, (LPCWSTR)"rusti@tu.de");
lstrcpy((LPWSTR)(TModuleInfo*)&pModuleInfo->szModuleName, (LPCWSTR)"DVB Dream Check");


pModuleInfo->dwModuleType = MODTYPE_REMOTE;
pModuleInfo->dwRequiredDDver = 0x01000000; // v1.0.0.0

return TRUE;
}


int __stdcall OnInit (TInitInfo *pInitInfo) {
hwndDD = pInitInfo->hMainWnd;
return FALSE;
}

---------------------

Last edited by rusti on Fri Oct 14, 2011 8:01 am, edited 1 time in total.
Hauppauge WinTV Nova-TD

"The thing about quotes from the internet is that it's hard to verify their authenticity." - Abraham Lincoln
User avatar
rel
relocation
Posts: 1999
Joined: Fri Jun 16, 2006 9:50 am

Postby rel » Fri Oct 14, 2011 7:13 am

you should implement/ write all those functions, they should return a value:
int __stdcall OnGetModuleInfo (TModuleInfo *pModuleInfo);
int __stdcall OnInit (TInitInfo *pInitInfo);
int __stdcall OnClose ();
int __stdcall OnShow ();
int __stdcall BeforeChannelChange (TChannelInfo *pChannelInfo);
int __stdcall AfterChannelChange (TChannelInfo *pChannelInfo);
int __stdcall OnDDEvent(DWORD EventType, void *EventParams);
DVB Dream - because I have to dream about having time to code it
rusti
Posts: 2
Joined: Fri Oct 14, 2011 5:30 am

Postby rusti » Fri Oct 14, 2011 7:59 am

Thanks for the fast response!
I implemented all the missing methods and fixed the return value of each method to 0. Example:

int __stdcall OnClose ()
{
return 0;
}


Unfortunately, i still cant find my module in the modules list...
Hauppauge WinTV Nova-TD



"The thing about quotes from the internet is that it's hard to verify their authenticity." - Abraham Lincoln
User avatar
rel
relocation
Posts: 1999
Joined: Fri Jun 16, 2006 9:50 am

Postby rel » Fri Oct 14, 2011 8:46 am

I would recommend simply modifying an existing c++ example in Module SDK, to create a new module.
that way it will be easier.
DVB Dream - because I have to dream about having time to code it
sgs
Just can't stay away
Posts: 27
Joined: Wed May 14, 2014 4:59 am

Re: Module does not show up in Module List

Postby sgs » Fri May 30, 2014 12:08 pm

I know this is a bit old but I ran into the same problem and thought I might be able to help others in the future.

I'm writing an EPG module using Qt. I had a lot of trouble getting the module to work with dvbdream and it was because of the name mangling and calling convention.

using the __stdcall convention generated mangled names (use the visual studio command 'dumpbin /exports <yourdll>' to see the names) and DVBDream won't recognise the module in this case. I presume this was the OP's problem.

I managed to get the named demangled using extern "C" but I guess this changed the calling convention because then DVBDream would crash.

In the end I added a linker option to use a 'def' file and now the modules work.. There might be a better way but it works so I don't care.

Return to “Module / Plugin Programming”

Who is online

Users browsing this forum: No registered users and 1 guest