|
Hello everybody,
I'm developping in Delphi 2005 and my question is if it's possible to compile a dll with MAthlab and to use it with Delphi for my software.
Thanks for your help.
|
|
|
|
|
I also programmed in Delphi, and interested for Malab libraries first to use them in Delphi. Later, I started with Borland Cpp.
Unfortunately, there is no much hope for Delphi. Matlab generate function declarations, and already have header files for its libraries. If you want to use this libraries, you must rewrite these declarations in Delphi, and even after that I think it would't work. For dinamical linking it is harder and I don't know the solution.
|
|
|
|
|
Please helpme!!!
I have a simple function in MatLab 7 R14 Sp1:
function DispMsg;
msgbox('Success','Message Title');
I compiled it with MatLab compiler version 4.1 with this command:
mcc -W lib:DispMsg -T link:lib DispMsg.m
When I use the following VB6 code I get an error #453 Can't find DLL entry point...
Private Declare Function DispMsg Lib "D:\Data\DLL Compiler\DispMsg.dll" () As Long
Private Const DEF_SCRIPT_DLL As String = "D:\Data\DLL Compiler\DispMsg.dll"
Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long
Private Sub cmdCallDll_Click()
On Error GoTo PROC_ERR
Dim lngRet As Long
Dim ret As Integer
' -- Works as expected
lngRet = LoadLibrary(DEF_SCRIPT_DLL)
If lngRet <> 0 Then
' -- Should call a simple messagebox
Call DispMsg '<- Raises error
' -- Check
If ret = 0 Then
MsgBox "Call to TestScript failed ", vbExclamation, "DLL Test"
Else
' Add code...
End If
Else
MsgBox "Could not load dll '" & DEF_SCRIPT_DLL & "' ", vbExclamation, "DLL Test"
End If
PROC_EXIT:
' -- Clean up
If lngRet <> 0 Then FreeLibrary lngRet
Exit Sub
PROC_ERR:
Err.Source = "modCode::Main(Sub)"
MsgBox Err.Description & vbCrLf & vbCrLf & _
"Error Number " & Err.Number & vbCrLf & _
"Error Source " & Err.Source & " ", vbExclamation, "DLL Test"
Debug.Print Err.Description
Resume PROC_EXIT
End Sub
I will appreciate any suggestions.
Boris
boris_velen@swissre.com
Boris
boris_velen@swissre.com
|
|
|
|
|
hey icesktr1
have u got a solution ?
bcz I also need the solution ...
plz let me know how to connect between VB6 and Matlab
I will be waiting ..
kindly contat me
kashifishaq@msn.com
|
|
|
|
|
Please can u help me because i want to use c++ dll through matlab and i don't know how.
please help me, it's urgent ...
urgent !
|
|
|
|
|
Hello all.
I have C++ ver 6.0 on my computer and matlab R12 on another computer (license problems).
I have followed math works insrturctions for Solution Number: 1-18CBI, which is "How do I create a C - shared library with MATLAB Compiler 3.0".
Due to the different computer problem i have copied matlab libraries which are required to be included in the C++ project
$MATLAB\extern\include\cpp;
$MATLAB\extern\include;
$MATLAB\extern\lib\win32\microsoft\msvc60;
This doesnt work !!!! how come?
at the begining i had to add some *.dll and *.h files.
when i have finished, nothing happens and the c++ says it has an external link problem
pls advise.
Regards
Udi
|
|
|
|
|
I try to compile your exemple in matlab(6.5): mcc -t -L C -W lib:MeanFunctionLib -T link:lib MeanFunction.m libmmfile.mlib but I have error with mcc.dll . why?????????please help me.
Thanks
I whould to use it in builder c++(6.0)
lamionne
-- modified at 13:52 Saturday 18th March, 2006
|
|
|
|
|
Hi lamionne,
were you able to Solve the error of mcc.dll. I am geeting the same error with all the matlab codes. Is there any setting which needs to be changes.
Kindly help me out.
regards.
Kumar Shwetaketu
India.
|
|
|
|
|
I havn't too mutch time.I need a librerie whitch solves quadratic programs ,or via matlab(quadprog).how ca I do this.I develop in builder c++(6.0).
Thanks
lamionne
|
|
|
|
|
I work with builder c++ (6.0)
and I want to use matlab's function witch is quadprog.
I try to build it but I have an error message in relation with mcc.dll.
please help me
lamionne
|
|
|
|
|
Hi there,
how are you doing?
I want help in image processing toolbar, iam making project (for image
enhancement and motion detection) functions in and want to
conver
them in .dll and connect it with the C# project
How to return value from matlab functions as images into C# (as bitmap)
PLEASE URGENT HELP REQUIRED, I HAVE COMPLETED THE MATLAB FUNCTIONs AND
NOW HAVE TO CONNECT WITH THE C#.......
THANKING YOU
HAROON, ISB PK
There are Things you cannot Do, and there are Words you cannot Say
|
|
|
|
|
Dear A. Riazi,
Salam Alekum Wa Rahmet Allah Wa Barakatuh.
I have probelm in converting my MATLAB program to C code. So can u help me concerning this problem.
I already tried to use mcc command with all appotinuity which this command offers.
I am needing a solution for urgent.
Appreciate your cooperation previously
|
|
|
|
|
Please help.
I'm getting the error, when I'm trying to execute the project:
Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
First-chance exception in MatlabSharedLib.exe: 0xC0000005: Access Violation.
|
|
|
|
|
Do you get this when executing the mclInitializeApplication (NULL , 0); ?
Or when executing the "YourLib"Initialize() ?
In case of the first, be sure to have the DLL and the CTF at the same place as your EXE.
Also, you can enter the path to the CTF (what happens to be the same as to your exe) in the project properties unter "General - Debugging - Working Directory".
In case of the second, I would be glad to have that solved.
I am thinking that there is some conflict with DLLs of mine, but I have no idea how to get rid of it.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Hi,
I have the same problem on VC++ 6.0, windows XP, SP2.
If you remove mclInitializeApplication(...) function call the error will dissapear.
When I compile my project i don't have any error or warning but when i try to debug it the "First-chance exception in liba.exe: 0xC0000005: Access Violation." debug message appear and the execution is broken in mainCRTStartup().
I notice that i'm using liba.lib and mclmcr.lib to link it(liba.lib is the library generated by Matlab Compiler for my matalb function). In the same time the CTF and DLL files are in the same place with the exe file.
Can you help me in this way?
|
|
|
|
|
Bonta Marian S wrote: If you remove mclInitializeApplication(...) function call the error will dissapear.
But then you are unable to call matlab-code, as it is uninitialized...
Bonta Marian S wrote: "First-chance exception in liba.exe: 0xC0000005: Access Violation."
"First Chance exceptions" are normal. It seems as if the Matlab-guys use exeptions as normal ways of code control.
In the debugger, you can select somewhere, that you only want to break on second chance-exceptions, that is unhandled exceptions.
I am sorry that I can not point out where it is or what the exact name of the setting is, but I am using only VC 2003 and 2005.
-- typo fixed at 13:11 Wednesday 4th July, 2007
Failure is not an option - it's built right in.
|
|
|
|
|
Hi,
It's seems to be some problems when you try to use this method (MATLAB Shared Library) on VC++ 6.0.
To avert this problem you can use MATLAB Visual Add-in feature. This feature is available from Matlab 7.x and offers you a simple method to use the Matlab code.
|
|
|
|
|
I am a new user. I have a library and I want to add it to the system that I have. Can someone please help me out. I already do have the library but I want to add it to the system that I have
|
|
|
|
|
have a simple M-file in matlab environment, i want to work it in C# .NET
function y = foo(x)
y = x+1;
first of all i compil the Mfile to COMObject ,i use matlab 'mcc' function :
mcc -B 'ccom:addin,addin,1.0' foo.m
i basic on this sample :
-t -W com:<component_name>,<class_name>,<version> -T link:lib
in this link : http://www-rohan.sdsu.edu/doc/matlab/toolbox/compiler/mcc.html
secondly i open a winApplication in .NET 2003 and add the dll in 'Add
References'
after that i create a new object from the dll that matlab compiler
build (addin.dll in my case),and try to usa it , the .NET recognize
and fill my after dot foo founcatio.
i try to run it and get a Runtime Error !:
"Microsoft Visual C++ Runtime Library
abnormal program temination"
if u can help me , i be grateful.
Thx
|
|
|
|
|
do you get the same error if you access it from VB or Excel VBA?
try entering a return in the end and then compile. that might fix it.
|
|
|
|
|
|
I am trying to build a shared library (DLL) from m-File.The problem is that I need to use the graphics library.I know that I must bundle the libmwsglm.mlib library(using the command mcc) but I couldn't find how do it . Now I'm looking for a way to create a .dll (using graphics library)and after use it for example in C#.I think that somebody can help me and your help will be very useful for me.
Regards,
Marcel
|
|
|
|
|
Hi:
Does some body know how to compile this example using Matlab 7(R14) and Visual C.Net
Thanks
Pedro Luis Sanchez Orellana
|
|
|
|
|
|
I use matlab 6.5 and MS .NET 7.0 and I've done the following two trial:
In my console application (.NET and WIN) and use:
- your original .dll function MeanFunction.
- MY own .dll function that use your original .dll function MeanFunction.
It is OK.
But if I use in MATLAB
mcc -t -L C -W lib:MeanFunctionLib -T link:lib MeanFunction.m libmmfile.mlib
to produce .dll then MATLAB generate different (wrong) MeanFunctionLib.dll file. I get a running mistake. Everything is the same. But MATLAB generate wrong file. I use default compilator.
Do you have an idea ... ???
|
|
|
|