how to call other exe file in Eprime?
chen
chunhuichen at 126.com
Tue Nov 6 03:12:26 UTC 2007
Thank you!
I copyed the declare syntax to user script window (without "public" before "declare") and in an inline object used the ShellExecute function. But it seem Eprime just skiped this function. No error, but just ignore this function. The same script works well in VB.
Why I have to use external function is I have a special device, it not only used as response switch, but also used as a signal generator, I used VB script not only detact a key press but also receive a signal from the device. VB script fulfill this by calling an executive function. Since eprime is very good at timing, I want to write script using Eprime, but also need to use my old device. So I hope I can call that executive function in Eprime.
"ShellExecute" is a dll file I used to call that executive function in VB, If you can help me to find some way to call an executive function, i do not need to use ShellExecute. Or can you give me an Eprime example of use external function?
Thank you very much!
--
Chunhui Chen
______________
Beijing Normal University
&
University of California, Irvine
在2007-11-06,"David McFarlane" <mcfarla9 at msu.edu> 写道:
At 11/3/2007 11:28 PM Saturday, Chunhui Chen wrote:
>Hi, I used to write Visual Basic scripts and now I want to use
>Eprime. But i don't know how to call executive function in Eprime.
>
>Here is want I wrote in VB
>(1) declare function
>Public Declare Function ShellExecute Lib "shell32.dll" Alias _
>"ShellExecuteA" _
>(ByVal hWnd As Long, ByVal lpOperation As String, _
>ByVal lpFile As String, _
>ByVal lpParameters As String, _
>ByVal lpDirectory As String, _
>ByVal nShowCmd As Long) As Long
>(2) call executive file
>ShellExecute(NULL,"open","calc.exe",NULL,NULL,SW_SHOWNORMAL);
Have you just tried this in E-Prime? This looks very much like what
I did several years ago to get direct access to the Windows API in
order to use some extra keyboard functions (that was before I learned
that I could do the same thing by testing for key offsets <g>).
The whole "Public Declare ..." stuff works just like in VB, of course
you have to put your .dll file in the right place, etc. But I don't
know anything about ShellExecute, perhaps that is where you're getting stuck.
Is there some compelling reason that you need to call external
executables instead of just making your whole experiment work in "the
E-Prime" way?
---
David McFarlane, Systems Designer
Dept. Psychology, Michigan State University
mcfarla9 at msu.edu www.msu.edu/~mcfarla9
Voice: (517) 353-0799 Fax: (517) 353-1652
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com
To unsubscribe from this group, send email to e-prime-unsubscribe at googlegroups.com
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en
-~----------~----~----~----~------~----~------~--~---
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.linguistlist.org/pipermail/eprime/attachments/20071106/83d934c4/attachment.htm>
More information about the Eprime
mailing list