473,320 Members | 2,162 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,320 software developers and data experts.

how to exchange a structure between c++/cli and c, c++

hello everyone.

i couldn't find out a board about c++/cli from , so i wrote my problem
writing a code with c++/cli.

i have made a dll of c++/cli, then i want to exchange structure between
c++/cli and c.

this is the structure
typedef struct tagExchange
{
int m_nIndex;
float m_fValue;
} exchagned;

first , c will use the dll made by c++/cli.
then c will pass a function pointer to c++/cli like callback function.
because i want to use the callback like event.

typedef void (*EXCHANGED)(int nCount, exchagned stIndex[]);// callback
function.

static void NotifyToC(System::Object ^sender, Dictionary<int, _CRequested^>
^requested)
{
int nLength = requestedIndex->Count;
array<exchagned *>^ arrIndex = gcnew array<exchagned; *>(nLength);
int nCount = 0;
_CRequested^ requested;
for each(KeyValuePair<int, _CRequested^>^ pair in requested)
{
arrIndex[nCount] = new exchagned();
arrIndex[nCount]->m_nIndex = pair->Key;
requestedItem =(_CRequested^) pair->Value;
arrIndex[nCount]->m_fValue =requestedItem->m_fValue;
nCount++;
}
pin_ptr<exchagned*p1 = &arrIndex[0]; --

|-here is my problem.
// gCallBackofExchanged(nCount, arrIndex);--
}

so how can i solve this problem.

could you help me...

^^
Jun 27 '08 #1
1 1552
lightdoll wrote:
i couldn't find out a board about c++/cli from ,
You could try microsoft.public.dotnet.languages.vc, but we do
have a few C++/CLI experts hanging out here as well.

Arne
Jun 27 '08 #2

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

Similar topics

2
by: M Rao | last post by:
I have xml data coming in as a stream from a web service running against exchange server.The attributes for the elements dtstart and dtend, b:dt="dateTime.tz"...
19
by: steve | last post by:
// What I want to do Use enumerated types with the Interlocked.Exchange methods Suggestions please // My estimation of problem Seems like Interlocked.Exchange only works with ints,...
8
by: Rob Edwards | last post by:
When trying to add the Microsoft CDO for Exchange Management Library (aka CDOEXM.dll) I receive the following message: "A reference to 'Microsoft CDO for Exchange Management Library' could not be...
2
by: George Durzi | last post by:
We recently upgraded to Exchange2K3/W2K3 from Exchange2K/W2K, and some of my c# code that I used to access users' contacts using WebDAV has stopped working. I'm getting a 401 unauthorized error....
1
by: Eduardo Garcia-Prieto | last post by:
I have come accross a problem in using the Interlocked.Exchange(Object, Object) method while using Option Strict On in my project. I have a private class structure variable which can be updated...
8
by: Michel Posseth [MCP] | last post by:
Hi does someone has experience with this ?? i have made a lot of apps in the past that were capable of sending e-mails the server i then talked to was a Linux SMTP server and it worked great ...
1
by: ouistyty | last post by:
Hi We have a simple asp page that query LDAP attribrute. Everithing is working fine using a native domain account. but when using an external account we have an error 70, acces denie. Here's...
4
by: KDawg44 | last post by:
Hi, I am frustrated with my users who send large files around the office instead of using the network shares. For instance, this is one of many emails I have sent around: "If you take the...
2
by: Salad | last post by:
In A2003 one can create a linked table using File/GetExternalData/Link/Exchange(). It's a nice feature but by and large fairly useless if I am reading the table structure correctly. The From &...
1
by: =?Utf-8?B?bGlnaHRkb2xs?= | last post by:
hello everyone. i have made a dll of c++/cli, then i want to exchange structure between c++/cli and c. this is the structure typedef struct tagExchange {
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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

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.