8 votes
Accepted

A Simplistic C# (.NET) Reloader

Yes it is possible to write such a code and I will present the code and sample usage below. The motivation for this question/answer is this Java reloader by Leonid Shifrin and I borrowed some code ...
  • 32.7k
8 votes
Accepted

Problem with Excel operation in NETLink way

In the Excel object model, the worksheet symbol Cells represents a property, not a method. In Visual Basic and other languages, many properties have a default ...
  • 67.9k
7 votes
Accepted

How can I copy a figure to the clipboard in SVG?

Under Windows, this can be done with NETLink by modifying code published here. ...
7 votes

Web Browsing Automation: how to expand all comments under a blog post?

Here is one way to do it, using WebUnit: Needs["WebUnit`"]; InstallWebUnit[]; StartWebSession[]; OpenWebPage["http://suggestions.livejournal.com/825341.html"]; ...
7 votes

Web Browser Screen Shot

There is now a built-in way to do this: WebImage["http://stackoverflow.com"] ...
  • 3,637
7 votes
Accepted

How to use VBA types with UNDERLINE in it's name in NETLink?

Quoting from the Underscores in .NET Names subsection within the Calling .NET from the Wolfram Language section of the NETLink Tutorial: .NET/Link maps underscores in type, method, property, and ...
  • 67.9k
6 votes

Problem with .NET/Link - Unable to load DLL 'ml32i4.dll'

In v10, the Windows version no longer installs the MathLink libraries to \Windows\System32. The recommended way of dealing with this is to 'redist' a copy of ml32i4.dll with the app.
  • 2,786
6 votes
Accepted

Get .NET Link to work on Raspberry Pi

Okay, I tried this and it seems to work. I copied NETLink from a Mac to /opt/Wolfram/WolframEngine/10.0/SystemFiles/Link. I ...
  • 231k
6 votes
Accepted

How to create .NET "System.Windows.Clipboard"?

First, we must load the PresentationCore assembly to make the type System.Windows.Clipboard available: ...
  • 67.9k
5 votes
Accepted

How to make a get image by a NETObject

Done ...
  • 25.3k
5 votes

How to make a get image by a NETObject

I don't know much of .net and it probably shows, but at least I got something to work albeit very,very slowly. Your code (which I also turned into a bitmap on the clipboard using Mathematica's "Copy ...
5 votes
Accepted

How to find all package we can LoadNETType

We can get a list of all .NET types that can be loaded using LoadNETType like this: ...
  • 67.9k
5 votes

NETLink Problem with C# DLL

There are some minor errors that need to be corrected: The main problem is that C# methods must be called using the syntax obj@Method[args]. The C#-looking ...
  • 67.9k
5 votes

Problem with Excel operation in NETLink way

It works with code. Scan[(ws@Cells[#, #]@Value = #*100) &, Range@10] It seems that vars i in ...
  • 2,399
4 votes
Accepted

How to control which version of Mathematica .NET/Link uses

I do not know any C#, but this seems to be answered in the documentation. Since I am reading the local copy, not an online version, I cannot post links. Here are screenshots instead: Thus if you ...
  • 231k
4 votes

Launch Front End from .NET MathKernel and return result to .NET

With a lot of help from this answer: Connect Frontend to Kernel Started by JVM via JLink here is a demo that opens a notebook from .NET (via button1), allows the user to make a dynamic manipulation, ...
  • 30.4k
4 votes
Accepted

Problem with inserting a picture into Excel sheet in NETLink way

The crux of the issue is that the symbol WorksheetClass.Pictures is a method, not a property. When using NETLink, methods must always be followed by an argument ...
  • 67.9k
4 votes
Accepted

Does any know how to get the paths of current opened locations in file explorer?

If you are referring to the Windows File Explorer, then we can use NETLink and the Shell API to get a list of open windows: ...
  • 67.9k
3 votes

A .NET exception occurred: System.IO.FileLoadException:Could not load file or assembly

As per MSDN: Note You may get a FileLoadException in a Windows Virtual PC application when you try to load a file from linked folders on the hosting computer. This error may also occur when you ...
  • 31
3 votes

Optimizing casting objects of a .NET List object

After thinking about it for a while, I realized that the best, least messy, and fastest solution was to create a helper library for situations like this. ...
3 votes
Accepted

How can I create an object in NETLink from System.Collections.Generic.List

I have just discovered that there is another way to make generic types and there is an advantage in this solution that I am going to demonstrate. I will continue the example offered by WReach, this ...
  • 1,291
3 votes
Accepted

How to show plot or graphics on Form or PictureBox in NETLink?

... What to do is to follow the .NET rule to make it. ...
  • 2,399
3 votes
Accepted

Passing an image to Kernel via NETLink

I have found through a lot of iterations that the easiest and most reliable way of doing this is to pass the images using Base64 strings. I have included example functions for sending and retrieving ...
3 votes
Accepted

How to pass the second parameter to COM object in NETLink?

As Microsoft noted on the Type.Missing Page: The following code example shows the use of the Missing field to invoke a method with its default arguments. To use ...
  • 7,994
2 votes

Formatting Excel Borders with .Net

I suggest write code formatting borders as following avoiding using the Enum values directly. ...
  • 2,399
2 votes

How to programmatically extract mathematical formulas from Word with Mathematica 9?

@WolframFan The answer is great, help me understanding the XML document format. Here is my codes. Part 1 If linear formulas wanted, try this ...
  • 2,399
2 votes

MathLink error while calling a custom Mathematica function - MLGet out of sequence

testFunc[] needs to be defined prior to being called. I don't use .NETLink, so I can't guarantee if the following will work, but try ...
2 votes
Accepted

Replacing lambda expressions in LINQ queries through NET/Link

A solution to this is to convert the .Net collection into a Wolfram List and then use Select. ...
  • 40.6k
2 votes
Accepted

Using a pointer in NETLink

Updated Response - Accessing Unmanaged Memory The signature of GetImage as returned by NETTypeInfo tells us that the function ...
  • 67.9k
2 votes

Calling a dll from Mathematica

"short" or "char" are in the C programming language data typs. Try this: ...
  • 43

Only top scored, non community-wiki answers of a minimum length are eligible