You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# csharp-text-formatter
1
+
# csharp-message-to-image
2
2
3
-
csharp-text-formatter is a test/sample C# solution with an ordinary (non-MFC) C++ DLL project.
3
+
csharp-message-to-image is a test/sample C# solution with an ordinary (non-MFC) C++ DLL project.
4
4
5
5
The purpose of this solution is to work out how to create a C++ DLL and utilise it in C#.
6
6
@@ -16,7 +16,7 @@ At the time of writing it has one exported function:
16
16
doubleAdd(int a, double b);
17
17
```
18
18
19
-
## TextFormatter
19
+
## MessageToImage
20
20
21
21
This is the main C# WPF .NET Core 3.1 project.
22
22
@@ -29,23 +29,23 @@ double result = Interop.UnsafeNativeMethods.Add(a, b);
29
29
Trace.WriteLine($"Result of external Add({a}, {b}) = {result}.");
30
30
```
31
31
32
-
In order to run the project, the **Direct2DWrapper** project will need building to generate Direct2DWrapper.dll and a link file created in **TextFormatter\lib** pointing at the Direct2DWrapper.dll file.
32
+
In order to run the project, the **Direct2DWrapper** project will need building to generate Direct2DWrapper.dll and a link file created in **MessageToImage\lib** pointing at the Direct2DWrapper.dll file.
33
33
34
34
### Direct2DWrapper.dll
35
35
36
36
In order for the C# project to successfully run, it needs to be able to find Direct2DWrapper.dll.
37
37
38
38
1. In Visual Studio 2019, choose **Debug** or **Release** for Solution Configurations and **x64** or **x86** for Solution Platforms.
39
39
2. Right-click the **Direct2DWrapper** project and click **Build**.
40
-
3. Right-click the **lib** folder in the **TextFormatter** project.
40
+
3. Right-click the **lib** folder in the **MessageToImage** project.
41
41
4. In the context menu: **Add**, **Existing Item…**
42
42
5. Change the file types drop down to **Executable Files** (or all files, you're looking for a .dll)
43
-
6. Browse to the root directory for the solution - if you're in the directory **csharp-text-formatter\TextFormatter**, you need to go up a directory.
43
+
6. Browse to the root directory for the solution - if you're in the directory **csharp-message-to-image\MessageToImage**, you need to go up a directory.
44
44
7. Find the DLL you built in step 1. If you chose Debug and x64, it will likely be in **x64\Debug**. Select the **Direct2DWrapper.dll** file.
45
45
8. Click the arrow next to the **Add** button, and click **Add as Link**.
46
46
9. Right-click the link file **lib\Direct2DWrapper.dll** and click **Properties**.
47
47
10. Change **Copy to Output Directory** to **Copy if newer**.
48
-
11. Run the **TextFormatter** project. If something is still wrong, you'll get a DllNotFoundException.
48
+
11. Run the **MessageToImage** project. If something is still wrong, you'll get a DllNotFoundException.
0 commit comments