I'm having trouble trying to load a non-default .wab file (I know it's old hat but need to keep it going for my XP users). I'm running it on Vista and although I'm supplying a filename it keeps loading my Vista Contacts instead instead of the specific wab addresses.
It must be going wrong around here (mostly stock code from the msdn sample code):
// (pszFileName is const char *)
// if we loaded the dll, get the entry point
m_lpfnWABOpen = (LPWABOPEN) GetProcAddress(m_hinstWAB, "WABOpen");
Yes the wab is OK. If you doubleclick it Windows asks if you want to import the addresses.
Somehow the WabOpen bit just thinks I want the default Wab (although there isn't one in Vista) and isn't getting the filename. In the original code there was a 'GetNativePath()' call which isn't available - could it be to do with how I'm passing in the file location string?
If i check the documentation (http://msdn.microsoft.com/en-us/library/ms629458%28v=vs.85%29.aspx[^]) for WAB_PARAM, the szFileName member is declared to be LPTSTR. This suggests that depending on your target options, it might be a unicode or an ansii/mbcs string which then suggests that there might be a unicode and an ansii/mbcs version of the function (as with a lot of API methods throughout windows). When you query the function's pointer...are you sure you are getting the correct version?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
I'm not sure - in the header file I can't see another version except WabOpenEx which I tried but didn't work.
I've noticed that my Contacts folder is actually receiving the wab addresses and getting bigger and bigger! So instead of opening the wab on its own it's adding them to the Contacts then opening those instead. Is this some undocumented Vista mechanism?
Thanks very much for everyone's conttributions so far.