473,326 Members | 2,128 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

callback function

Hi

I want to use some functions from a C++-Library. I have to problems with
this:

1. I must not use the function-names as declared ('SoThis'), but with some
strange letters around
('?DoThisAEC@@YA?AW4S_RESULT@@QAX_N@Z).

2. The Lib wants to communicate through a callback-function. This works, my
function is called, but AFTER the 'end sub' my application crashes with a
windows-exception. Must be the moment where it jumps back to the library.

Any ideas with that?

Ralph

Nov 21 '05 #1
2 1321
In article <11***************@newsmaster-03.atnet.at>, Ralph Heger wrote:
Hi

I want to use some functions from a C++-Library. I have to problems with
this:

1. I must not use the function-names as declared ('SoThis'), but with some
strange letters around
('?DoThisAEC@@YA?AW4S_RESULT@@QAX_N@Z).

This caused because the author of the dll didn't export the functions
with friendly names. Your seeing the result of name mangling. You can
always alias the call in your declare so that you don't have to litter
your code with it :)
2. The Lib wants to communicate through a callback-function. This works, my
function is called, but AFTER the 'end sub' my application crashes with a
windows-exception. Must be the moment where it jumps back to the library.

Any ideas with that?


Maybe they dll is using the cdecl calling convention. You might change
your declare to use that method. See if it makes a difference.

--
Tom Shelton [MVP]
Nov 21 '05 #2

"Tom Shelton" <to*@YOUKNOWTHEDRILLmtogden.com> schrieb im Newsbeitrag
news:%2****************@TK2MSFTNGP12.phx.gbl...
In article <11***************@newsmaster-03.atnet.at>, Ralph Heger wrote:
Hi

I want to use some functions from a C++-Library. I have to problems with
this:

2. The Lib wants to communicate through a callback-function. This works,
my
function is called, but AFTER the 'end sub' my application crashes with a
windows-exception. Must be the moment where it jumps back to the library.

Any ideas with that?
Maybe they dll is using the cdecl calling convention. You might change
your declare to use that method. See if it makes a difference.


I found that with the <DLLImport>Attribute, which I use for declaring the
functions in the library for my application (no cdecl is needed), but not
with a function I have to write and which has to be called by the dll. Is
there something similar?

Ralph
--
Tom Shelton [MVP]

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Marian Aldenhövel | last post by:
Hi, I am using the FMOD audio-library with the pyFMOD python bindings. pyFMOD uses ctypes. It is possible to register callback functions with FMOD that are called at certain points in the...
4
by: ma740988 | last post by:
// file sltest.h #ifndef SLTEST_H #define SLTEST_H class CallbackBase // herb shutters gotW source .. { public: virtual void operator()() const { }; virtual ~CallbackBase() = 0; };
15
by: Felix Kater | last post by:
Hi, in a given library I register callback functions with this function: bool set_callback(int index, int (*callback_function)(long)); I need the callback function to also pass the index...
8
by: kurtcobain1978 | last post by:
-------------------------------------------------------------------------------- I need to do the exactly same thing in VB.NET. Load a unmanaged C DLL dynamically and then call a function in...
6
by: smmk25 | last post by:
Before I state the problem, I just want to let the readers know, I am knew to C++\CLI and interop so please forgive any newbie questions. I have a huge C library which I want to be able to use in...
2
by: Pradeep | last post by:
Hi all, Can any one explain me what is callback function.... I have written some code after reading some tutorials from internet... But I am not sure is it a right way to write a call back...
10
by: SQACPP | last post by:
Hi, I try to figure out how to use Callback procedure in a C++ form project The following code *work* perfectly on a console project #include "Windows.h" BOOL CALLBACK...
0
by: Tim Spens | last post by:
--- On Fri, 6/27/08, Tim Spens <t_spens@yahoo.comwrote: I think I know where the problem is but I'm unsure how to fix it. When I call Register_Handler(...) from python via...
6
by: jmDesktop | last post by:
In a function that takes another function (function pointer) as a argument, or the callback function, which is the one that "calls back"? I'm having a hard time understanding the language. Am I...
5
by: Jef Driesen | last post by:
I have a C DLL that I want to use from a C# project. The C header file contains these declarations: typedef void (*callback_t) (const unsigned char *data, unsigned int size, void *userdata);...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.