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
*** Confidentiality Notice ***
Proprietary/Confidential |
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:
-- It's easy to have a complicated idea. It's very very hard to have a simple idea. -- Carver Mead |
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, 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 *** Confidentiality Notice ***
Proprietary/Confidential
*** Confidentiality Notice ***
Proprietary/Confidential |
Do you have a default constructor on the HW class?
On 3/23/06, [hidden email] <[hidden email]> wrote:
-- It's easy to have a complicated idea. It's very very hard to have a simple idea. -- Carver Mead |
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, 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 *** Confidentiality Notice ***
Proprietary/Confidential
*** Confidentiality Notice ***
Proprietary/Confidential
*** Confidentiality Notice ***
Proprietary/Confidential |
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 |
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. |
Free forum by Nabble | Edit this page |