Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / usage of external, non-dbpro dlls. need help

Author
Message
zero32
User Offline
Joined: 28th Jul 2016
Location:
Posted: 27th Jan 2017 14:10
Hi, i need some help. I try to get openCV to work with dbpro. i found some c code that looked like i can translate the code to dbpro. but i always get the error "could not call dll function".
can openCV even be used by dbpro?

i used alot of windows api functions and there was almost always an ansi and a unicode version of the same command, that did not need to be definded in c++ and was a somewhat hidden information on msdn. i don't know if any of that applies to openCV.

here is my code:
+ Code Snippet
WickedX
8
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 27th Jan 2017 16:57 Edited at: 27th Jan 2017 17:25
1: opencv_ffmpeg320.dll does not contain the function cvLoad.
2: You are missing the file parameter in your call to cvLoad.

By the look of the download, I think you need to build the OpenCV library. You should find instruction on how to build the library on the OpenCV website.

OpenCV seems to use a lot of structures, I don't think can be set up in DBPro.
zero32
User Offline
Joined: 28th Jul 2016
Location:
Posted: 27th Jan 2017 21:31
ok, i just checked the website and it looks like the dll is just the ffmpeg plugin for opencv. also checked the dll with dll export viewer to see the actual functions that are inside. cvLoad is not one of them.
the error was simply between chair and keyboard, i will try to build opencv.

question solved, thanks
Rudolpho
11
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 2nd Feb 2017 07:20
WickedX wrote: "OpenCV seems to use a lot of structures, I don't think can be set up in DBPro."

While quite the ardorous workaround, you can use make memory or the memblock functionality to read structure data. You just have to be aware of byte alignments and sub-structure sizes and so on, which can easily be reverse-engineered. A pointer is always 4 bytes in a 32-bit application, or 8 in a 64-bit one. Things are simplified here by the fact that DBPro can't use 64-bit plugins, so all you have to do is sum up structure sizes from the byte sizes of their primitive members, 4 bytes per pointer and adhere to possible alignments or byte boundary offsets.

Login to post a reply

Server time is: 2017-06-24 19:53:11
Your offset time is: 2017-06-24 19:53:11