Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C# - RoboDK top level window was not found...
#1
Exclamation 
Hello.
I cloned the RoboDK-API repo, tried to run the project from Visual Studio (tried versions 2017 and 2019) and got System.FormatException at RoboDK.cs line 584, as the previous line

Code:
var mainWindowId = Command("MainWindow_ID");


returns "RoboDK top level window was not found..." instead of int descriptor of the window. This happens both if the RDK is opened previously before the project is run, or if the RDK is not running.

I couldn't find much help on the toppic, the thread
https://robodk.com/forum/Thread-Problem-...ws-8-64bit
didnt help.


https://github.com/RoboDK/RoboDK-API/issues/60

Previous instance of the RoboDK IDE was left open somewhere (OS warned me that existing opened instance is preventing the PC to reboot, couldn't find it otherwise), causing socket communication from 2nd instance to get aborted and disconnected from the host - socket is opened, but the "VerifyConnection" method finds out that the connection is closed - but desn't handle this state.
#2
Are you running this command right after RoboDK startup?

It may be a good idea to wait a few milliseconds after startup to grab the window ID. You can also use Microsoft tools to grab the window ID based on the window name or a process ID. You can retrieve the process ID by using the MainProcess_ID command:

Code:
RDK.Command("MainProcess_ID")
  




Users browsing this thread:
1 Guest(s)