# Xojo Error when calling dll

**URL:** <https://forum.xojo.com/t/xojo-error-when-calling-dll/80331>\
**Category:** Windows\
**Created:** [May 16, 2024, 8:58am UTC](https://forum.xojo.com/t/xojo-error-when-calling-dll/80331 "2024-05-16T08:58:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![全\_毕](https://forum.xojo.com/letter_avatar_proxy/v4/letter/%E5%85%A8/22d042/32.png) [@全\_毕](https://forum.xojo.com/u/%E5%85%A8_%E6%AF%95)\
**Post date:** [May 16, 2024, 8:58am UTC](https://forum.xojo.com/t/xojo-error-when-calling-dll/80331/1 "2024-05-16T08:58:29Z")

</div>

`  
//Declare Function ltcdump Lib “E:\LTC\FileRe\dlltest\a\WaveOutLtc.dll” (filename As CString, fps\_num As Integer, fps\_den As Integer, channel As Integer, first\_timecode As CString, last\_timecode As CString, RedFps As Integer) As Integer  
Declare Function ltcdump Lib “./WaveOutLtc.dll” (filename As CString, fps\_num As Integer, fps\_den As Integer, channel As Integer, first\_timecode As CString, last\_timecode As CString, RedFps As Integer) As Integer  
//Declare Function ltcdump Lib “E:\LTC\FileRe\dlltest\a\WaveOutLtc.lib” (filename As CString, fps\_num As Integer, fps\_den As Integer, channel As Integer, first\_timecode As CString, last\_timecode As CString, RedFps As Integer) As Integer

dim my\_first\_timecode As CString dim my\_last\_timecode As CString dim my\_fps As Integer Dim result1 As Integer result1 = ltcdump(“E:\LTC\FileRe\dlltest\a\Rec 0002.wav”, 30, 1, 1, my\_first\_timecode, my\_last\_timecode, my\_fps) MsgBox("The my\_first\_timecode is: " + Str(my\_first\_timecode)) MsgBox("The my\_last\_timecode is: " + Str(my\_last\_timecode))

`

This dll was written in C. I have no problem calling it in C. The function is as follows `int __declspec(dllexport) ltcdump(char* filename, int fps_num, int fps_den, int channel, char* first_timecode, char* last_timecode,int RedFps) `

Runtime ErrorPress OK to ContinuePress Cancel to Quit. Please report what caused this erroralong with the information below. Common\Loaders\Loader.cpp:173Failure Condition: 0Failed to load library ./waveQutLtc.dllThe specified module could not be found

---

<div class="post-metadata">

**Author:** ![kevin\_g](https://forum.xojo.com/letter_avatar_proxy/v4/letter/k/65b543/32.png) [@kevin\_g](https://forum.xojo.com/u/kevin_g)\
**Post date:** [May 16, 2024, 9:08am UTC](https://forum.xojo.com/t/xojo-error-when-calling-dll/80331/2 "2024-05-16T09:08:32Z")

</div>

Are the targets compatible (ie: 32 bit build must use a 32 bit dll / 64 bit compile must use a 64 bit dll).

---

<div class="post-metadata">

**Author:** ![Andrew\_Lambert](https://forum.xojo.com/user_avatar/forum.xojo.com/andrew_lambert/32/215_2.png) [@Andrew\_Lambert](https://forum.xojo.com/u/Andrew_Lambert)\
**Post date:** [May 16, 2024, 9:27am UTC](https://forum.xojo.com/t/xojo-error-when-calling-dll/80331/3 "2024-05-16T09:27:46Z")

</div>

> [@全\_毕](#):
>
> Declare Function ltcdump Lib “./WaveOutLtc.dll”

Don’t use `./` in the lib name. If the DLL is in the same folder as the EXE then use the filename only.

`Declare Function ltcdump Lib "WaveOutLtc.dll"`

---

<div class="post-metadata">

**Author:** ![Tim\_Hare](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_hare/32/176_2.png) [@Tim\_Hare](https://forum.xojo.com/u/Tim_Hare)\
**Post date:** [May 16, 2024, 7:25pm UTC](https://forum.xojo.com/t/xojo-error-when-calling-dll/80331/4 "2024-05-16T19:25:18Z")

</div>

If this is a Run (debug) action, make sure you’re copying the dll into the debug folder.
