Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #4852 > unrolled thread
| Started by | pplonus@googlemail.com |
|---|---|
| First post | 2013-02-28 03:54 -0800 |
| Last post | 2013-03-01 10:54 +0100 |
| Articles | 7 — 3 participants |
Back to article view | Back to comp.lang.clipper.visual-objects
SideBySide with .NET Assembly pplonus@googlemail.com - 2013-02-28 03:54 -0800
Re: SideBySide with .NET Assembly "Wolfgang Riedmann" <wriedmann@gmail.com> - 2013-02-28 13:46 +0100
Re: SideBySide with .NET Assembly "Wolfgang Riedmann" <wriedmann@gmail.com> - 2013-02-28 14:22 +0100
Re: SideBySide with .NET Assembly "Willie Moore" <williem@wmconsulting.com> - 2013-02-28 07:33 -0600
Re: SideBySide with .NET Assembly "Wolfgang Riedmann" <wriedmann@gmail.com> - 2013-02-28 15:20 +0100
Re: SideBySide with .NET Assembly pplonus@googlemail.com - 2013-03-01 00:19 -0800
Re: SideBySide with .NET Assembly "Wolfgang Riedmann" <wriedmann@gmail.com> - 2013-03-01 10:54 +0100
| From | pplonus@googlemail.com |
|---|---|
| Date | 2013-02-28 03:54 -0800 |
| Subject | SideBySide with .NET Assembly |
| Message-ID | <4d02fa44-14da-4449-9b12-9ee685896d93@googlegroups.com> |
Hi,
i have a problem and hope you can help me.
I want to use a .NET Assembly in VO without registration. I definied the .NET Assembly for COM Visible = true and generate a manifest with the mt.exe.
For the VO Application i created also a manifest. Now i want to create an object in my VO code, but it doesn`t work.
If i call OLEAutoObject{"SxSTest.Calculator"} i get a NULL Object.
Has someone an idea why?
Here is the .NET Code:
---
using System.Runtime.InteropServices;
namespace SxSTest
{
[ClassInterface(ClassInterfaceType.AutoDual)]
[Guid("A6752390-662B-417F-A5DC-45D4370BC821")]
public class Calculator
{
public Calculator()
{
}
public int Sum(int i1, int i2)
{
return i1 + i2;
}
}
}
-----
The Manifest:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity name="SxSTest.dll" version="1.0.0.0" processorArchitecture="x86">
</assemblyIdentity>
<clrClass clsid="{A6752390-662B-417F-A5DC-45D4370BC821}" progid="SxSTest.Calculator" threadingModel="Both" name="SxSTest.Calculator" runtimeVersion="">
</clrClass>
<file name="SxSTest.dll" hashalg="SHA1">
</file>
</assembly>
-----
The Manifest of the VO Terminal App:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1
assembly.adaptive.xsd" manifestVersion="1.0"
xmlns:asmv1="urn:schemas-microsoft-com:asm.v1"
xmlns:asmv2="urn:schemas-microsoft-com:asm.v2"
xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"
xmlns="urn:schemas-microsoft-com:asm.v1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="X86"
name="VO.Test"
type="win32"
/>
<description>Visual Objects Application.</description>
<dependency>
<dependentAssembly>
<assemblyIdentity name="SxSTest.dll" version="1.0.0.0" processorArchitecture="x86"/>
</dependentAssembly>
</dependency>
</assembly>
[toc] | [next] | [standalone]
| From | "Wolfgang Riedmann" <wriedmann@gmail.com> |
|---|---|
| Date | 2013-02-28 13:46 +0100 |
| Message-ID | <ap922qFoo0sU1@mid.individual.net> |
| In reply to | #4852 |
Hi,
> I want to use a .NET Assembly in VO without registration. I definied
> the .NET Assembly for COM Visible = true and generate a manifest with
> the mt.exe.
You need to put the entire interface in the manifest of the exe.
Look at attached the sample of a real world application.
Wolfgang
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity
type = "win32"
name = "client"
version = "1.0.0.0" />
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
<file name="olexlsf.dll">
<comClass
clsid="{80C3B0A7-BA1B-11D6-871B-CCD480E9F31C}"
description=""
tlbid="{49C5B7AB-6005-4B46-A2A9-961D8705356C}"
threadingModel="apartment"
progid="olexlsf.XLSFileObject"/>
<typelib
tlbid="{49C5B7AB-6005-4B46-A2A9-961D8705356C}"
version="4.0"
helpdir=""
flags="hasdiskimage"/>
</file>
<comInterfaceExternalProxyStub
iid="{16946DD7-A53F-48E5-B397-E8A2F472C34E}"
name="ICellValidations"
tlbid="{49C5B7AB-6005-4B46-A2A9-961D8705356C}"
proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"/>
<comInterfaceExternalProxyStub
iid="{1861C6A1-BBA4-11D6-871B-AB44C86CD11C}"
name="IRangeRects"
tlbid="{49C5B7AB-6005-4B46-A2A9-961D8705356C}"
proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"/>
<comInterfaceExternalProxyStub
iid="{1EF4AB21-CCE0-11D6-871B-DC89B7CC3A1C}"
name="IFormatStrings"
tlbid="{49C5B7AB-6005-4B46-A2A9-961D8705356C}"
proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"/>
<comInterfaceExternalProxyStub
iid="{346374A0-3E18-11D8-871B-C7D669601004}"
name="ICell"
tlbid="{49C5B7AB-6005-4B46-A2A9-961D8705356C}"
proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"/>
<comInterfaceExternalProxyStub
iid="{4A6716C0-CC23-11D6-871B-C675B7FE5F1C}"
name="IRanges"
tlbid="{49C5B7AB-6005-4B46-A2A9-961D8705356C}"
proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"/>
<comInterfaceExternalProxyStub
iid="{4F025216-446D-46E7-B6AB-23161811790E}"
name="ICellCoords"
tlbid="{49C5B7AB-6005-4B46-A2A9-961D8705356C}"
proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"/>
<comInterfaceExternalProxyStub
iid="{80C3B080-BA1B-11D6-871B-CCD480E9F31C}"
name="IRange"
tlbid="{49C5B7AB-6005-4B46-A2A9-961D8705356C}"
proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"/>
<comInterfaceExternalProxyStub
iid="{80C3B084-BA1B-11D6-871B-CCD480E9F31C}"
name="IColumns"
tlbid="{49C5B7AB-6005-4B46-A2A9-961D8705356C}"
proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"/>
<comInterfaceExternalProxyStub
iid="{80C3B086-BA1B-11D6-871B-CCD480E9F31C}"
name="IColumn"
tlbid="{49C5B7AB-6005-4B46-A2A9-961D8705356C}"
proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"/>
<comInterfaceExternalProxyStub
iid="{80C3B088-BA1B-11D6-871B-CCD480E9F31C}"
name="ICells"
tlbid="{49C5B7AB-6005-4B46-A2A9-961D8705356C}"
proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"/>
<comInterfaceExternalProxyStub
iid="{80C3B09B-BA1B-11D6-871B-CCD480E9F31C}"
name="IRows"
tlbid="{49C5B7AB-6005-4B46-A2A9-961D8705356C}"
proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"/>
<comInterfaceExternalProxyStub
iid="{80C3B09D-BA1B-11D6-871B-CCD480E9F31C}"
name="ISheet"
tlbid="{49C5B7AB-6005-4B46-A2A9-961D8705356C}"
proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"/>
<comInterfaceExternalProxyStub
iid="{80C3B09F-BA1B-11D6-871B-CCD480E9F31C}"
name="ISheets"
tlbid="{49C5B7AB-6005-4B46-A2A9-961D8705356C}"
proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"/>
<comInterfaceExternalProxyStub
iid="{80C3B0A1-BA1B-11D6-871B-CCD480E9F31C}"
name="IWorkbook"
tlbid="{49C5B7AB-6005-4B46-A2A9-961D8705356C}"
proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"/>
<comInterfaceExternalProxyStub
iid="{80C3B0A3-BA1B-11D6-871B-CCD480E9F31C}"
name="IXLSFile"
tlbid="{49C5B7AB-6005-4B46-A2A9-961D8705356C}"
proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"/>
<comInterfaceExternalProxyStub
iid="{80C3B0A5-BA1B-11D6-871B-CCD480E9F31C}"
name="IXLSFileObject"
tlbid="{49C5B7AB-6005-4B46-A2A9-961D8705356C}"
proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"/>
<comInterfaceExternalProxyStub
iid="{82945DD6-A8BF-42C1-901D-BC85F4FB3265}"
name="ICellValidation"
tlbid="{49C5B7AB-6005-4B46-A2A9-961D8705356C}"
proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"/>
<comInterfaceExternalProxyStub
iid="{9743529F-4E3B-4CAE-959E-AD8CBFD01667}"
name="ICustomXLSItem"
tlbid="{49C5B7AB-6005-4B46-A2A9-961D8705356C}"
proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"/>
<comInterfaceExternalProxyStub
iid="{ABE3562C-CA24-4DAD-BAEB-DA571341B847}"
name="ICellComments"
tlbid="{49C5B7AB-6005-4B46-A2A9-961D8705356C}"
proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"/>
<comInterfaceExternalProxyStub
iid="{AF9E6122-DBA8-11D7-871B-E834A603F51C}"
name="IXLSImage"
tlbid="{49C5B7AB-6005-4B46-A2A9-961D8705356C}"
proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"/>
<comInterfaceExternalProxyStub
iid="{AF9E6124-DBA8-11D7-871B-E834A603F51C}"
name="IXLSImages"
tlbid="{49C5B7AB-6005-4B46-A2A9-961D8705356C}"
proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"/>
<comInterfaceExternalProxyStub
iid="{B0086D60-CC84-11D6-871B-FECA554E551C}"
name="IPageSetup"
tlbid="{49C5B7AB-6005-4B46-A2A9-961D8705356C}"
proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"/>
<comInterfaceExternalProxyStub
iid="{CF43A158-4673-4C0E-BBD8-E083F439FD9F}"
name="ICellComment"
tlbid="{49C5B7AB-6005-4B46-A2A9-961D8705356C}"
proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"/>
<comInterfaceExternalProxyStub
iid="{DA41CFC5-CB31-4593-8C5F-80EA9744FB7B}"
name="IRow"
tlbid="{49C5B7AB-6005-4B46-A2A9-961D8705356C}"
proxyStubClsid32="{00020424-0000-0000-C000-000000000046}"/>
</assembly>
--
[toc] | [prev] | [next] | [standalone]
| From | "Wolfgang Riedmann" <wriedmann@gmail.com> |
|---|---|
| Date | 2013-02-28 14:22 +0100 |
| Message-ID | <ap9402Fp64fU1@mid.individual.net> |
| In reply to | #4852 |
Hi, > I want to use a .NET Assembly in VO without registration. I definied > the .NET Assembly for COM Visible = true and generate a manifest with > the mt.exe. an addition: for the manifest generation I use Side-by-Side Manifest Maker from Maze Computer: http://www.mazecomputer.com/ Wolfgang --
[toc] | [prev] | [next] | [standalone]
| From | "Willie Moore" <williem@wmconsulting.com> |
|---|---|
| Date | 2013-02-28 07:33 -0600 |
| Message-ID | <kgnmad$ejf$1@speranza.aioe.org> |
| In reply to | #4856 |
Wolfgang, Thanks for the link. That looks very interesting. Have you used that to do a side by side of a dotNet assembly from VO? I have a client who has registration issues and I have been extending his code with a COM exposed Vulcan assembly. If that works, it might make my life much easier. Regards, Willie Vulcan VIP "Wolfgang Riedmann" wrote in message news:ap9402Fp64fU1@mid.individual.net... Hi, > I want to use a .NET Assembly in VO without registration. I definied > the .NET Assembly for COM Visible = true and generate a manifest with > the mt.exe. an addition: for the manifest generation I use Side-by-Side Manifest Maker from Maze Computer: http://www.mazecomputer.com/ Wolfgang --
[toc] | [prev] | [next] | [standalone]
| From | "Wolfgang Riedmann" <wriedmann@gmail.com> |
|---|---|
| Date | 2013-02-28 15:20 +0100 |
| Message-ID | <ap97ctFpu9hU1@mid.individual.net> |
| In reply to | #4857 |
Hi Willie, > Thanks for the link. That looks very interesting. Have you used that > to do a side by side of a dotNet assembly from VO? I have a client > who has registration issues and I have been extending his code with a > COM exposed Vulcan assembly. If that works, it might make my life > much easier. I haven't used that with .NET based assemblies, but that shouldn't import as COM is COM. Wolfgang --
[toc] | [prev] | [next] | [standalone]
| From | pplonus@googlemail.com |
|---|---|
| Date | 2013-03-01 00:19 -0800 |
| Message-ID | <9335105f-5e6a-46bf-916a-6269a012bac9@googlegroups.com> |
| In reply to | #4852 |
I've got the solution. The problem is not the manifest, it is the target framework version of the .net assembly. It seems like .NET 4.0 is not working.
Here are my final manifest:
Test.Exe (VO-Programm)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity name="Test.EXE" version="2.8.0.2816" type="win32" processorArchitecture="x86"/>
<dependency>
<dependentAssembly>
<assemblyIdentity name="SxSTest" version="1.0.0.0" type="win32"/>
</dependentAssembly>
</dependency>
</assembly>
--------------
.NET Assembly v3.5
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity name="SxSTest" version="1.0.0.0" type="win32"/>
<clrClass
name="SxSTest.Calculator"
clsid="{A6752390-662B-417F-A5DC-45D4370BC821}"
progid="SxSTest.Calculator"
threadingModel="Both"/>
<file name="SxSTest.tlb">
<typelib
tlbid="{42B3F5C8-B2AF-4AA5-8805-6C2639A72FA8}"
version="1.0"
helpdir=""
flags="hasdiskimage"/>
</file>
</assembly>
I found a nice blog post, which gives the reason why .net 4.0 not working and a workaround. Look at Answer 4: http://go4answers.webhost4life.com/Example/reg-free-comnet-interop-646.aspx
Greetz
[toc] | [prev] | [next] | [standalone]
| From | "Wolfgang Riedmann" <wriedmann@gmail.com> |
|---|---|
| Date | 2013-03-01 10:54 +0100 |
| Message-ID | <apbc6qF9vpvU1@mid.individual.net> |
| In reply to | #4861 |
Hi, > I've got the solution. The problem is not the manifest, it is the > target framework version of the .net assembly. It seems like .NET 4.0 > is not working. thank you very much for letting us know! Wolfgang --
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.clipper.visual-objects
csiph-web