Solved

Calling GetScrollInfo (API Function) from VB

Posted on 2000-03-24
7
551 Views
Last Modified: 2013-12-25
I am trying to call the API function GetScrollInfo()
SetScrollInfo()
From VB..

But I cannot find a VB function to replaced a C function sizeof() which will be used in the calling procedure.

Please help with an simple example
to call GetScrollInfo() & SetScrollInfo() in VB.
0
Comment
Question by:Seles
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 10

Expert Comment

by:caraf_g
ID: 2652590
There is no equivalent. But it's not really a problem: just work out the size manually.

E.g... let's say your API uses a POINTAPI struct:

Private Type POINTAPI
    x As Long
    y As Long
End Type

In C you'd use SizeOf. In VB just use the fact that a Long is 4 characters, so pass in 8 hard coded. Yep, it's not as portable as C, but it will do the trick.

If you're having trouble working out the size of your struct let me know and I'll have a look at it.
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 2653623
Any good?
0
 
LVL 9

Accepted Solution

by:
Ruchi earned 70 total points
ID: 2654177
There is an example which is located at
http://vbaccelerator.com/codelib/ssubtmr/sbrclass.htm
0
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 

Author Comment

by:Seles
ID: 2659300
Adjusted points from 50 to 70
0
 

Author Comment

by:Seles
ID: 2659301
Finally, I find Sizeof()
can be replaced by LenB()

Please remind me if it is not completely correct.

Ruchi, caraf_g
You two also granted me useful help.
I will increase the points to 70
and let you two to SHARE them.

As Ruchi answer with an example, I will pass those 70 points to you and let you pass part of them to caraf_g.

0
 
LVL 10

Expert Comment

by:caraf_g
ID: 2659782
Hello Seles

LenB may be OK in certain circumstances, but it doesn't always work. Anyway, if it works for you it's good enough ;-)

Just a quick explanation about the Experts-Exchange point system - it's a bit confusing.

Ruchi cannot share the points with me, as the 70 points you gave to Ruchi will go towards Ruchi's Expert Points. Ruchi cannot pass those on to me. The only way Ruchi can give me points is by posting a dummy question "35 points for caraf_g". But that would require using Ruchi's question point which is a bit unfair on Ruchi.

But it's OK. I'm sure Ruchi deserves the points, so let's just leave it at that.

In order to split points, you can do one of two things.
1 - Ask Community Support (see hotlink at the bottom of every page) to help you split the points. You can post a 0-point question in the CS topic area.
2 - Post a dummy question yourself.

Anyway.... glad I could be of some assistance!
0
 
LVL 9

Expert Comment

by:Ruchi
ID: 2668203
Caraf, I have not seen a question posted by Seles in the Community Support area..... It's okay but you deserve the points, too!!! I am going to post a question now -- For Caraf --10316703 (I give you 52 (52.5??? )points; you earn 208 points because I earned 210 points for this.)
:)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month6 days, 9 hours left to enroll

634 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question