Cannot execute 'winqueryreg()' in executable GUI on target computer
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi guys,
I created a standalone GUI (executable). In a function within the code, it should scan and list all COM ports. This is done with the following line:
devices = winqueryreg('name', 'HKEY_LOCAL_MACHINE', 'HARDWARE\DEVICEMAP\SERIALCOMM');
This works fine on the PC on which I created and compiled the exe file.
On target PC, the exe-file starts fine but when the line is executed, it gives an error sound and stops working.
It was compiled on a PC with MCR 8.5 64 bit which was also present on target PC.
Two questions:
Can I somehow find out what the error is that occors on target PC when executing the line?
Why could there be an error on target PC and not on PC on which it was compiled?
0 Kommentare
Antworten (2)
Image Analyst
am 5 Jul. 2015
It doesn't work on mine even in the MATLAB development environment. What is 'name' doing in there? 'HKEY_LOCAL_MACHINE' should be your first argument. This is an example of how I use it:
registryKeyValue = winqueryreg('HKEY_LOCAL_MACHINE', 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', 'PROCESSOR_ARCHITECTURE');
By the way, on my computer this will fail:
devices = winqueryreg('HKEY_LOCAL_MACHINE', 'HARDWARE\DEVICEMAP\SERIALCOMM');
because I don't have the SERIALCOMM key under DEVICEMAP. I suggest you put that call in a try/catch block in case the computer does not have that key (like mine).
0 Kommentare
Siehe auch
Kategorien
Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!