PC Review


Reply
Thread Tools Rate Thread

Calling unmanaged functions out of managed code

 
 
=?Utf-8?B?QW5kcmVhcyBIb2V0a2Vy?=
Guest
Posts: n/a
 
      13th Feb 2004
Hello

I'm currently developing a project, that contains one .net (VB) executable and a C++ (MFC) DLL. Now, what I want to do is to call the functions in the dll out of my managed code

//managed code (the .net executable
Public Class TestClas
<StructLayout(LayoutKind.Sequential)>
Class ANYSTRUC
Public counter1 As Int6
Public counter2 As Int6
End Clas

Declare Function MyTest Lib "test.dll" (ByVal param As ANYSTRUCT) As Boolea
End Clas

//[...
dim s as New TestClass.ANYSTRUC
//filling s with data..
TestClass.MyTest(s) '!!!

At this point, the debugger throws a System.NullReferenceException I cannot understand. Can anyone

Thanks a lo
Andrea

P.S.: This is the unmanaged code (in the MFC Dll)
typedef struct _ANYSTRUCT
__int64 counter1
__int64 counter2
}ANYSTRUCT

BOOL MyTest(ANYSTRUCT param

[...
}
 
Reply With Quote
 
 
 
 
Gary Chang
Guest
Posts: n/a
 
      14th Feb 2004
Hi Andreas,

Thanks for posting in the community.

I have posted a response to your problem in this queue, please check it.


Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

 
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
Calling unmanaged C dll from managed code Dennis Microsoft VB .NET 1 1st Jun 2010 10:19 PM
Calling Managed functions from unmanaged class Amit Dedhia Microsoft Dot NET 9 26th Oct 2006 02:56 PM
RE: Calling unmanaged functions out of managed code Gary Chang Microsoft Dot NET 0 17th Feb 2004 01:19 AM
RE: Calling unmanaged functions out of managed code Gary Chang Microsoft Dot NET 0 14th Feb 2004 07:46 AM
RE: Calling unmanaged functions out of managed code Gary Chang Microsoft Dot NET 0 14th Feb 2004 07:42 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:41 PM.