VB.NET Automation DLL

smoreno
Member Posts: 4
Hello.
I have made an automation control with vb.net to pass the bmp files to jpg, but when we want create the instance in navision it gives the following error:
It is necessary to make something additional so that it works in navision?
I am sorry for my bad english.
Thanks in advance.
I have made an automation control with vb.net to pass the bmp files to jpg, but when we want create the instance in navision it gives the following error:
This message is for C/AL programmers: Could not create an instance of the OLE control or Automation server identified by GUID={10F16FCF-4EF8-4E90-9C55-44B2D9035C7D} 1.1:{A0DC9EB3-37D6-3FB5-8E26-C0ACABDD2B84}:’bmp2jpg’.IManage. Check that the OLE control or Automation server is correctly installed and registered.I can use the variable in C/AL code but at the time of executing it gives an error. I have registered the DLL with regasm.exe and I can use without any problem from another application.
It is necessary to make something additional so that it works in navision?
I am sorry for my bad english.
Thanks in advance.
0
Comments
-
hello smoreno
Please take a look at this website http://blogs.msdn.com/skydtsgaard/default.aspx
It has steps on how to create a .NET DLL and access it from Navision.0 -
Hi,
first of all, which Navision version do you use?
And on the other hand, you have to create a COM interop assembly for your control. Navision can not (yet) access and run directly "pure" .NET assemblies.
What do you want to do with that assembly? I can see that you try to convert a BMP to JPG, but from where do you get the BMP and where do you want to save the JPG (Database / File / ...)?
HTH,
Rainer0 -
Hi,
I'll try this in Nav 3.60, 3.70 and 4.0. Now i get the bmp file from file, but in the future i want to take it from BLOB field. I have set a true the property “Register for COM Interop” in the project.
This is my vb code:Public Class Manage Inherits System.Windows.Forms.UserControl Implements IManage Dim bmp As Bitmap Dim JPGQuality As Integer = 90 Private Function GetEncoderInfo(ByVal mimeType As String) As System.Drawing.Imaging.ImageCodecInfo Dim j As Integer Dim encoders As System.Drawing.Imaging.ImageCodecInfo() encoders = System.Drawing.Imaging.ImageCodecInfo.GetImageEncoders() For j = 0 To encoders.Length If encoders(j).MimeType = mimeType Then Return encoders(j) End If Next j Return Nothing End Function Public Sub LoadBMPFile(ByVal FileName As String) Implements IManage.LoadBMPFile bmp = New Bitmap(FileName) End Sub Public Sub SetJPGQuality(ByVal Quality As Integer) Implements IManage.SetJPGQuality JPGQuality = Quality End Sub Public Sub SaveJPGFile(ByVal FileName As String) Implements IManage.SaveJPGFile Dim eps As System.Drawing.Imaging.EncoderParameters = New System.Drawing.Imaging.EncoderParameters(1) eps.Param(0) = New System.Drawing.Imaging.EncoderParameter(System.Drawing.Imaging.Encoder.Quality, JPGQuality) Dim ici As System.Drawing.Imaging.ImageCodecInfo = GetEncoderInfo("image/jpeg") If Not bmp Is Nothing Then bmp.Save(FileName, ici, eps) End If End Sub End Class Public Interface IManage Sub LoadBMPFile(ByVal FileName As String) Sub SetJPGQuality(ByVal Qualtity As Integer) Sub SaveJPGFile(ByVal FileName As String) End Interface
I don't see Methods of the Manage class in Navision, but i see those of the IManage.
Thanks.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions