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:

image

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:

6 Answers

6

You forgot to call Control.CreateControl() bud.

Initializing the control does not create the UI.

Check out PDMSDK.

I am also having trouble with getting the form to show. There aren't any issues with setup pages or details pages. However, with these launch pages it just remains blank. Control.CreateControl() doesn't seem to solve the issue (at least for me)

–

Is that the case with PDMSDK?

–

I haven't tried the Launch page with SDK yet but I don't believe it's working

–

When I pass the control handle into the mlParentWnd as it requires, the launch window size changes to match that of my user control. However, is just doesn't show up.

–

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:
image
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:

This could be a bug. I need to try and replicate this.

–

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.

This is my thought as well. I’ve tried just about everything I can think of to get this to work too and it really seems like a bug.

–

Please commit that to a public GitHub repo so we can try it

–

I have simplified the task even more to only include the absolute minimum content. It can only be run from the tasklist. You can find it here: https://github.com/Disgustus/TaskLaunchTest

–