473,626 Members | 3,675 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 849

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

Similar topics

5
3343
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 printer using a RawPrinterHelper class that i found I believe in the msdn. the class works wonderfully when I send stright text data (in the correctly formated string that the sato printer requires.) but when i go to send a image nothing is...
8
2762
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 context, const LadybugImage* pimage, unsigned char* arpszDestBuffers, LadybugImageInfo* pImageInfo );
0
1086
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: -------- Unmanaged C++ code --------- bool FindFileItem(PCSTR filename, IVSSItem& founditem); // note that founditem is a REFERENCE
35
2114
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; namespace TestNamespace {
4
39984
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 deals with managed in one place, and code that deals with unmanaged in another place, but I can't seem to find anything that clearly explains what that means. I think if I used a Windows API function to optain a handle, that handle would be an...
1
1643
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 code which works well. I understand the basic concept: our code is unmanaged, Windows Forms is Managed and Unmanaged may not call Managed code. I read about Wrappers, PInvoke, Runtime Callable Wrappers for COM and about It just
9
3115
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 this, I want to use it. Is it possible to call Managed class functions from Unmanaged class? How to do it? I did something like this. I declared a managed class (in C++ CLI) called as MyManagedClass whose
5
1907
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 follows: // Unmanaged.h #pragma once namespace Unmanaged { class __declspec(dllexport) UnmanagedClass { // TODO: Add your methods for this class here.
5
1292
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 classes in VC++/CLI: Unmanaged classes (i.e. normal classes compiled in a unmanaged source or dll , the code is unmanaged and CPU native). Accessible from C++/CLI
0
8265
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8196
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7193
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5574
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4092
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4197
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1808
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1511
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.