Linking eVC4.0 in DOT NET
From: Shrikant Chikhalkar (shrikant_at_manchitra.com)
Date: 02/22/05
- Next message: RML: "Converting CString to float"
- Previous message: Maverick: "About file transferring"
- Next in thread: Paul G. Tobey [eMVP]: "Re: Linking eVC4.0 in DOT NET"
- Reply: Paul G. Tobey [eMVP]: "Re: Linking eVC4.0 in DOT NET"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 22 Feb 2005 19:40:35 +0530
Hi all!
Please help me.
If I created a simple Managed C++ DLL and use this dll in VB >NET CF it
works fine.
But if I make managed code as a wrapper to the unmanaged code it fails.
So I was tring to make Managed Code as a wrapper to unmanaged code (in eVC
4.0). and using Managed DLL in vb .NET .
It links with out any error.
But as soon as it encounter eVC call it through exception as
System.TypeLoadException.
So my problem is "How do I link static eVC 4.0 (.LIB) to VC .NET managed
DLL. So that using same DLL I can create VB .NET CF application"
If any body help me out for same I will be helpfull for me.
Regards,
Shrikant Chikhalkar
I am giving code that I am using
code inside eVC 4.0
/**********************************************/
/**********************************************/
#include <malloc.h>
#include <string.h>
class myMath
{
private:
int i;
int j;
public:
myMath()
{
}
~myMath()
{
}
int Add();
};
/**********************************************/
/**********************************************/
code inside VC.NET
/**********************************************/
/**********************************************/
#pragma once
#pragma unmanaged
#include "../../mathLib/test.h"
#pragma managed
//using namespace System;
namespace DLL
{
public __gc class Class1
{
public:
Class1()
{
}
~Class1()
{
}
void Add(int i,int j)
{
myMath myPtr;
int ret = myPtr.Add();
}
};
}
/**********************************************/
/**********************************************/
code inside VB .NET For smart devices
/************************************************/
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Try
Dim myDLL As New DLL.Class1
myDLL.test(10, 10)
Catch ex As Exception
MsgBox(ex.ToString(), MsgBoxStyle.YesNo)
End Try
End Sub
/***********************************************/
- Next message: RML: "Converting CString to float"
- Previous message: Maverick: "About file transferring"
- Next in thread: Paul G. Tobey [eMVP]: "Re: Linking eVC4.0 in DOT NET"
- Reply: Paul G. Tobey [eMVP]: "Re: Linking eVC4.0 in DOT NET"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|