473,799 Members | 3,146 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

combining managed and unmanaged (for the 100th time)

Sorry if this is the wrong group, but it seems like a good place to start.
I have a control, creating a dll written in c#/.net and some unmanaged code
in c++ using embedded c++ V3. Yes, it is for PPC2002/PPC2003 but I don't
believe that's the significant issue. My question is, can I create a
solution that wraps the c++ in c# and combine that with the c# control and
if so, is this the best way to combine these two elements? I'm not going to
post this elsewhere and hope people can look past the PPC issues since I
don't believe they matter at all here.

Thanks for any assistance,
NWOP.
Nov 22 '05 #1
3 1617
6.1. How do I call a function that is in a native DLL?

Native DLL functions can be called through Platform Invoke (P/Invoke):

Learn how to use the Platform Invoke (P/Invoke) feature of the .NET Compact
Framework.

http://msdn.microsoft.com/library/en...ntrointerp.asp

Explore advanced interoperabilit y on the .NET Compact Framework.

http://msdn.microsoft.com/library/en...advinterop.asp

Learn how to create unmanaged functions that you can use in your Smart
Device applications through Platform Invoke.

http://msdn.microsoft.com/library/en...nagedfuncs.asp

Learn how to marshal data between managed and unmanaged code using the .NET
Compact Framework.

http://msdn.microsoft.com/library/en...llingtypes.asp

Learn how to use dumpbin.exe as an aid for declaring P/Invokes in Microsoft
..NET Compact Framework-based applications.

http://msdn.microsoft.com/library/en...binpinvoke.asp

"New World Order Pigs" <lt*******@md-it.com.no.spam> wrote in message
news:#1******** ******@TK2MSFTN GP10.phx.gbl...
Sorry if this is the wrong group, but it seems like a good place to start.
I have a control, creating a dll written in c#/.net and some unmanaged code in c++ using embedded c++ V3. Yes, it is for PPC2002/PPC2003 but I don't
believe that's the significant issue. My question is, can I create a
solution that wraps the c++ in c# and combine that with the c# control and
if so, is this the best way to combine these two elements? I'm not going to post this elsewhere and hope people can look past the PPC issues since I
don't believe they matter at all here.

Thanks for any assistance,
NWOP.

Nov 22 '05 #2
Thanks Richard. Some of these things I've looked at but one thing always
seems to be missing-- I'm using an unmanaged c++ app to use a control (dll
ultimately) written with c#/.net. My understanding is that managed code is
interpreted and needs the runtime and as such, how do I take an unmanaged
app and invoke managed code. Most of what I read is in the other direction
and doesn't apply, at least directly and obviously. In any case, I'll look
at these to see if I can gleen the info I need.

Thanks again, NWOP.

"Richard Burte" <rb****@online. microsoft.com> wrote in message
news:#A******** ******@TK2MSFTN GP12.phx.gbl...
6.1. How do I call a function that is in a native DLL?

Native DLL functions can be called through Platform Invoke (P/Invoke):

Learn how to use the Platform Invoke (P/Invoke) feature of the .NET Compact Framework.

http://msdn.microsoft.com/library/en...ntrointerp.asp
Explore advanced interoperabilit y on the .NET Compact Framework.

http://msdn.microsoft.com/library/en...advinterop.asp

Learn how to create unmanaged functions that you can use in your Smart
Device applications through Platform Invoke.

http://msdn.microsoft.com/library/en...nagedfuncs.asp

Learn how to marshal data between managed and unmanaged code using the ..NET Compact Framework.

http://msdn.microsoft.com/library/en...rshallingtypes
..asp
Learn how to use dumpbin.exe as an aid for declaring P/Invokes in Microsoft .NET Compact Framework-based applications.

http://msdn.microsoft.com/library/en...mpbinpinvoke.a
sp
"New World Order Pigs" <lt*******@md-it.com.no.spam> wrote in message
news:#1******** ******@TK2MSFTN GP10.phx.gbl...
Sorry if this is the wrong group, but it seems like a good place to start. I have a control, creating a dll written in c#/.net and some unmanaged code
in c++ using embedded c++ V3. Yes, it is for PPC2002/PPC2003 but I don't believe that's the significant issue. My question is, can I create a
solution that wraps the c++ in c# and combine that with the c# control and if so, is this the best way to combine these two elements? I'm not

going to
post this elsewhere and hope people can look past the PPC issues since I
don't believe they matter at all here.

Thanks for any assistance,
NWOP.


Nov 22 '05 #3
Yes, after looking at the articles they don't apply really. I've used
pinvoke a number of times previously and it just doesn't apply. I can't
"pinvoke" an entire application and then somehow design a managed control
into that application. I literally have a managed control that needs to be
put on an unmanaged form in an unmanaged application. I've seen some
references to doing this, but none of them are satisfactory and I'm looking
for a better way.

Thanks to any and all, NWOP.

"New World Order Pigs" <lt*******@md-it.com.no.spam> wrote in message
news:OJ******** ******@TK2MSFTN GP12.phx.gbl...
Thanks Richard. Some of these things I've looked at but one thing always
seems to be missing-- I'm using an unmanaged c++ app to use a control (dll
ultimately) written with c#/.net. My understanding is that managed code is interpreted and needs the runtime and as such, how do I take an unmanaged
app and invoke managed code. Most of what I read is in the other direction and doesn't apply, at least directly and obviously. In any case, I'll look at these to see if I can gleen the info I need.

Thanks again, NWOP.

"Richard Burte" <rb****@online. microsoft.com> wrote in message
news:#A******** ******@TK2MSFTN GP12.phx.gbl...
6.1. How do I call a function that is in a native DLL?

Native DLL functions can be called through Platform Invoke (P/Invoke):

Learn how to use the Platform Invoke (P/Invoke) feature of the .NET Compact
Framework.

http://msdn.microsoft.com/library/en...ntrointerp.asp

Explore advanced interoperabilit y on the .NET Compact Framework.

http://msdn.microsoft.com/library/en...advinterop.asp

Learn how to create unmanaged functions that you can use in your Smart
Device applications through Platform Invoke.

http://msdn.microsoft.com/library/en...nagedfuncs.asp
Learn how to marshal data between managed and unmanaged code using the

.NET
Compact Framework.

http://msdn.microsoft.com/library/en...rshallingtypes .asp

Learn how to use dumpbin.exe as an aid for declaring P/Invokes in Microsoft
.NET Compact Framework-based applications.

http://msdn.microsoft.com/library/en...mpbinpinvoke.a sp

"New World Order Pigs" <lt*******@md-it.com.no.spam> wrote in message
news:#1******** ******@TK2MSFTN GP10.phx.gbl...
Sorry if this is the wrong group, but it seems like a good place to

start. I have a control, creating a dll written in c#/.net and some unmanaged

code
in c++ using embedded c++ V3. Yes, it is for PPC2002/PPC2003 but I don't believe that's the significant issue. My question is, can I create a
solution that wraps the c++ in c# and combine that with the c# control and if so, is this the best way to combine these two elements? I'm not

going
to
post this elsewhere and hope people can look past the PPC issues since I don't believe they matter at all here.

Thanks for any assistance,
NWOP.



Nov 22 '05 #4

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

Similar topics

3
372
by: New World Order Pigs | last post by:
Sorry if this is the wrong group, but it seems like a good place to start. I have a control, creating a dll written in c#/.net and some unmanaged code in c++ using embedded c++ V3. Yes, it is for PPC2002/PPC2003 but I don't believe that's the significant issue. My question is, can I create a solution that wraps the c++ in c# and combine that with the c# control and if so, is this the best way to combine these two elements? I'm not going...
16
14141
by: Ekim | last post by:
hello, I'm allocating a byte-Array in C# with byte byteArray = new byte; Now I want to pass this byte-Array to a managed C++-function by reference, so that I'm able to change the content of the byteArray and afterwards see the changes in C#. (if you wanna know more details: the goal is to write the content of an existing char-array in c++ precisely into the passed byteArray, so that after the function has proceded the content of the...
5
2958
by: Adam McKee | last post by:
We are using Visual Studio.NET 2003 in our project with .NET framework 1.1. One of our libraries is a mixed-mode dll assembly consisting of one managed C++ library, and several unmanaged C++ libraries. We are using managed C++ as a bridge between managed .NET code and unmanaged C++ code, which I'm sure is a fairly common practice. The managed C++ library is compiled with /CLR whereas all other libraries are compiled without /CLR because...
1
2128
by: Eric Twietmeyer | last post by:
Hello, I'm starting to investigate cs, managed c++ and interoperating with a very large unmanaged code base. We are going to use Windows Forms (written in cs) to replace our old fashioned GUI. The guts will remain in unmanaged c++. So I need to write public managed c++ wrapper classes for the couple of interfaces the unmanaged stuff needs to expose for the GUI. Questions:
2
2412
by: Brett Styles | last post by:
Hi Guys, I am trying to access a class in an unmanaged dll. I have created a wrapper managed class to access the functions I need but no matter what I try from the MSDN samples I can not get it to work with my code. I have a VB Net front end which need the access the unmanaged functions. The wrapper I wrote can be accessed but the wrapper will not compile when I refer to the unmanaged class. I have tried using header file for definitions...
3
3513
by: zhphust | last post by:
I want to convert a object of a managed class to a unmanaged structure that has the same member with that managed class. Can anybody tell me how i can do it? Thanks in advance. -- zhphust ------------------------------------------------------------------------
2
2731
by: Sandy | last post by:
I am confused about Unmanaged Code, How .Net Framework treate that code, What is the use of that. Thanks in advance Sandeep Chitode
12
1632
by: doug | last post by:
I understand the basics of what managed code offers and that you open yourself up to security issues if you allow unmanaged code. We already have a decent amount of VB6 code to include COM DLLs. If we put wrappers around some of our code or leave some "asis" what makes our existing production code 'evil' just because it is now considered 'unmanaged'? It may seem like a simple niave question, but the definitions for managed and...
25
3021
by: Koliber (js) | last post by:
sorry for my not perfect english i am really f&*ckin angry in this common pattern about dispose: ////////////////////////////////////////////////////////// Public class MyClass:IDisposable
20
2314
by: =?Utf-8?B?VGhlTWFkSGF0dGVy?= | last post by:
Sorry to bring up a topic that is just flogging a dead horse.... but... On the topic of memory management.... I am doing some file parcing that has to be done as quick as posible, but what I have found hasnt been encouraging... I found that the *quickest* way is to use a struct to retrieve fixed length packets out of the file, but structs get placed on the stack! In one of the books I read, the stack is only about 1mb, so I would...
0
10490
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10243
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10030
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
9078
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...
1
7570
isladogs
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...
0
5467
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...
1
4146
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
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.