Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C# COM Intertop Not Right With VFP?
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00651339
Message ID:
00651510
Views:
28
.NET assemblies do not register themselves in the registry and they do not conform to the proper interfaces necessary to be used in the "COM" environment. However, you can still to this. I don't know how to do it on the command line. But in the Visual Studio IE, you can create a project, add the class library, then before building:

Right click on the project in Solution Explorer and choose Properties.
Gol to the Configuration Properties node in the tree view.
Select the Build option.
Place a check in the "Register for COM Interop".
Now, build the project.

You now use the object in the COM world!

>Take this code and save it as str.cs :
>
>using System;
>
>public class T
>{
>public string A(string s)
>{
>return s+" from C#";
>}
>}
>
>
>Take this code and save it as strmake.cmd:
>
>csc /t:library str.cs
>tlbexp str.dll /out:str.tlb
>regasm str.dll
>
>
>Copy str.dll and str.tlb into c:\winnt\system32. Take this code and save it as str.vbs:
>
>	Set o = CreateObject("T")
>	MsgBox o.A("Hello"), , "VBS test"
>
>
>If you run the .vbs, it runs fine. But in VFP7/SP1, if you just do a CreateObject(), you get "OLE error code 0x80131522: Unknown COM status code".
>
>What happened?
>
>Thanks.
Thanks,
Dan Jurden
djurden@outlook.com
Previous
Reply
Map
View

Click here to load this message in the networking platform