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
VO-DLL as DLL for programma in another language
-
- Posts: 13
- Joined: Tue Sep 27, 2016 7:49 am
VO-DLL as DLL for programma in another language
- Attachments
-
- MyBasicDLL.zip
- 3 x AEF
- (5.1 KiB) Downloaded 61 times
Re: VO-DLL as DLL for programma in another language
Hi Dirk,
the best way would be to write a COM DLL that can be used with most different programming environments.
Wolfgang
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
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
-
- Posts: 13
- Joined: Tue Sep 27, 2016 7:49 am
Re: VO-DLL as DLL for programma in another language
Hi Wolfgang,
Is there somewhere an example how I have to write a COMM DLL?
Dikr
Is there somewhere an example how I have to write a COMM DLL?
Dikr
-
- Posts: 13
- Joined: Tue Sep 27, 2016 7:49 am
Re: VO-DLL as DLL for programma in another language
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
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
-
- Posts: 13
- Joined: Tue Sep 27, 2016 7:49 am
Re: VO-DLL as DLL for programma in another language
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
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
Re: VO-DLL as DLL for programma in another language
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
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
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
-
- Posts: 13
- Joined: Tue Sep 27, 2016 7:49 am
Re: VO-DLL as DLL for programma in another language
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
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
Re: VO-DLL as DLL for programma in another language
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
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
The Netherlands
robert@xsharp.eu
-
- Posts: 13
- Joined: Tue Sep 27, 2016 7:49 am
Re: VO-DLL as DLL for programma in another language
Hi Robert,
I have send it to your e-mail.
Dirk
I have send it to your e-mail.
Dirk