[mythtv] [PATCH] Win32 frontend support

Anduin Withers anduinw at yahoo.com
Thu Jan 22 13:57:45 EST 2004


> No, this is doable with the Microsoft compiler by creating the import library
> for the executable:

While what you say is true it doesn't solve the "link to multiple executables"
problem.

While not originally stated in Windows lingo the essential "problem" (depends
on how you look at it, dynamic linking in Windows is different, not worse, than
Unix) is that the Windows loader uses named tables to satisfy load time links.
It is very close to how you might use dlload and dlsym only there is no global
symbol namespace.

If you can guarantee that gContext will not be needed in a DLL before a certain
time you can do the equivalent of a dlsym on the main executable.
GetModuleHandle(NULL) will return the module handle for the process, once you
have that you can call GetProcAddress() to return the address of your symbol
(the symbol of course being exported from the executable).

If a function that returned gContext were used instead of directly accessing
gContext this could be made almost seamless. As it is now it would be necessary
to throw that small chunk of symbol loading code into each DLL and have a
module specific gContext that stored that value.

--
Anduin Withers


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/


More information about the mythtv-dev mailing list