PC Review


Reply
Thread Tools Rate Thread

callback function

 
 
Ralph Heger
Guest
Posts: n/a
 
      15th Mar 2005
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



 
Reply With Quote
 
 
 
 
Tom Shelton
Guest
Posts: n/a
 
      15th Mar 2005
In article <(E-Mail Removed)>, 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]
 
Reply With Quote
 
Ralph Heger
Guest
Posts: n/a
 
      15th Mar 2005

"Tom Shelton" <(E-Mail Removed)> schrieb im Newsbeitrag
news:%(E-Mail Removed)...
> In article <(E-Mail Removed)>, 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]



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Callback function Jorge Ribeiro Microsoft Access VBA Modules 3 2nd Dec 2008 03:52 PM
CallBack Function In Win API =?Utf-8?B?UWluZ2RvbmcgWi4=?= Microsoft VB .NET 0 14th Jun 2006 12:09 AM
CallBack Function Gordon Padwick Microsoft Access Forms 7 19th Mar 2006 12:32 AM
Using callback function =?Utf-8?B?U2l2YXJhbWFuLlM=?= Microsoft ASP .NET 6 7th Aug 2005 11:07 AM
Callback Function Andrew Mckendrick Microsoft VB .NET 3 16th Sep 2004 04:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:12 PM.