Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: DLL Unmanaged Managed
We have an old VSE Smalltalk application and we want to be able to call a c# webservice that will return a string.
 
I have been unable to get any call to a managed dll working from Smalltalk but I have been able to create a c++ win32 dll that can be called from Smalltalk, which in turn can call c# managed code.
 
Does anyone know of any other options for getting the c# call working directly without going through the c++ (eg ways to build the dll?). We are running into issues mapping strings with our limited c++ knowledge and would really like to bypass this layer if possible.
 
Note the smalltalk app is a standalone app (exe and its sll files), it is not installed like other windows apps and was written way before the birth of .NET
 
Thanks
UKJohn
Posted 15-Feb-12 10:29am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Yes, I basically know how Smalltalk works. If you can load a regular unmanaged DLL and call some of exported function, it would be enough to load use a .NET assembly, but this is not easy at all. I don't want to discuss a way of implementation of COM component, I'm taking about the ability to export some .NET methods as unmanaged.
 
Many developers would even say this is absolutely impossible, but this is not true: there is a solution based on CLR standard, but not on pure C#.
 
The trick is to build a C# project, disassemble it into IL code, modify it to make some methods exported as unmanaged and compile back. Also, there is an automated way to do it: mark those method with some attribute and implement everything else in a special MSBuild task. This way, you can integrate such customized build into your pure-C# project.
 
If still interested, please first read my answers about this solution:
loading C# DLL in MFC[^],
How can I use a dll created in Visual Basic 2008 in Visual Basic 6.0[^],
Call Managed DLL written in C# from Unmanged Code VC++[^],
API's in .Net: Managed or UnManaged Code[^].
 
You will find further references to CodeProject articles with source code and detailed explanation.
 
—SA
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 390
1 Sergey Alexandrovich Kryukov 329
2 Afzaal Ahmad Zeeshan 244
3 BillWoodruff 210
4 Maciej Los 192
0 OriginalGriff 5,560
1 DamithSL 4,476
2 Maciej Los 3,942
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,175


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 15 Feb 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100