Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem .NET DLL
Message
From
12/12/2007 15:39:33
 
 
To
11/12/2007 08:39:33
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01274731
Message ID:
01275309
Views:
12
Hi Mike
I look at the link you gave to me and soma others related and I found this small sample:

************** sample start *****************************

This example demonstrates how VB6 COM client using CCW accesses a Component developed in VB.NET.

VB.NET Component (testCCW.vb)
imports system
namespace CCWComponent
public class CCWClass
public function PassStr As String
PassStr = "Hi From .NET Component"
end function
end class
end namespace

Save this code to a text file with the name testCCW.vb. ************ ok

Now compile this file from the command line with the statemant

Vbc /t:library testCCW.vb **************** ok

The VBC compiler will create a testCCW.dll file for you, this is the .NET assembly. ********** ok

Now, the next step is to create Com Callable Wrapper proxy for the component testCCW.dll file.

The regasm utility can register the .NET component and also create a .TLB file, which can be referenced from any COM client.

Regasm testCCW.dll /tlb:testCCW.tlb ****************** ok


***************** IN VB6

Private Sub Command1_Click()
dim o
set o = createobject("CCWComponent.CCWClass")
msgbox o.PassStr
end sub

************** sample end *****************************

In VFP:

loTest = createobject("CCWComponent.CCWClass")
? loTest.PassStr


In both VB and VFP error occurs: "OLE error cod 0x80070002..."
Any idea would be great because I'm new dealing with this problems.

Thank's in advance,
NPedro
Previous
Reply
Map
View

Click here to load this message in the networking platform