|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Computer playing Bejeweled Blitz project
The clf (Call Library Function) node needs the name and/or path to the library and the function call info to be configured. I believe the example or tutorial retrieves the computer name, and would work fine as a template for your usage. If you are calling the function more than once, it is a good idea to make a subVI wrapper, since the configuration and appearance other ways get annoying.
It is possible to use GDI calls to get the window handle for other apps, and to use bitable to copy a portion of their window into your own, and then to implement GetPixel() or something similar. Possible, but certainly easy. Using a camera to capture the screen will likely have issues with aliasing, lighting, and calibration. Not a cakewalk, but good practice if you want to use the camera on the robot. Greg McKaskle |
|
#2
|
||||
|
||||
|
Re: Computer playing Bejeweled Blitz project
Wow, that helps a whole bunch more, thanks! That function is one of what I'm looking for. I even poked around, found user32.dll, configured the node, and it worked! Screenshots of configuration attached. It certainly helped to know a little bit about C-like functions for the parameters tab.
I looked at msdn before but couldn't find anything...thanks for the link. I looked at the other cursor functions but there wasn't one to click the mouse/cursor, so maybe the user will have to do that quickly when prompted to. Thanks Greg for the tip about the GDI and GetPixel calls, I'll look them up on msdn. Yes, I've looked at that example you were talking about and some other ones too, but they were still a little over my head. So let me get this straight for my sake and anyone else's who might look at this and not know--the Call Library Function Node basically calls/uses a function in a library that you specify. A .dll file is a compressed library with many functions that can be used universally with many systems/programs. And user32.dll is a library that has many/all of the Windows API functions, which can be used by other programs to interact with windows. Aren't they written in a unique programming language that is very similar to C/Java/most text-based languages? EDIT: well now that I think about it, of course there wouldn't really be a function to "click" the mouse; you're the one that's clicking it and the software is sensing that. But maybe if there was a function to send a universal "click signal" to all of Windows, or all the programs waiting for a click, or the general windows mouse driver, etc. Last edited by RoboMaster : 07-11-2010 at 18:23. |
|
#3
|
||||
|
||||
|
Re: Computer playing Bejeweled Blitz project
Quote:
Note that this function has been superseded(and included by me for reference purposes). You should be using the second function I found, called 'SendInput()' Both are housed in 'User32.dll' so you're fine there. I'm not much of a LabView guy, so I'm not sure how easy it would be to implement either of these API calls, but I hope I could help either way. |
|
#4
|
|||
|
|||
|
Re: Computer playing Bejeweled Blitz project
Quote:
In reality, the language the functions are written in isn't important, but the calling conventions are. Notice the dialog for clf asks you the calling conventions? That is because Windows actually has several conventions. These conventions specify how a calling function passes parameters to the called function and retrieves results. This is done differently on different computer architectures and on different OSes. Given the information you gave LV about the parameters, it takes the wire information and pushes the parameters onto the stack according to the stdcall conventions, executes the call instruction with the address to your function in the library, then retrieves the results and does any stack or register cleanup as specified by the convention. As long as the conventions are followed, any language can reuse code from any other. To flip roles, you can build a DLL from LV so that it can be called from any program capable of calling into a Windows library. Greg McKaskle |
|
#5
|
|
Re: Computer playing Bejeweled Blitz project
Would an application that uses such a dll require the labview runtime engine to run?
Last edited by biojae : 09-11-2010 at 00:09. |
|
#6
|
|||
|
|||
|
Re: Computer playing Bejeweled Blitz project
Yes it would. Technically, we could statically build in all the things it would need for execution and make each one stand-alone, but it isn't that big a request. It would also help if the datadlow scheduling engine were already on the OS.
Greg McKaskle |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Computer Science or Computer Engineering? | KRibordy | College & University Education | 14 | 09-10-2009 01:56 |
| saving project as a new project | windell747 | NI LabVIEW | 3 | 01-02-2009 04:41 |
| Music Playing Problem on Computer | John Gutmann | Chit-Chat | 9 | 31-07-2007 17:04 |
| pic: Kaizen Blitz Presents... The Blitz Box 2006 | Ian Curtis | Robot Showcase | 0 | 24-02-2006 16:47 |
| The Blitz is a GO!! | Erin Rapacki | Off-Season Events | 6 | 06-06-2003 19:31 |