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

Repost - weird behaviour with function declaration

Hello,

I posted this a few days back, but got no response, so I
am reposting it.

I have an event in my managed class which I declare as:

__event void MyEvent(System::Byte (*fir) __gc[]);

However, I find that when I build the class, I get very
strange errors like

error C2143: syntax error : missing ')' before ';'

I think the problem has to do with my declaration, because
when I redeclare the event as

__event void MyEvent(System::Byte fir __gc[]);

the error goes away. However, I don't feel satisfied with
this because I don't see a problem with the declaration.

In addition, this event is going to be consumed by a VB.NET
application and since the array it is passing as a parameter
is a managed array, I have to pass a pointer to the array
instead of the array itself as I do in the 'corrected'
version.

I would appreciate it if anyone could shed some more
light on the correct way to raise events that have arrays
as parameters. Should I just use System::Array* instead?

--
Akin

aknak at aksoto dot idps dot co dot uk
Nov 17 '05 #1
1 1234
"Wild Wind" <no****@blackhole.com> wrote in message news:<2j************@uni-berlin.de>...
Hello,

I posted this a few days back, but got no response, so I
am reposting it.

I have an event in my managed class which I declare as:

__event void MyEvent(System::Byte (*fir) __gc[]);

However, I find that when I build the class, I get very
strange errors like

......

Hi. I am not really sure what you are trying to do with your events.
But forgetting events for the moment, if what you intend is to declare
a pointer to an array, they your declaration is wrong.

try something like:

typedef System::Byte MyByteArray __gc[];

and then use it like __event void MyEvent(MyByteArray *array);

NB: I am just pointing you in the right direction as far as declaring
a pointer to your array goes... I have no clues what your VB client
expects or how you are implementing the event etc....

hth.
-Vinayak
Nov 17 '05 #2

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

Similar topics

2
by: Nils Emil P. Larsen | last post by:
Hello I have read about a C shared library which I want to use in my C program. (It's a library to encode/decode packets from/to a serial bus running with the SNAP-protocol). Unfortunatly...
0
by: Wild Wind | last post by:
Hello, I have an event in my managed class which I declare as: __event void MyEvent(System::Byte (*fir) __gc); However, I find that when I build the class, I get very strange errors like ...
8
by: Daniel Yelland | last post by:
Hi, I have developed a number of code libraries in Win32 DLLs and have written a number of test suite executables that implicitly link to these libraries in order to test them. In one of my test...
14
by: Nak | last post by:
Hi there, It's probably me being weird more than the function but I'm having problems with it doing as it should. I have a C++ application with 2 resources of custom types, RT_INIFILE @...
41
by: Petr Jakes | last post by:
Hello, I am trying to study/understand OOP principles using Python. I have found following code http://tinyurl.com/a4zkn about FSM (finite state machine) on this list, which looks quite useful for...
2
by: vlsidesign | last post by:
Here is my a portion of my program: #include <stdio.h> main() { int fahr, celsius; int lower, upper, step; int fc_conv(int fahr); ... snip ... }
2
by: greg | last post by:
In my quest to eliminate C compiler warnings from Pyrex output, I've discovered some utterly bizarre behaviour from gcc 3.3. The following code: void g(struct foo *x) { } void f(void) {
2
by: Juha Nieminen | last post by:
I'm using gcc 3.3.5. This code: std::set<std::stringt(std::istream_iterator<std::string>(std::cin), std::istream_iterator<std::string>()); gives a strange error message: error: cannot use...
11
by: Pranav | last post by:
The Code is compiling without Error/Bug/Exception.., What are the possibilities for this behaviour? //*************************************************************** #include<stdio.h> typedef...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
jinu1996
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...
0
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...
0
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,...
0
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...

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.