.NET Bridge

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

.NET Bridge

Bob.Cowdery
.NET Bridge

Hi

I have some code in C# that I want to port to squeak but it's quite a lot of work so as a quick fix for the time being I am trying to use the .NET bridge. Although I can get it to work with the examples that use built-in types I can't get it to work with an assembly I have built. Before I go into detail is there anyone out there who is successfully using this with their own assemblies.

Thanks
Bob

*** Confidentiality Notice *** Proprietary/Confidential
Information belonging to CGI Group Inc. and its affiliates
may be contained in this message. If you are not a recipient
indicated or intended in this message (or responsible for
delivery of this message to such person), or you think for
any reason that this message may have been addressed to you
in error, you may not use or copy or deliver this message
to anyone else.  In such case, you should destroy this
message and are asked to notify the sender by reply email.



Reply | Threaded
Open this post in threaded view
|

Re: .NET Bridge

John Pierce-2
Hi Bob,

You can use: DotNet loadLibraryFromFile: 'c:\myassemblies\library.dll'

to load types from any other assembly.

John

On 3/23/06, [hidden email] <[hidden email]> wrote:

Hi

I have some code in C# that I want to port to squeak but it's quite a lot of work so as a quick fix for the time being I am trying to use the .NET bridge. Although I can get it to work with the examples that use built-in types I can't get it to work with an assembly I have built. Before I go into detail is there anyone out there who is successfully using this with their own assemblies.

Thanks
Bob

*** Confidentiality Notice *** Proprietary/Confidential
Information belonging to CGI Group Inc. and its affiliates
may be contained in this message. If you are not a recipient
indicated or intended in this message (or responsible for
delivery of this message to such person), or you think for
any reason that this message may have been addressed to you
in error, you may not use or copy or deliver this message
to anyone else.  In such case, you should destroy this
message and are asked to notify the sender by reply email.








--
It's easy to have a complicated idea. It's very very hard to have a simple idea. -- Carver Mead

Reply | Threaded
Open this post in threaded view
|

RE: .NET Bridge

Bob.Cowdery
In reply to this post by Bob.Cowdery

Hi John

 

Thanks for the reply. I can load the library but can't create an instance. If I do:

 

DotNet loadLibraryFromFile: 'C:\RadioZone\SDR\SDR-Breadboard\st\DotNetController.dll'

 

ctrl := DotNet HW new.

 

It complains message not understood 'new'. The class is definitely HW. I can create an instance from another .NET assembly.

 

Bob

 

           

> Hi Bob,

> You can use: DotNet loadLibraryFromFile: 'c:\myassemblies\library.dll'

> to load types from any other assembly.

> John

On 3/23/06, [hidden email] <[hidden email]> wrote:

Hi

I have some code in C# that I want to port to squeak but it's quite a lot of work so as a quick fix for the time being I am trying to use the .NET bridge. Although I can get it to work with the examples that use built-in types I can't get it to work with an assembly I have built. Before I go into detail is there anyone out there who is successfully using this with their own assemblies.

Thanks
Bob

*** Confidentiality Notice *** Proprietary/Confidential
Information belonging to CGI Group Inc. and its affiliates
may be contained in this message. If you are not a recipient
indicated or intended in this message (or responsible for
delivery of this message to such person), or you think for
any reason that this message may have been addressed to you
in error, you may not use or copy or deliver this message
to anyone else.  In such case, you should destroy this
message and are asked to notify the sender by reply email.







--
It's easy to have a complicated idea. It's very very hard to have a simple idea. -- Carver Mead

*** Confidentiality Notice *** Proprietary/Confidential
Information belonging to CGI Group Inc. and its affiliates
may be contained in this message. If you are not a recipient
indicated or intended in this message (or responsible for
delivery of this message to such person), or you think for
any reason that this message may have been addressed to you
in error, you may not use or copy or deliver this message
to anyone else.  In such case, you should destroy this
message and are asked to notify the sender by reply email.



Reply | Threaded
Open this post in threaded view
|

Re: .NET Bridge

John Pierce-2
Do you have a default constructor on the HW class?

On 3/23/06, [hidden email] <[hidden email]> wrote:

Hi John

 

Thanks for the reply. I can load the library but can't create an instance. If I do:

 

DotNet loadLibraryFromFile: 'C:\RadioZone\SDR\SDR-Breadboard\st\DotNetController.dll'

 

ctrl := DotNet HW new.

 

It complains message not understood 'new'. The class is definitely HW. I can create an instance from another .NET assembly.

 

Bob

 

           

> Hi Bob,

> You can use: DotNet loadLibraryFromFile: 'c:\myassemblies\library.dll'

> to load types from any other assembly.

> John

On 3/23/06, [hidden email] <[hidden email]> wrote:

Hi

I have some code in C# that I want to port to squeak but it's quite a lot of work so as a quick fix for the time being I am trying to use the .NET bridge. Although I can get it to work with the examples that use built-in types I can't get it to work with an assembly I have built. Before I go into detail is there anyone out there who is successfully using this with their own assemblies.

Thanks
Bob

*** Confidentiality Notice *** Proprietary/Confidential
Information belonging to CGI Group Inc. and its affiliates
may be contained in this message. If you are not a recipient
indicated or intended in this message (or responsible for
delivery of this message to such person), or you think for
any reason that this message may have been addressed to you
in error, you may not use or copy or deliver this message
to anyone else.  In such case, you should destroy this
message and are asked to notify the sender by reply email.







--
It's easy to have a complicated idea. It's very very hard to have a simple idea. -- Carver Mead

*** Confidentiality Notice *** Proprietary/Confidential
Information belonging to CGI Group Inc. and its affiliates
may be contained in this message. If you are not a recipient
indicated or intended in this message (or responsible for
delivery of this message to such person), or you think for
any reason that this message may have been addressed to you
in error, you may not use or copy or deliver this message
to anyone else.  In such case, you should destroy this
message and are asked to notify the sender by reply email.








--
It's easy to have a complicated idea. It's very very hard to have a simple idea. -- Carver Mead

Reply | Threaded
Open this post in threaded view
|

RE: .NET Bridge

Bob.Cowdery
In reply to this post by Bob.Cowdery

No, would that be important then?

 

Bob

 

>> Do you have a default constructor on the HW class?

On 3/23/06, [hidden email] <[hidden email]> wrote:

Hi John

 

Thanks for the reply. I can load the library but can't create an instance. If I do:

 

DotNet loadLibraryFromFile: 'C:\RadioZone\SDR\SDR-Breadboard\st\DotNetController.dll'

 

ctrl := DotNet HW new.

 

It complains message not understood 'new'. The class is definitely HW. I can create an instance from another .NET assembly.

 

Bob

 

           

> Hi Bob,

> You can use: DotNet loadLibraryFromFile: 'c:\myassemblies\library.dll'

> to load types from any other assembly.

> John

On 3/23/06, [hidden email] <[hidden email]> wrote:

Hi

I have some code in C# that I want to port to squeak but it's quite a lot of work so as a quick fix for the time being I am trying to use the .NET bridge. Although I can get it to work with the examples that use built-in types I can't get it to work with an assembly I have built. Before I go into detail is there anyone out there who is successfully using this with their own assemblies.

Thanks
Bob

*** Confidentiality Notice *** Proprietary/Confidential
Information belonging to CGI Group Inc. and its affiliates
may be contained in this message. If you are not a recipient
indicated or intended in this message (or responsible for
delivery of this message to such person), or you think for
any reason that this message may have been addressed to you
in error, you may not use or copy or deliver this message
to anyone else.  In such case, you should destroy this
message and are asked to notify the sender by reply email.






--
It's easy to have a complicated idea. It's very very hard to have a simple idea. -- Carver Mead

*** Confidentiality Notice *** Proprietary/Confidential
Information belonging to CGI Group Inc. and its affiliates
may be contained in this message. If you are not a recipient
indicated or intended in this message (or responsible for
delivery of this message to such person), or you think for
any reason that this message may have been addressed to you
in error, you may not use or copy or deliver this message
to anyone else.  In such case, you should destroy this
message and are asked to notify the sender by reply email.







--
It's easy to have a complicated idea. It's very very hard to have a simple idea. -- Carver Mead

*** Confidentiality Notice *** Proprietary/Confidential
Information belonging to CGI Group Inc. and its affiliates
may be contained in this message. If you are not a recipient
indicated or intended in this message (or responsible for
delivery of this message to such person), or you think for
any reason that this message may have been addressed to you
in error, you may not use or copy or deliver this message
to anyone else.  In such case, you should destroy this
message and are asked to notify the sender by reply email.



Reply | Threaded
Open this post in threaded view
|

Re: .NET Bridge

John Pierce-2
Well, if you only have a constructor like:

 public HW(String name) { ... }

then you would need to create it in DotNet as follows:

  hw := DotNet HW new: 'name'.

Regards,

John

On 3/23/06, [hidden email] <[hidden email]> wrote:

>
> No, would that be important then?
>
> Bob
>
> >> Do you have a default constructor on the HW class?
>
> On 3/23/06, [hidden email] < [hidden email]> wrote:
>
> Hi John
>
> Thanks for the reply. I can load the library but can't create an instance. If I do:
>
> DotNet loadLibraryFromFile: 'C:\RadioZone\SDR\SDR-Breadboard\st\DotNetController.dll'
>
> ctrl := DotNet HW new.
>
> It complains message not understood 'new'. The class is definitely HW. I can create an instance from another .NET assembly.
>
> Bob

Reply | Threaded
Open this post in threaded view
|

RE: .NET Bridge

Bob.Cowdery
In reply to this post by Bob.Cowdery
Thanks John,

Yes, I'm being stupid, hung between two worlds which handle things
differently. I am getting it to do stuff now. It always complains
invalid selector first time but I think I read that's to be expected.

I can get all the methods and properties that take either no parameters
or a Boolean to work (not complain anyway) but any that take some other
parameter like a UInt16 or Int64 throw a 'message not understood'. Do I
need to mangle parameters in some way?

Regards
Bob


Well, if you only have a constructor like:

 public HW(String name) { ... }

then you would need to create it in DotNet as follows:

  hw := DotNet HW new: 'name'.

Regards,

John

On 3/23/06, [hidden email] <[hidden email]>
wrote:
>
> No, would that be important then?
>
> Bob
>
> >> Do you have a default constructor on the HW class?
>
> On 3/23/06, [hidden email] < [hidden email]>
wrote:
>
> Hi John
>
> Thanks for the reply. I can load the library but can't create an
instance. If I do:
>
> DotNet loadLibraryFromFile:
'C:\RadioZone\SDR\SDR-Breadboard\st\DotNetController.dll'
>
> ctrl := DotNet HW new.
>
> It complains message not understood 'new'. The class is definitely HW.
I can create an instance from another .NET assembly.
>
> Bob

*** Confidentiality Notice *** Proprietary/Confidential
Information belonging to CGI Group Inc. and its affiliates
may be contained in this message. If you are not a recipient
indicated or intended in this message (or responsible for
delivery of this message to such person), or you think for
any reason that this message may have been addressed to you
in error, you may not use or copy or deliver this message
to anyone else.  In such case, you should destroy this
message and are asked to notify the sender by reply email.