I am new to projectwise.I have been working on creating a new toolbar in project wise which will have bunch of commands, but something is missing and the code is not working.
I am using this code HMODULE hmodBitmapInstance; HWND hwndToolbarInstance = NULL; HWND hwndProjectWise; HWND hwndCurrentWindow = NULL; CString csStringTable = L"awomsg"; LONG lngButtonNames[1]; LONG lngStyles[1];
AFX_MANAGE_STATE(AfxGetStaticModuleState());
lngButtonNames[0] = 101; lngStyles[0] = MAKELONG(BTNS_BUTTON, TBSTATE_ENABLED); hwndProjectWise = aaApi_GetOwnerWindow(NULL, &hwndCurrentWindow); hwndCurrentWindow = FindWindowEx(hwndProjectWise, hwndCurrentWindow, NULL, NULL); hmodBitmapInstance = GetModuleHandle(L"PWBVBatchPlot.dll"); hwndToolbarInstance = aaApi_CreateToolBar(hwndCurrentWindow, AATOOLBAR_TOP | AATOOLBAR_NOAUTOSIZE, ID_TOOLBAR, hmodBitmapInstance, IDR_TOOLBAR1, 0, csStringTable, lngButtonNames, lngStyles, 1); aaApi_UpdateToolBarButtons(hwndToolbarInstance, 0);
Please can anybody guide me in getting it work?
By not working, you mean that the menu does not load? Did you register your program? If you didn't, then search this community for register custom module.
I was able to register my dll properly in the project wise. I have written this code when the menu is selected. I was also able to get the correct inputs to the aaApi_CreateToolBar function (handler ,resource files). However the function return NULL and cannot create the toolbar. I think I am missing something ....
Possibly the Toolbar ID, can you let me know what ID can I probably give.
I don't know if you've searched the forums about this, but I ran into this more than a few years ago, and got nowhere with it. See this discussion - https://communities.bentley.com/products/programming/projectwise_programming/f/projectwise-programming---forum/69583/toolbars.
Also look at this thread that had some success but didn't seem to get it working fully - https://communities.bentley.com/products/programming/projectwise_programming/f/projectwise-programming---forum/27797/projectwise-custom-toolbars