Hi Viv.
Many thanks for detailed explanation
I'll spend a bit of time seeing if I can implement
regards,
Gerard
>Create a project of type 'classLibrary'. e.g:
using System.Runtime.InteropServices;
>
>namespace GerardsDll
>{
> [Guid("02AB9D93-1ED6-49A3-B52D-BE18C321ADB8")]
> public interface IGerardsClass
> {
> int GetMeaningOfLife();
> }
>
> [Guid("E4B57315-4B86-4358-A0CD-18E319CCA0F1"),ClassInterface((ClassInterfaceType.None))]
> public class GerardsClass : IGerardsClass
> {
> public int GetMeaningOfLife()
> {
> return 42;
> }
> }
>}
In the project properties:
>
>Application/Assembly Information : Check 'Make assembly COM visible'
>Build : Check 'Register for COM interop'
>
>In VFP :
x = CREATEOBJECT("GerardsCom.GerardsClass")
>? x.GetMeaningOfLife()
If you don't want/need intellisense then you can simply use:
public class GerardsClass
> {
> public int GetMeaningOfLife()
> {
> return 42;
> }
> }
To register on a different machine see RegAsm:
http://msdn.microsoft.com/en-us/library/tzat5yw6(v=vs.110).aspx>
>
>
>
>>Hi Viv. Thnaks for your reply
>>......But why don't you just expose the EXE as an OLE object ?
>>
>>Yes..it its simpler ...its a long time since I did anything like this ......how would I go about doing this ??
>>
>>Regards,
>>Gerard
>>
>>
>>
>>
>>>The returned integer is used as the error code. You probably need to use CreateProcess/GetLastError. Something like this:
>>>
http://www.foxite.com/archives/shellexecute-and-wait-for-completion-0000085681.htm>>>
>>>UPDATE: Or this:
http://support.microsoft.com/kb/191584>>>
>>>But why don't you just expose the EXE as an OLE object ?
>>>>Hi.
>>>>I have C# Console EXe whcih returns an integer in Main()
>>>>I want to Run the App from within Foxpro and get the Vlaue returned from the C# .exe
>>>>Anybody have any idea how this can be done?
>>>>My preference would be not to start ourputting the result to another file if its possibel to directly access the return value
>>>>
>>>>Tia
>>>>Gerard