Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sat Dec 07, 2019 2:56 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Calling Windows Function
PostPosted: Sat Mar 24, 2012 10:47 pm 
Offline

Joined: Sun Feb 19, 2012 4:49 am
Posts: 64
How to call a External DLL function from Real Basic

For eg) This is the function provided in the forum

#if TargetWin32 Then
Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Int32, ByVal nIndex As Int32, ByVal dwNewLong As Int32) As Int32
Const GWL_EXSTYLE = -20
Const WS_EX_TOOLWINDOW = &H80
Call SetWindowLong(Self.Handle,GWL_EXSTYLE,WS_EX_TOOLWINDOW)
#endif


It will be good if someone can explain this and please let me know the related documentation pages


Top
 Profile  
Reply with quote  
 Post subject: Re: Calling Windows Function
PostPosted: Sat Mar 24, 2012 11:02 pm 
Offline
User avatar

Joined: Mon Apr 02, 2007 2:08 am
Posts: 1225
Location: San Francisco, CA, USA
The documentation entry on the Declare statement ought to prove enlightening.

_________________
Boredom Software


Top
 Profile  
Reply with quote  
 Post subject: Re: Calling Windows Function
PostPosted: Sat Mar 24, 2012 11:39 pm 
Offline

Joined: Sun Feb 19, 2012 4:49 am
Posts: 64
Thanks !

Have anyone tried calling libs in 64 bit windows?


Top
 Profile  
Reply with quote  
 Post subject: Re: Calling Windows Function
PostPosted: Sun Mar 25, 2012 12:18 am 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
As long as the dll is 32-bit, there shouldn't be a problem. All the Win32 API calls work.


Top
 Profile  
Reply with quote  
 Post subject: Re: Calling Windows Function
PostPosted: Tue Mar 27, 2012 4:07 pm 
Offline

Joined: Sun Jul 31, 2011 11:30 pm
Posts: 31
Location: Iran
If you wanna use Win32 API in your projects, this might help you : http://allapi.mentalis.org/agnet/apiguide.shtml


Top
 Profile  
Reply with quote  
 Post subject: Re: Calling Windows Function
PostPosted: Tue Mar 27, 2012 4:36 pm 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
Personally I'd grab the WFS from the ARBP ( http://arbpmembers.org/ )
And I think even a free membership allows you to download code
Grab the WFS (Windows Functionality Suite) and if it does not already have the call you're looking for it will serve as a model of how to call things in Windows

_________________
Norman Palardy (Real Software)


Top
 Profile  
Reply with quote  
 Post subject: Re: Calling Windows Function
PostPosted: Tue Mar 27, 2012 4:46 pm 
Offline

Joined: Sat Mar 25, 2006 1:39 pm
Posts: 894
Location: Morgan Hill, CA
Nevercom wrote:
If you wanna use Win32 API in your projects, this might help you : http://allapi.mentalis.org/agnet/apiguide.shtml

That site has a "goodbye" post dated from 2002. I have to wonder how much the information on it might have changed. Are there any similar sites that are currently active you know of?

_________________
While fairly new to RB, I've been programming ever since that darned mastadon stepped on my abacus. Using RB 2009r5.1 on XP and Windows 7.


Top
 Profile  
Reply with quote  
 Post subject: Re: Calling Windows Function
PostPosted: Tue Mar 27, 2012 5:21 pm 
Offline

Joined: Sun Jul 31, 2011 11:30 pm
Posts: 31
Location: Iran
Well, WinAPI is not something that being updated every month !
Maybe couple of new APIs been introduced in Vista\7 (Like DWM API), but most of those API calls (If not all) still work.

and of course MSDN is the best reference for Windows Programming.


Top
 Profile  
Reply with quote  
 Post subject: Re: Calling Windows Function
PostPosted: Tue Mar 27, 2012 5:24 pm 
Offline

Joined: Sun Jul 31, 2011 11:30 pm
Posts: 31
Location: Iran
npalardy wrote:
Personally I'd grab the WFS from the ARBP ( http://arbpmembers.org/ )
And I think even a free membership allows you to download code
Grab the WFS (Windows Functionality Suite) and if it does not already have the call you're looking for it will serve as a model of how to call things in Windows

Isn't WFS 2.5 that is included in RS 2011 the latest ?


Top
 Profile  
Reply with quote  
 Post subject: Re: Calling Windows Function
PostPosted: Tue Mar 27, 2012 11:07 pm 
Offline

Joined: Sun Feb 19, 2012 4:49 am
Posts: 64
Thanks All. Will try it & update asap


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

All times are UTC - 5 hours


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 © 2000, 2002, 2005, 2007 phpBB Group