VO-DLL as DLL for programma in another language

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
Post Reply
dirk@triviant.be
Posts: 13
Joined: Tue Sep 27, 2016 7:49 am

VO-DLL as DLL for programma in another language

Post by dirk@triviant.be »

Hi all,

I have to write a DLL which will be used as DLL for a program written in another win32-language (no dotNet).
This VO-DLL has to read/write to DBF-files, so VO is good in it.

So, the problem is the following:

Program 1 = Prog1 = Maybe written in another language, but problem also exist if this program is written in VO.
DLL1 = MyTestDLL.DLL = This DLL will be dynamic loaded with the function LoadLibrary()
DLL2 = MyBasicDLL.DLL = This DLL is hardcoded with DLL1

Inside DLL2, there is een method called CenterWindow() class Window.
There exist also a Window with the name Splash, and there is a call to oSplash:CenterWindow{} just before the super:Show().
This DLL compiles fine.

In DLL1, the program create an object oSplash := Splash{}. When calling the Show() method, the program crashes with the error "No exported method" CenterWindow.

When DLL1 is hardcoded linked on my testprogram, than everything goes fine.

Attached are all files.

Is there someone who can help me?

Thanks, Dirk
Attachments
MyBasicDLL.zip
3 x AEF
(5.1 KiB) Downloaded 46 times
User avatar
wriedmann
Posts: 3748
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Re: VO-DLL as DLL for programma in another language

Post by wriedmann »

Hi Dirk,
the best way would be to write a COM DLL that can be used with most different programming environments.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
dirk@triviant.be
Posts: 13
Joined: Tue Sep 27, 2016 7:49 am

Re: VO-DLL as DLL for programma in another language

Post by dirk@triviant.be »

Hi Wolfgang,

Is there somewhere an example how I have to write a COMM DLL?

Dikr
dirk@triviant.be
Posts: 13
Joined: Tue Sep 27, 2016 7:49 am

Re: VO-DLL as DLL for programma in another language

Post by dirk@triviant.be »

Hi All,

I know you have to call __VODLLClassInit() after the loadlibrary() but still not working.

Is there someone else with a lot of experience ?

Cheers, Dirk
dirk@triviant.be
Posts: 13
Joined: Tue Sep 27, 2016 7:49 am

Re: VO-DLL as DLL for programma in another language

Post by dirk@triviant.be »

Hi Wolfgang,

The real problem is NOT the communication between the DLL and the EXE.

The real problem is that methods of a class are not visible for child-classes.
For exemple

method Center() class Window
//do something
return nil

Class Splash inherit Window
method Show() class Splash
self:Center() --------------------------> CRASH !!! (no exported method!)
super:Show()
return nil

So, this his nothing to do with COM.
See my attachments for a very small (10 lines) application !!!

(I still hope you can help me)

Cheers, Dirk
User avatar
wriedmann
Posts: 3748
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Re: VO-DLL as DLL for programma in another language

Post by wriedmann »

Hi Dirk,
unfortunately I do not know how to write a X# DLL to be used by a non .NET application - only Robert can help you here, I think.
But I think the problem with the subclass cannot be solved as it may be a limitation of the DLL interface. Again, only Robert can help you here.

For a sample how to write a COM DLL, please see here:
https://docs.xsharp.it/doku.php?id=com_module_sample
https://docs.xsharp.it/doku.php?id=com_module_sample_vs

But I do not know if there the use of a method in a subclass works, because I do not think the COM interface cannot define class relations (and inheritance), and therefore there is no possibility to tell the interface to call the method of the father class.

Unfortunately, I would see only one possibility: define a generic "send" method in your interface that in fact uses Reflection to call the desired method.

But maybe Robert has a better idea.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
dirk@triviant.be
Posts: 13
Joined: Tue Sep 27, 2016 7:49 am

Re: VO-DLL as DLL for programma in another language

Post by dirk@triviant.be »

Hello Wolfgang,

Indeed. I hope that Robert will look to this problem.

(PS: I'm not writing a X#-DLL, but a VO-DLL !)

Kind regards, Dirk
User avatar
robert
Posts: 4478
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Re: VO-DLL as DLL for programma in another language

Post by robert »

Dirk,
Can you send me an example of what you're trying to do?
It sounds like the GUI classes are not correctly initialized.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
dirk@triviant.be
Posts: 13
Joined: Tue Sep 27, 2016 7:49 am

Re: VO-DLL as DLL for programma in another language

Post by dirk@triviant.be »

Hi Robert,

I have send it to your e-mail.

Dirk
Post Reply