Instability when calling a C++ DLL from VB.NET 
Author Message
 Instability when calling a C++ DLL from VB.NET

Hello all. I apologize in advance for the relatively vague description of my
problem, but here goes:

I have several C++ DLLs (some that I wrote, some black boxes that I have
from vendors), and I am calling their exposed subroutines from VB.NET. I
have declared all of the exposed subroutines as normal (occasionally, I do
use the shortcuts of $, #, &, etc. for argument declarations), and I have
been calling the subroutines.

In Visual Basic 6.0, everything works fine. However, I seem to be having
problems in VB.NET. Seemingly randomly, my code will throw an object null
reference exception when calling the subroutines. The only argument to most
of the subroutines is an integer, and the de{*filter*} tells me that the integer
does in fact exist and has a valid value. It fails only on calls to these
external DLLs, but it fails on different subroutines each time.

Any thoughts? One of the external DLLs is a VC++ 6.0 DLL, so perhaps that is
the problem? Unfortunately, that one's not mine, so any workarounds would be
appreciated. I tried wrapping all the calls in Try/Catches for the Exception
and just forcing them to try again. That works most of the time, but
occasionally, the damn thing gets too stubborn and falls into an infinite
loop.

Hopefully someone out there has at least experienced this behavior as well?
I have only found one veiled reference to something similar in Google, but
no one answered the poor guy.

Thanks in advance for any thoughts you might have!

-- Venk --



Thu, 27 Jan 2005 04:27:36 GMT  
 Instability when calling a C++ DLL from VB.NET
The experts on this are in the interop newsgroup. I added that newsgroup and
set followups to it.

Ronald


Quote:
> Hello all. I apologize in advance for the relatively vague description of
my
> problem, but here goes:

> I have several C++ DLLs (some that I wrote, some black boxes that I have
> from vendors), and I am calling their exposed subroutines from VB.NET. I
> have declared all of the exposed subroutines as normal (occasionally, I do
> use the shortcuts of $, #, &, etc. for argument declarations), and I have
> been calling the subroutines.

> In Visual Basic 6.0, everything works fine. However, I seem to be having
> problems in VB.NET. Seemingly randomly, my code will throw an object null
> reference exception when calling the subroutines. The only argument to
most
> of the subroutines is an integer, and the de{*filter*} tells me that the
integer
> does in fact exist and has a valid value. It fails only on calls to these
> external DLLs, but it fails on different subroutines each time.

> Any thoughts? One of the external DLLs is a VC++ 6.0 DLL, so perhaps that
is
> the problem? Unfortunately, that one's not mine, so any workarounds would
be
> appreciated. I tried wrapping all the calls in Try/Catches for the
Exception
> and just forcing them to try again. That works most of the time, but
> occasionally, the damn thing gets too stubborn and falls into an infinite
> loop.

> Hopefully someone out there has at least experienced this behavior as
well?
> I have only found one veiled reference to something similar in Google, but
> no one answered the poor guy.

> Thanks in advance for any thoughts you might have!

> -- Venk --




Fri, 28 Jan 2005 00:17:09 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. calling from non-net C++ DLL to .net DLL and back

2. How to call VB.net and ASP.net programs in MFC?(or,asp call vc)

3. HOWTO? Calling VB DLL from C++ DLL

4. call a VB COM dll thru a C++ COM dll from a C program

5. call a VB COM dll thru a C++ COM dll from a C program

6. How to call VB.net dll functions.

7. Problem using SmtpMail.Send() in a VB.NET dll with a C++ string

8. Using vb.net classes in C++ Win32 DLLs

9. Debugging C++ DLL which is called from VB

10. Calling VB DLLs from VC/C++

11. How to call a function in VB dll by C++

12. How I can Call a DLL written in VB with C++

 

 
Powered by phpBB® Forum Software