Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
API InputBox
Message
From
04/03/2004 10:09:57
Gary Foster
Pointsource Consulting LLC
Chanhassen, Minnesota, United States
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Miscellaneous
Thread ID:
00882884
Message ID:
00883086
Views:
13
Sergey,
Thanks for the code, I'll try it out.

>> BTW, why can't you use VFP Inputbox function?
I have an in-proc COM server (as part of a non-VFP app) that connects to a back end through ODBC. I want to pop up a password input form to complete the connect string. I know the database, server and I can get the userid from Windows, but I need the password. I have a situation where a typical user might have 4 or 5 concurrent instances of the application open at a time that need to have my COM object instantiated for processing credit cards and writing to the back end.

I *could* make out-of-proc servers and use the VFP UI, but I prefer in-proc when I can do it. Wouldn't really hurt anything in this case, but I just don't like seeing 4 or 5 instances of my COM exe running. Just a personal preference.

Yes, yes, I know MS decided back in VFP 6 that we are too stupid to juggle a UI with in-proc COM servers, but I do it anyway with the API when I feel it's useful. System modal MessageBox is an example of a UI I use when I need it.

Gary


>>Hi,
>>Does anyone know how to use the API to get user input similar to the Inputbox function? Thanks.
>>
>Hi Gary,
>
>I don't think, there's such API.
>You can use Windows Script Control downloadable at http://www.microsoft.com/downloads/details.aspx?FamilyId=D7E31492-2595-49E6-8C02-1426FEC693AC&displaylang=en to access VBScript Inputbox function. See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/vsfctinputbox.asp?frame=true for syntax.
LOCAL oSc AS MSScriptControl.ScriptControl
>TEXT TO lcStr NOSHOW
>	Function ReturnThis()
>	ReturnThis = InputBox("Enter something ...")
>	End Function
>ENDTEXT
>oSc = CREATEOBJECT("MSScriptControl.ScriptControl")
>oSc.Language = "VBScript"
>oSc.AddCode(lcStr)
>lcResult = oSc.Run("ReturnThis")
>? lcResult
BTW, why can't you use VFP Inputbox function?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform