Xojo for IOT and Dll?

hi, my company planning to user xojo for coming projects. So i am here to get some answers regarding few essential requirements of the upcoming projects.

  1. As Xojo can not create dll , can it use dll created using others (example:Pure Basic, Visual C++… )
  2. If can (1) any simple tutorial?
  3. Is Xojo will be good option for IOT projects?

Thanks in advance.

1 . yes (many discussions on this forum)

  1. see #1 (simple is relative)

  2. one limiting factor… imagination

https://duckduckgo.com/?q=DLL+site%3Ablog.xojo.com&ia=web

[code]using System;

namespace CreateDll
{
public class Testing
{
public int SumValue(int a , int b)
{
return a + b;
}
}
}[/code]

i created a simple dll named “CreateDll.dll” using c# . now how i gonna use it through Xojo. Can someone help? TIA

Soft Declare Function Testing Lib "CreateDll.dll" (a As Int32, b As Int32) As Int32 Dim result As Int32 result = Testing(1, 2)

See here for more information:

http://developer.xojo.com/declare
http://developer.xojo.com/windows-declare-samples
https://blog./2017/01/22/windows-to-xojo-data-type-conversion/

The examples mentioned in the 2nd link are good resources included with Xojo (see File>New>Examples)

is also a good resource for declare examples, just search the repo for “declare” to see where they are used but be careful as a lot of them aren’t 64bit “safe” as they were implemented waaay back.

Let me know if you have any more Q’s :slight_smile:

Thank you Julian. I have tried it …now i am getting FunctionNotFoundException (could not load Testing from CreateDll.dll)
How do the program find this particular dll file. like if its in D:\xojotest\example\CreateDll.dll . do i need to move it?
I tried the following but same error

Soft Declare Function Testing Lib "D:\\xojotest\\example\\CreateDll.dll " (a As Int32, b As Int32) As Int32 Dim result As Int32 result = Testing(1, 2)

developer.xojo.com is down? does not load …
Thanks again

You need to build machine code and not managed code DLL. And you need to export function for C.

And you can’t export a class, only global functions.

can anyone share a working sample of calling a dll ? if possible also that sample dll itself. I am new to xojo and we are looking for ways to not only know how to use the dll from xojo but also how we can create custom dll if required. We are planning to shift from c# to Xojo. So creating dll using visual studio is not an option anymore(also it creates managed code as Christian mentioned). Now By which tool or language we can create dll which can be accessed from Xojo with declare function?
And where should i place the dll for a sample project. As forum says it need to in executable directory. does that mean beside the project binary? or i have to build the project ? so many questions(sorry about that). I really need to know and practice hands on so we can work in coming project. The forum does not explicitly provides easy instruction for novice xojo users nor the documentation for the dll use.
http://developer.xojo.com/windows-declare-samples is not loading (Probably blocked in my office.)

that link worked for me

Before I put an answer together, could you let me know why you need to create a DLL? There might be an alternative route to what you’re trying to achieve that you’ve not thought about.

@JulianS my boss wants to move to xojo form c# . As per his instructions we will be required to create our own dll and use it. (I was asked to get all the answer regarding xojo) So as xojo can not create dll we are looking for the answer that it can use dll created by what language or tool.
if not c# and visual studio what are the other option to create dll. any idea purebasic dll is accessible from xojo. we tried both c# and purebasic dll but getting functionNotFound Error. Thanks

For my own education… why go thru the trouble to create DLL? is there some unique process your application must perform that only a DLL archtecture could support?

Thanks all for the replies. I managed to run a dll created from purebasic from xojo. The dll was collected from online.

Earlier dll’s we created using purebasic were getting FunctionNotFound error. so Instead of using “Soft Declare” i used “Declare” which shows another error which is “Failed to load lib, not a valid win32 application”. Now looking to resolve the not valid win32 application error.
Thanks for all the replies. Will post here if managed to solve current issue.

Just curious: Is this the kind of thing a novice would be expected to be doing?

you did not tell us what these DLL do. are they really mandatory ?

You certainly can use *.dll files compiled with PureBasic but if you compile your Xojo application as 32bit you have to make sure you use a dll compiled with the 32bit version of the PureBasic compiler.

Edit:
PureBasic doesn’t (currently) compile for ARM so it’s not so useful for IoT.