Click here to Skip to main content
15,892,517 members
Please Sign up or sign in to vote.
4.50/5 (2 votes)
See more:
I've created a dll in Matlab 2008 and i want to call it in VS 2008.
when i add the header of created library, the pointer of
mxCreate NumericMatrix return 0x0000000 and access violation error is produced in memcpy().
but if the header is removed the mentiond procedure works properly.
do anyone know the problem?
tnx.
Posted
Comments
Richard MacCutchan 19-Oct-10 11:25am    
Without seeing the actual code it's anyone's guess.
Paul Heil 1-Nov-10 16:11pm    
Does your application compile without warnings? What if you bump it up to warning level 4?

Does your header contain anything other than function definitions? static int some_variable = 0, for example? If it does, are you sure those aren't defined elsewhere?

-PaulH

1 solution

the access violation in memcpy is simply because of the failed mxCreateNumericMatrix call, so its somewhat pointless to point that out... don't forget to include the "matrix.h" file as specified in the matlab website:
http://www.mathworks.com/help/techdoc/apiref/mxcreatenumericmatrix.html[^]

i'm not sure if this header is typically included in the default header created when you make your own dll from matlab code...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900