It is currently Mon Apr 06, 2020 10:27 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: calling a dll created in vb.net 2010
PostPosted: Fri Dec 16, 2011 2:59 am 
Offline
User
User

Joined: Thu Jan 22, 2009 8:05 am
Posts: 86
Location: USA
Have been searching and searching with no luck, so it's time so finally post.. Can anyone tell me how to call a vb.net dll in pure basic?

I made a vb.net dll in visual studio 2010 (file->new->project->class library)

It looks like this basically
Code:
Public Class MyClass
    Public Function test()
        Return 12
    End Function
End Class


And in pure basic, I can open the library fine... However, I cannot examine the functions.
Code:
If OpenLibrary(0, "MyDll.dll")
  Debug "Opened Library..."
  returnValue = CallFunction(0, "test")
  Debug "returnValue: " + Str(returnValue)
  CloseLibrary(0)
EndIf


So that returnValue is 0 and I also get 0 when using ExamineLibraryFunctions. Seems like this should be simple, but I'm agitated beyond belief at the moment. Would really appreciate any help! Thanks for your time.

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: calling a dll created in vb.net 2010
PostPosted: Fri Dec 16, 2011 6:09 am 
Offline
Always Here
Always Here

Joined: Fri Oct 23, 2009 2:33 am
Posts: 6099
Location: Wales, UK
..... I'm often wrong but does that imply dependency on the .Net runtime?

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
Reply with quote  
 Post subject: Re: calling a dll created in vb.net 2010
PostPosted: Fri Dec 16, 2011 6:29 am 
Offline
User
User

Joined: Thu Jan 22, 2009 8:05 am
Posts: 86
Location: USA
IdeasVacuum wrote:
..... I'm often wrong but does that imply dependency on the .Net runtime?

Yeah, I'm sure it would. Crazy, but that's not a big deal for me.

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: calling a dll created in vb.net 2010
PostPosted: Fri Dec 16, 2011 7:46 am 
Offline
Addict
Addict
User avatar

Joined: Fri Jan 21, 2011 8:25 am
Posts: 1021
Location: 'stralia!
You can't do that that easily. There might be a way using COM but you probably have to
consider if it's worth just to write the app in .NET completely. :wink:

_________________
Image
Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds


Top
 Profile  
Reply with quote  
 Post subject: Re: calling a dll created in vb.net 2010
PostPosted: Fri Dec 16, 2011 11:20 am 
Offline
User
User

Joined: Sun Mar 06, 2011 4:58 pm
Posts: 17
If someone can help port this Power Basic code to Pure Basic, then you can call a Dot Net DLL
http://powerbasic.projectmayu.dyndns.org/


Top
 Profile  
Reply with quote  
 Post subject: Re: calling a dll created in vb.net 2010
PostPosted: Mon Dec 19, 2011 4:41 pm 
Offline
Moderator
Moderator
User avatar

Joined: Sat Apr 26, 2003 1:11 am
Posts: 1393
Project Mayu wrote:
If someone can help port this Power Basic code to Pure Basic, then you can call a Dot Net DLL
http://powerbasic.projectmayu.dyndns.org/

similar:
viewtopic.php?f=12&t=40058

_________________
SPAMINATOR NR.1


Top
 Profile  
Reply with quote  
 Post subject: Re: calling a dll created in vb.net 2010
PostPosted: Mon Dec 26, 2011 3:41 am 
Offline
User
User

Joined: Sun Mar 06, 2011 4:58 pm
Posts: 17
Rings wrote:

Similar, but a pain in the x to use, you have to register a COM object in order to use it. If not registered, then program will crash.

And that is why I came up with the proper way to do it, if it's there then use it, If not program can still continue.
If you have Powerbasic, then you could make a dll to do it, else translate the code to Purebasic.

I did start translating my code a while back, but stopped due to lack of time, and lack of Purebasic knowledge.
I still want to do it though, so I can run in x64 CPU's.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye