Hello,
when calling a COM/DLL with wwDotNetBridge from VFP, is it possible to somehow activate IntelliSense when writing code in the VFP editor?
Thanks, Manni
Note the three first lines in the code window at https://webconnection.west-wind.com/docs/_3d20uw7n6.htm.
The secret lies in this line:
LOCAL loBridge as wwDotNetBridge
If you're talking about the .NET objects you're accessing then answer in most cases is No. FoxPro's Intellisense can't figure out dynamic objects that are created at runtime. FWIW, that also doesn't work at runtime because you're using a COM object that is dynamically created and doesn't have a typelibrary that FoxPro can parse to get its COM intellisense.
That said there are exceptions for objects that are actually exposed as explicit COM objects. This works with objects you define your self and set the various [ComClass]
attributes on or those in the framework that do internally (almost none).
With those you can use their COM interface:
LOCAL loDotnetObject as DotnetComClass.ComServerId
to get Intellisense.
The best you can do is to use a tool like Reflector (look in the Tools
folder) to open the DLL file and find the classes you are calling. That will give the you call structures etc.
+++ Rick ---
Thank you, Tore and Rick!
I tried both of your suggestions and
LOCAL loDotnetObject as DotnetComClass.ComServerId
did the trick for me! 😃
DO wwDotnetBridge
InitializeDotnetVersion("V4")
LOCAL loBridge as wwDotNetBridge && didn't make a difference regarding IntelliSense
loBridge = CreateObject("wwDotNetBridge","V4")
loBridge.LoadAssembly("C:\temp\myDotnetComClass.dll")
LOCAL loFox as myDotnetComClass.ComServerId && this command invokes IntelliSense
loFox = loBridge.CreateInstance("DotnetComClass.ComServerId")
Where can I find the Tools folder to use Reflector?
Thanks, Manni
EDIT: IntelliSense works, because the COM/DLL was registered with RegAsm.exe on my PC. When the DLL is not registered, then IntelliSense is not working. However, this is what I was looking for, to have Intellisense on the developer's PC. On the user's PC the registration is not needed because of wwdotNetBridge.