I am writing plug-ins for use in a product. I am attempting to write them so that if the applicaiton is opened from ProjectWise, it knows that pw is initalized and it does not need to ask for a login. I also want for it to initalize and ask for a login if the application was not opened from ProjectWise. I tried using NULL == aaApi_GetActiveDatasource(), but am receiving NULL for both cases. Is there an API way to do this or do I have to poll the windows active programs?
One approach could be to use the Microsoft C++ EnumProcessModules function for the parent process you are running under/in. Sample source code can be found here: "Enumerating All Modules For a Process".
HTH,Bob
Does the aaApi_Initialize module mask match the intended target module's mask; e.g. AAMODULE_ALL?
[Additional]
There are some additional functions available for registering your module under different conditions listed under the ProjectWise help topic: "Dynamic-Link Library and Thread Handling Functions". e.g. To register a new/dynamically loaded module under ProjectWise Explorer:
#define DLL_NAME TEXT("mypwaddin.dll")aaApi_RegisterModule(AAMODULE_EXPLORER,DLL_NAME,DLL_NAME);