cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

VB API ActionListeners ending in XToolKitCommError

Liviu.B
1-Newbie

VB API ActionListeners ending in XToolKitCommError

Hello everyone, im stuck on a few things trying to implement some action listeners in Creo using visual basic in Microsoft Visual Studio 2013. I will try before posting the complete problem a couple of modifications, but at this time i would like to place an open question.

Can anyone tell me the importance that the highlighted line of code from below has ?

        aC.Session.AddActionListener(listenerObj)
        aC.AddActionListener(Me)

The code is taken directly from the VB api examples available from Creo. The action listener works without the second line, so im curious about what it actually does.

Any insight is most welcome. Thank you.


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
2 REPLIES 2
huggre
1-Newbie
(To:Liviu.B)

Hmmm, i have seen VB examples where they are using "Me" as a reference to the active Form object.

Example: Me.Close

If that is the case then i guess this line would assign an action listener to the active form.

Not sure if that is whats going on here..

Liviu.B
1-Newbie
(To:huggre)

Hello Hugo, thanks for engaging in the topic. Although it is clear that it is adding an action listener to the active form, i am not sure of the implication.

I dont know why, in my case, when i use aC.AddActionListener(Me) i get "Type mismatch. ( Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))" when i run the application. I cannot find any difference in the way aC is defined in the examples and my own definition of it.

Because of this i just used aC.AddActionListener(objlistener) instead of "Me" ..again, not sure of the implication because the documentation is really lacking in details about the inner workings of the listeners.

So maybe because of this i get the CommError, after which it is necessary to force close Creo and also close the processes associated with it. It is like Creo starts to hang while it receives something back from the application. I dont know how to give "control" back to Creo, and from the VB API examples i cannot say that it does something in this direction, it just runs the action listener routine without explicitly returning control to Creo..

Top Tags