473,765 Members | 2,005 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1252
"Wild Wind" <no****@blackho le.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(MyByteA rray *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
2320
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 there is no source code available, just a C file with function declarations like: long SendData(TXData)Type_TXData *TXData;
0
855
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 error C2143: syntax error : missing ')' before ';'
8
1539
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 applications, which runs fine in Debug mode, it is crashing in the destructor of a local object on the stack when it is built in release mode. An example of the C++ that causes the problem is as follows (apologies for the contrived example): -
14
2974
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 @ 2000 (INI file) and
41
2535
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 my purposes. As this code was posted long time ago (November 1998) I would like to ask if the principles used in this code are still valid in the "modern" Python and if/how it can be improved (revrited) using futures of current version of...
2
2355
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
3073
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
1811
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 `::' in parameter declaration If I try it this way:
11
1405
by: Pranav | last post by:
The Code is compiling without Error/Bug/Exception.., What are the possibilities for this behaviour? //*************************************************************** #include<stdio.h> typedef struct abc_ *abc; static abc param; abc fun(void)
0
9404
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
10164
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...
0
10007
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 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...
0
8833
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
7379
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
6649
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
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3926
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
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.