Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8996169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:43:06+00:00 2026-06-15T23:43:06+00:00

I am clueless how I should convert the following API to VB.NET Private Const

  • 0

I am clueless how I should convert the following API to VB.NET

Private Const MAXPNAMELEN As Long = 32&

Private Type JOYCAPS
wMid As Integer
wPid As Integer
szPname As String * MAXPNAMELEN
wXmin As Long
wXmax As Long
wYmin As Long
wYmax As Long
wZmin As Long
wZmax As Long
wNumButtons As Long
wPeriodMin As Long
wPeriodMax As Long
End Type

Private Declare Function joyGetDevCaps Lib "winmm.dll" Alias "joyGetDevCapsA" (ByVal id As Long, lpCaps As JOYCAPS, ByVal uSize As Long) As Long

I tried some converters, but what they output was not working.
If anybody is really good, could he try to convert it for me and show me how to call it?
Especially, I don’t know how to instantiate the JOYCAPS when passing it to the function.

I did not find this function on pinvoke.net.

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T23:43:07+00:00Added an answer on June 15, 2026 at 11:43 pm

    I can’t test it, but this should be the straightforward conversion:

    Private Const MAXPNAMELEN As Integer = 32
    
    <StructLayout(LayoutKind.Sequential)>
    Private Structure JOYCAPS
        Public wMid As Short
        Public wPid As Short
        <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=MAXPNAMELEN)>
            Public szPname As String
        Public wXmin As Integer
        Public wXmax As Integer
        Public wYmin As Integer
        Public wYmax As Integer
        Public wZmin As Integer
        Public wZmax As Integer
        Public wNumButtons As Integer
        Public wPeriodMin As Integer
        Public wPeriodMax As Integer
    End Structure
    
    <DllImport("winmm.dll")>
    Private Shared Function joyGetDevCaps(id As IntPtr, ByRef lpCaps As JOYCAPS, uSize As UInteger) As Integer
    
    End Function
    

    It assumes System.Runtime.InteropServices is imported.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am absolute clueless why the following code keeps throwing NullpointerExceptions. I was not
I am clueless here... 1: private static class ForeignKeyConstraint implements Comparable<ForeignKeyConstraint> { 2: String
I'm Begginer in ASP.net and new here So I hope I'm following the post
This should be an easy one, but without ViewState, I'm clueless here (I've been
(Warning: Clueless Rails Newbie!) In my show.html.erb for my albums view, I call a
I'm clueless when it comes to PHP and have a script that emails the
I'm trying to debug a strange problem I'm having , and I'm absolutely clueless
I'm getting a loss of precision error when there should be none, AFAIK. this
I have been using SDL with success to learn OpenGL, however I am following
I've been researching on building web applications in a true client-server fashion. This type

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.