473,326 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Help with Unmanaged Class

We have an class sent to us by a vendor in a .h file. This class controls
access to a subsystem for gathering data. Currently we are using C++ 6.0 to
access this class. Now we want to move to .net. The class sent to us can not
be compiled as managed code so I have built a managed wrapper class... here
is the general code

#using <mscorlib.dll>

#pragma once

using namespace System;

#pragma unmanaged

#include "VendorData.h"

#pragma managed

namespace rvimrh

{

public __gc class rvimrh

{

private:

VendorData __nogc* objimrh;

public:

rvimrh() : objimrh(new VendorData)

{

}

~rvimrh(void)

{

if(NULL != objimrh)

{

delete objimrh;

objimrh = NULL;

}

}

My question is - We want to call this from a VB.net program - is there
anyway to call the functions in the unmanaged class without setting up
"driver" calls from the managed class for example one of the functions in
the unmanaged class is

void ServerIP ()

{

char * ip;

}

if I setup a function in the managed class as

void ServerIP ()

{

char * ip;

ip = objimrh->ServerIP();

}

I can call this function from the VB program and it then calls the function
in the unmanaged class but there are about 75 functions in the unmanaged
class and I would hate to have to code everyone of them if I don't have
to... Obviously we can't change the vendor code as they send us the new
class whenever changes are made

Any help or references to documentation pertaining to this would be most
appreciated

Thanks

Rick
Nov 17 '05 #1
0 836

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: john | last post by:
Here is the short story of what i'm trying to do. I have a 4 sided case labeling printer setting out on one of our production lines. Now then i have a vb.net application that sends data to this...
8
by: Don | last post by:
I have a third party C++ DLL that I am trying to use from C#. The specific function I am trying to use is declared in C++ as follows: ladybugConvertToMultipleBGRU32( LadybugContext ...
0
by: sklett | last post by:
I'm having a really hard time with wrapping an unmanaged class with a managed class, then calling that managed class from my C# code. I will show you the three pieces, then explain: --------...
35
by: MuZZy | last post by:
Hi All, I got a issue here and hope someone can help me: Let's consider this code: // =================== CODE START ================================= using System; using System.Data; ...
4
by: Rachel Suddeth | last post by:
What is the difference between a managed/unmanaged resource, and how do you tell which is which? I'm trying to understand how to write some Dispose() methods, and we are supposed to put code that...
1
by: Sparhawk | last post by:
Hi, my company is going to migrate a large VC++ application to .NET to make use of Windows Forms (the old class library is not updated any more). We are not planning to migrate the rest of the...
9
by: Amit Dedhia | last post by:
Hi All I have a VC++ 2005 MFC application with all classes defined as unmanaged classes. I want to write my application data in xml format. Since ADO.NET has buit in functions available for...
5
by: akash | last post by:
I'm having problems calling an unmanaged class from a managed wrapper. I suspect I'm missing something obvious, as I'm unfamiliar with C++ and classes are very simple. My unmanaged class is as...
5
by: QbProg | last post by:
Hello, I did some experiments with VC++ 2005, and some ILDasm. Please tell me if I have understood the concepts of C++ programming under .NET, since I'm a bit confused! -- There are 4 types of...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.