-
-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
create a dll with reference to a nuget library #101
Comments
@fxl447098457 This is [ probably ] what you need: #86 (comment) Can you ask more clearly if it's not, sorry. |
An assemblyResolve as one of the options. Follow my recommendations there with the user's example from last reply. You need to try to use a common practice when debugging third-party libraries, look here: #84 (comment)
|
sorry for my late feedback.assemblyreslove did work. |
here are the codes.i tried the dll in vba. class worked with the CreateIm method not available.error info:“QRCoder, Version=1.3.5.0, Culture=neutral, PublicKeyToken=null” or one of its dependencies. The system cannot find the file specified. could you give me some advice.many thx.
`using QRCoder;
using System;
using System.Drawing;
using System.Runtime.InteropServices;
namespace Qrcode
{
[ComVisible(true), ClassInterface(ClassInterfaceType.AutoDual)]
public class myqrcode
{
[return: MarshalAs(UnmanagedType.SysInt)]
public int CreateIm([MarshalAs(UnmanagedType.BStr)]string s, [MarshalAs(UnmanagedType.BStr)]string filePath)
{
QRCodeGenerator qrGenerator = new QRCodeGenerator();
QRCodeData qrCodeData = qrGenerator.CreateQrCode(s, QRCodeGenerator.ECCLevel.Q);
QRCode qrCode = new QRCode(qrCodeData);
Bitmap qrCodeImage = qrCode.GetGraphic(5, Color.Black, Color.White, null, 15, 6, false);
qrCodeImage.Save(filePath);
return 0;
}
}
static class UnmanagedExports
{
[DllExport]
[return: MarshalAs(UnmanagedType.IDispatch)]
static Object CreateQrcodeClass()
{
return new myqrcode();
}
}
}
`
The text was updated successfully, but these errors were encountered: