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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

cann't cast WSession

Robert_K
4-Participant

cann't cast WSession

dear All,

 

why i cannt cast WSession from Session?

 

class CommandConvertTolerances extends DefaultUICommandActionListener {
	public void OnCommand() {

		try {

			WSession session = (WSession) pfcSession.GetCurrentSession ();
			
//			WSession wSession = null;	
//						
//			if (wSession instanceof WSession)
//				wSession = (WSession)session;

			Model model = session.GetCurrentModel();
//			WModel wm = (WModel)model;

 

java.lang.ClassCastException: com.ptc.wfc.Implementation.pfcSession$Session cannot be cast to com.ptc.wfc.wfcSession.WSession

 

Thanks!

Robert

 

1 ACCEPTED SOLUTION

Accepted Solutions

I have changed in registry protk.dat two lines to:

 

startup otk_java
toolkit object

View solution in original post

4 REPLIES 4

wfcWSession_ptr wsession = wfcWsession::cast(pfcGetProESession());

 

They use their own Smart Pointer implementation.

 

Br,

Eike

WSession.PNGHow i can access this Type (Pointer description)
Thank you very much!

Oh I'm sorry haven't done it in Java right now.

 

AFAIK it should be in the licensed OJava path. So you should need a Java OTK License for this (but I could be wrong / not sure about this ...).

 

Br,

Eike

I have changed in registry protk.dat two lines to:

 

startup otk_java
toolkit object

Top Tags