EdmCmd_TaskLaunch showing empty dialog [Bug] [SOLIDWORKS PDM] [Task]

I’m running into a problem trying to display a custom dialog when launching a task. To my understanding I have everything set up correctly for showing a user control but when the task is launched the dialogbox is showing up empty. It has the right size and everything but the controls themselves aren’t showing. See attached

versus the control in VS:


I know that the TaskLaunch event is correctly started because when I implement a MessageBox it works correctly. Also, I have all the taskflags set (just to make sure I’m not missing anything).

To my understanding this task launch dialog is working the same as a custom task details page. I have successfully implemented the details page and that is also working as it should.

What am I missing?

Here is the code for the details page (which works) and the TaskLaunch method:

You forgot to call Control.CreateControl() bud.

Initializing the control does not create the UI.

Check out PDMSDK.

Hi Amen,

I added the CreateControl() method but it still doesn’t show the contents of the control. See attached:

As stated earlier, the taskDetailsPage does work without the CreateControl() call in the method for OnTaskDetails. See attached:

A very good possibility is that PDM does not resize your user control before you create it. Can you give it a width and height and try again? Do that before you call CreateControl

I would also subscribe to the load event and show a message box just to know the usercontrol got loaded.

Adding the size explicitly didn’t solve the issue. See attached:

I’m not sure what you mean with subscribing to the load event. The showing/loading of the usercontrol is internal to the API. I can add a MessageBox to the initialization of the control but that would not actually say anything about what happens after.

I added the MessageBox:
and it initializes correctly:

I misunderstood what you meant with load, I added a messagebox to the load event but that also works correctly. See attached:

The control is still empty however:

I have made a barebones test project with just a menu command and a launch page. It gives the same empty dialog. See attached:

So it really looks like a bug in the API or the documentation for the API is missing information regarding the correct implementation of the launch dialog.

1 Like