10-06-2009 04:19 AM
Follow up of this post here :
http://forums.ni.com/ni/board/message?board.id=170&thread.id=445552
(in a new topic beacuse it is slightly off topic, and I want to see if anyone responds to the other one)
Could someone please check my code in the VI is correct before I try and run it. I'm not sure I understood the MSDN page correctly, and I'm just trying to create a function that does a RegCreateKey on a mobile Device in LabVIEW.
Function here:
http://msdn.microsoft.com/en-us/library/aa911940.aspx
VI attached. - Not complete because I didn't understand enough, but am I going in the right direction?
10-06-2009 07:32 AM
Examples for Reg entries can be found in the example finder.
Here is a screen shot for each of the vi's
Be careful in the registry. You also need to make sure that you have access to the registry to add and delete the entries. If you are planning to move this software to a customer be aware that they may not have full access to the registry if the IT group has locked them out of the registry.
10-06-2009 11:01 AM
Thanks for the feedback aeastet.
I knew this already.
The problem is that these VIs only access the Windows Registry, and are not supported on Windows Mobile 6 (PDAs).
Windows Mobile 6 uses a different registry style, which it might be possible to access with DotNet code, but again, this is not in the Mobile Module as NI do not support Mobile 6 yet.
Hence my need to create my own Registry access function suite from scratch using the info provided by Microsoft.
(I'm happy to post them on the forums when done as this is only for fun that I'm doing this for my own use)
So my question still stands...
to any GURU
Am I heading in the right direction with my VI?
(Kudos for a helpful answer - amount depends on helpfulness of answer)
10-06-2009 12:13 PM
10-08-2009 07:24 AM
here is the VI in 8.2
Thanks for offering to help smercurio_fc.
(I used the ring in the Call DLL example to try to work out the data types)
10-08-2009 09:18 AM
10-08-2009 10:40 AM
What I was trying to do was to creat a function that access the Windows Mobile 6 registry according to the coding guidelines on the MS site. As a Mech Eng by training (and therfore not origninally a software deveoler) I understand LabVIEW up to the CLAD level, and I'm hoping to sit my CLD exam soon. Unfortunatley for me this task requires knowledge of software programming outside of the LabVIEW environment and what things mean in order to integrate with it.
My backgound in programming came from software testing originally.
I'll be honest I'm terrible with text based programming languages unless we are talking BASIC (as in BBC), I've never really understood DLLs, APIs and Registrys too much apart from in a general sense from what I have been taught by great C Programmers around me in my last company, but I have none of them to lean on now.
The reason the Parameters are not wired I because I'm not even sure if the are the correct type.
I belive to perform the function in the MS document I need to use a Call by reference node. I'm not sure how I need to configure it, so that's where I'm looking for pointers.
I don't intend to put this anywhere near H/W until it's totally error free on the simulator. Unfortunately due to the modular nature of the task here I'm not sure I can get away with making stubs for testing. I need to be able to respond to the OS and debug and know what I'm doing.
some pointers would be very much appreciated. I know "you can lead a horse to water but you can't make it drink" - but I'm thirsty for the knowledge that will enable me to understand the how and why so I can do this on my own without annoying too many people.
It's the use of .h files and where they go etc that I forget from my training courses.
Thanks
Will change to use stdcall WINAPI in th CbRef node.
10-08-2009 08:18 PM
Well, you did pretty good for being "just" a mechanical engineer, and not understanding DLLs.
There's one thing that I still don't understand. aeastet had pointed out the examples that ship with LabVIEW. Did you take a look at them? The registry functions that ship with LabVIEW are just wrappers around calling the Windows API. In fact, if you open the Create Registry Key VI you can see it has a CLFN in there to call the RegCreateKeyExA function, which is what you're trying to do. It also shows you what values to wire up to the various parameters.
10-09-2009 12:21 AM
As I'm unable to open your VI.. What are you trying to do to the registry? Read or Write or both?
I'm sure the access restrictions to the registry for PDA cannot be any more stringent than for Vista.
If you're trying to write to the registry then that is a bad idea and you should find another way (location) to store your data.
If you're trying to read - that's no problem, so long as you get your access permission setting right.
Cheers,
Battler.
10-09-2009 01:34 AM - edited 10-09-2009 01:35 AM
I believe smercurio to be right here.
Note, that I'm not doing LabVIEW for Mobile at all, but the Windows Mobile API is in large parts compatible with the standard Windows API, although the semantics of the underlaying system and implementation can vary sometimes quite a bit.
This means that as far as the calling setup of the Call Library Node for many Windows APIs you should not really have to modify the standard VI that is shipping with LabVIEW. If the function will behave in exactly the same way and with the same rights and restrictions is an entirely different story (usually they don't ) but that has nothing to do with what you are trying to do here.
So why do you believe the standard registry VIs that come with LabVIEW won't work here? What sort of errors do you get when you try that?
Rolf Kalbermatter