025 - Extend Python Programming By Creating DLLs with C/C++

preview_player
Показать описание
Prerequisites:

024 - Dynamically Load DLL at Runtime - LoadLibrary(), GetProcAddress(), Calling Convention __stdcall

023 - C++ STL Library in C Program, Dynamic Link Library for C Programming

022 - (In Gory Detail) How to Create DLL for Use in C++ Programming

Download Source Code:

Episode 024

Episode 023

Episode 022
Рекомендации по теме
Комментарии
Автор

Hi Thomas, I have a question but it's not related to this topic. It is about the possibility of templates for windows messaging for a desktop up. I know you have a very deep understanding of this. Any idea please?

So I have:

// Simple struct with message handling data.
struct params {
UINT message;
WPARAM wParam;
LPARAM lParam;
};

Then a notify class, inhering from params above:

struct notify : public params {
notify(const params& p) noexcept : params(p) { }
NMHDR& nmhdr() const noexcept { return }
};

I have a macro, which creates the type I want:

#define WINLAMB_NOTIFYWM(sname, oname) \
struct sname : public wm::notify { \
sname(const params& p) noexcept : notify(p) { } \
oname& nmhdr() const noexcept { return } \
}

If I call the above macro for example, I get the result below:

//WINLAMB_NOTIFYWM(beginedit, NMHDR);
struct beginedit : public wm::notify
{
beginedit(const params& p) noexcept : notify(p) { }
NMHDR& nmhdr() const noexcept
{
return
}
};

Is there a way I can create a template approach so I can have the types I want created at compile time. I can then create many types as:

WINLAMB_NOTIFYWM(deleteitem, NMCOMBOBOXEX);
WINLAMB_NOTIFYWM(dragbegin, NMCBEDRAGBEGIN);
WINLAMB_NOTIFYWM(endedit, NMCBEENDEDIT);

Thank you in advance. I'm trying to remove the macro, is there another way please. Thanks

shephardmukachi
welcome to shbcf.ru