473,695 Members | 2,279 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

using a c++ dll that returns a pointer

Hello all,

I think I'm a bit lost in the managed/unmanaged world!
My problem is that I have a c++ dll for a program on a pda and I'd like to
use it in a program in .net and c#. I've almost understood how it works when
you wanna use a simple function, but I don't understand how to use it when
you have to use a personnal class (let's say CMyClass) as a parameter or
deal with a function that returns a pointer...
someone could give me some keys ?

thank you

Dec 8 '05 #1
1 1232
You can treat pointer as IntPtr .NET type.
Make google queries for P/Invoke

Vadym Stetsyak aka Vadmyst

"Jerome" <jl*******@wana doo.fr> wrote in message
news:eu******** ******@TK2MSFTN GP14.phx.gbl...
Hello all,

I think I'm a bit lost in the managed/unmanaged world!
My problem is that I have a c++ dll for a program on a pda and I'd like to
use it in a program in .net and c#. I've almost understood how it works
when you wanna use a simple function, but I don't understand how to use it
when you have to use a personnal class (let's say CMyClass) as a parameter
or deal with a function that returns a pointer...
someone could give me some keys ?

thank you


Dec 8 '05 #2

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

Similar topics

by: VivekR | last post by:
Hi All, I was using VC++ earlier to register COM Server programmatically. What i do is I use LoadLibrary(Desired COM DLL), then GetProcAddress("DllRegisterServer"), and then call that function using the function pointer that GetProcAddress returns. How do i do that in C#, I tried using the DllImport attribute for calling LoadLibrary and GetProcAddress, it works but at last GetProcAddress returns a fucntion pointer ie a FARPROC or barely...
by: Aguilar, James | last post by:
Is there any way to use a priority_queue with pointers? The reason why I ask is that I want a data structure that contains pointers to objects, not copies of objects. Also, I want them to be sorted by priority. On the same note, then, is there a way to write an operator: bool operator <(Foo* foo1, Foo* foo2);? Inside the operator, the pointers would be dereferenced then compared. Is it not possible to do this? If not, my solution...
by: Tony Johansson | last post by:
Hello Experts! I have one class template here called Handle and one concrete class called Point. At the bottom is the main program and the class template definitions for Handle. This program works fine but there are two thing that I don't understand completely and that is these two operator that exist in the class template Handle. Body* operator->()
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on where the job is running, the job runs sucessfully, PDF files got generated, everything is good. If I scheduled the job to run at the time that I am not logged into the server, Access is not able to print to the printer. The error is pretty...
by: Mike D. | last post by:
I have a problem with a dynamic library I am developing, but it is really more of a pointer issue than anything else. Hopefully someone here can lend me some assistance or insight into resolving this. Ok... here goes.... I have a function that passes a pointer to a string to another function. For example: int FunctionA ()
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen. It is almost like it is trying to implement it's own COM interfaces... below is the header, and a link to the dll+code: Zip file with header, example, and DLL:...
by: fakeprogress | last post by:
For a homework assignment in my Data Structures/C++ class, I have to create the interface and implementation for a class called Book, create objects within the class, and process transactions that manipulate (and report on) members of the class. Interface consists of: - 5 private variables char author; char title; char code;
by: shuisheng | last post by:
Dear All, The problem of choosing pointer or reference is always confusing me. Would you please give me some suggestion on it. I appreciate your kind help. For example, I'd like to convert a string to a integer number. bool Convert(const string& str, int* pData); bool Convert(const string& str, int& data);
by: Mike S | last post by:
I've seen examples of using the CallWindowProc Windows API function to call functions through their addresses in VB6 -- a clever workaround to emulate C-like function pointer semantics. A well-known example is the use of CallWindowProc to call a function gotten via LoadLibrary/GetProcAddress. For example, I've seen code similar to the following which can register/unregister a COM DLL where the path to the DLL is known only at runtime -- in...
by: C++Liliput | last post by:
I have a class of the type class A { private: std::string data; ....... public: const char* toString(); };
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...
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,...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
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...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
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();...
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...
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
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.