-
LoadLibrary + Class??
Hullo.
I've discovered a useful little class in a dll using the dependancy walker; however, I have scant clue how to go about creating an instance of this class. I'm familiar with using LoadLibrary() and GetProcAddress(), but I don't feel like that's going to cut it; here's the nice little chart DW came up with for me:
Code:
[C++]class BNGatewayAccess & BNGatewayAccess::operator=(class BNGatewayAccess const &)
[C++]int BNGatewayAccess::CurGateway(void)
[C++]char * BNGatewayAccess::DNS(int)
[C++]char * BNGatewayAccess::FindKey(char *,char *)
[C++]char * BNGatewayAccess::FindSection(char *,char *)
[C++]int BNGatewayAccess::GMT(int)
[C++]void BNGatewayAccess::GetBattlenetGatewayList(void)
[C++]void BNGatewayAccess::GetBattlenetRealmsList(void)
[C++]void BNGatewayAccess::GetGatewayList(char const *)
[C++]int BNGatewayAccess::GetSystemTimeZone(void)
[C++]void BNGatewayAccess::Load(void)
[C++]char * BNGatewayAccess::Name(int)
[C++]char * BNGatewayAccess::Nth(int)
[C++]int BNGatewayAccess::NumGateways(void)
[C++]void BNGatewayAccess::PickClosestZone(int)
[C++]char * BNGatewayAccess::Realm(int)
[C++]void BNGatewayAccess::SetCurGateway(int)
[C++]char * BNGatewayAccess::SkipEOL(char *,char *)
[C++]char * BNGatewayAccess::SkipToEOL(char *,char *)
[C++]void BNGatewayAccess::Unload(void)
[C++]void BNGatewayAccess::UpdateGatewaysFromIni(char *)
[C++]void BNGatewayAccess::WriteDefaultGatewayList(void)
[C]QueryInterface
Soo....how can I create an instance of aforementioned class? The top prototype looks to be the key, but I'm not sure how to do it.
Thanks in advance.
-
I've done s'more research on the COM QueryInterface() and I spose that this is the way it should be done, but I can't figure out how to do it...someone? anyone?
-
Why do you want to hook into that dll? I know which it is and by whom and to what program it belongs. Why do you want to hook into it?
There is no way to use this as a class. You COULD use GetProcAddress to get all the class' methods, but you wouldn't know what to pass as a this pointer. It would have to be the address of some struct, but you woudn't know how large those structs have to be, neither would you know what secret initiliazing is done by element constructors that might be vital to the workings of the class.
Nothing you can do without at least the original header of the class and maybe the import library too. And you can assume that this company doesn't give it to you.
I also doubt that you'll get anywhere with QueryInterface here.
-
:rolleyes: Don't assume I'm up to no good -- nothing could be further from the truth. I spend a lot of time on battle.net in the open tech support channel and I see lots of questions from people who have modified their registries to use alternate servers. I thought this would be an excellent way to provide a tool that could reset their gateway entries without an update even if the registry format changed. Since it appears from your answer that this isn't possible, I suppose I'll just have to do DNS lookups and hope that the main address for each gateway doesn't change.
Thanks anyway.
/K
-
That's reassuring. I just wanted to make sure you're not some kid that tries to mess with battle.net. It's the best gaming system around.
-
Probably OT now :-D
I concur. And it's free :D