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

  • SEARCH
  • Home
  • 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 9002241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:32:37+00:00 2026-06-16T00:32:37+00:00

I have a C function that the doxygen looks like this: long function( classA

  • 0

I have a C function that the doxygen looks like this:

long function( classA * obj1,
               classB * obj2,
               classC ** obj3,
               long value,
               const char * name1,
               const char * name2,
               classD ** obj4,
               classD ** obj5,
               classD ** obj6 
               )    

I need to call it from python and get the 3 last arguments to pass to another dll. Currently I can call the DLL fine, but if I try to pass the last 3 arguments to the other function I get an error like this:

WindowsError: exception: access violation writing 0x0000000000000000

I am probably doing something wrong in the ctypes side of things and I would appreciate some light on how to use it…

The second DLL looks like this:

int function2(ClassD *  obj4)   

And currently I “assemble” the last 3 arguments like this:

  temp=ctypes.c_long*1
  obj = temp(0)

Also, is there any way of going from ctypes to swig? Apparently I can do the other way around using the long function.

  • 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-16T00:32:38+00:00Added an answer on June 16, 2026 at 12:32 am

    I had to do some extra digging to figure out how C-types works and the following seems to work. For function I needed to create an array:

    arg = (ctypes.POINTER(ctypes.c_double) * 1)()
    

    and pass it by reference to the function:

    ctypes.byref(arg)
    

    For the second function I would just pass one element of the array I created:

    arg[0]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list of objects MyObject and that looks like this: var Obj1
i have this function that brings me back a value by query a table
I have a function that does a long task and I want to update
I have a function that has this line: var returnString:String = items[0].@month; @month is
We have a function header format that we have to follow. It basically looks
We have a function header format that we have to follow. It basically looks
Okay, I have written a function that should convert HSL color value to RGB.
This is the function that I have function set(sub) { var input = prompt(Insert
I have function that receives an array of pointers like so: void foo(int *ptrs[],
could you please help me understand this. I have function that needs char ***argv

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.