S
Shrikant Chikhalkar
Hi all!
Please help me.
If I create 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"
Can any body help me out?. 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
/***********************************************/
Please help me.
If I create 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"
Can any body help me out?. 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
/***********************************************/