473,698 Members | 2,751 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Pass by reference in C++ cause compiler to GPF

I need to pass a reference of a managed object to a function (bar). I
believe the syntax is correct. When I build the project, a message box with
the title "Microsoft (R) C/C++ Optimizing Compiler" displays indicating that
a GPF has occurred.

Is this a compiler bug?

Sample Code:
class foo
{
....
bool bar(System::Dat a::DataSet^% ResultSet);
};
Feb 21 '06 #1
2 1337
Benny <bl**@newsgroup .nospam> wrote:
I need to pass a reference of a managed object to a function (bar). I
believe the syntax is correct. When I build the project, a message box with
the title "Microsoft (R) C/C++ Optimizing Compiler" displays indicating that
a GPF has occurred.

Is this a compiler bug?

Sample Code:
class foo
{
...
bool bar(System::Dat a::DataSet^% ResultSet);
};


Anything which makes the compiler die is a compiler bug, IMO.

I suggest you report it on
http://lab.msdn.microsoft.com/productfeedback/

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Feb 21 '06 #2
Hi,
Welcome to MSDN Newsgroup!

In the current situation, please help us confirm some information on your
side:
1.What's the version of complier, VS2003 or VS2005?
2.Would you provide us a simplified sample to repro this problem? It will
help us get closer to this issue.

Please rest assured that we will do our best to support you. Thanks for
your understanding!

Best Regards,

Terry Fei [MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security

--------------------
Thread-Topic: Pass by reference in C++ cause compiler to GPF
thread-index: AcY3KAbb5b+apBO gQqOydCm2pXrkUg ==
X-WBNR-Posting-Host: 63.166.226.115
From: "=?Utf-8?B?QmVubnk=?=" <bl**@newsgroup .nospam>
Subject: Pass by reference in C++ cause compiler to GPF
Date: Tue, 21 Feb 2006 12:47:28 -0800
Lines: 13
Message-ID: <22************ *************** *******@microso ft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.publi c.dotnet.genera l
NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GXA03.phx.gbl
Xref: TK2MSFTNGXA01.p hx.gbl microsoft.publi c.dotnet.genera l:189326
X-Tomcat-NG: microsoft.publi c.dotnet.genera l

I need to pass a reference of a managed object to a function (bar). I
believe the syntax is correct. When I build the project, a message box withthe title "Microsoft (R) C/C++ Optimizing Compiler" displays indicating thata GPF has occurred.

Is this a compiler bug?

Sample Code:
class foo
{
...
bool bar(System::Dat a::DataSet^% ResultSet);
};


Feb 22 '06 #3

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

Similar topics

4
4555
by: Todd | last post by:
Is it possible to pass an argument by reference through an event in C++ managed code? For example, can I do the following? public __gc class MyClass : public Control { public: __event void MyEvent(bool &Cancel);
110
9920
by: Mr A | last post by:
Hi! I've been thinking about passing parameteras using references instead of pointers in order to emphasize that the parameter must be an object. Exemple: void func(Objec& object); //object must be an object instead of
38
4618
by: Radde | last post by:
HI all, Whats the difference b/w pass by ref and pass by pointer in C++ when ur passing objects as args.. Cheers..
9
4649
by: Stuart Carnie | last post by:
Due to the tightening of the VC++ compiler in 2005, I have run into a compiler error (from code that previously worked in 2003) using a CComPtr<ITypeLib> as an element of a std::list, as follows std::list<CComPtr<ITypeLib> >. I understand the problem, so am looking for the correct solution to my problem. On the line that attempts to call push_back, I receive "error C2664: 'std::allocator<_Ty>::construct' : cannot convert parameter 1...
5
2314
by: josh | last post by:
Hi, how really work behind the scene the pass-by-reference in C++? I know that in C++ like the C the objects are passed by-values and if we want we can simulate the pass-by-reference using the pointers... Bye
14
20399
by: Abhi | last post by:
I wrote a function foo(int arr) and its prototype is declared as foo(int arr); I modify the values of the array in the function and the values are getting modified in the main array which is passed also. I understand that this way of passing the array is by value and if the prototype is declared as foo(int *), it is by reference in which case the value if modified in the function will get reflected in the main function as well. I dont...
6
2710
by: lisp9000 | last post by:
I've read that C allows two ways to pass information between functions: o Pass by Value o Pass by Reference I was talking to some C programmers and they told me there is no such thing as pass by reference in C since you are just passing an address (or a pointer value address I guess?). So I was wondering is this correct?
11
3351
by: venkatagmail | last post by:
I have problem understanding pass by value and pass by reference and want to how how they are or appear in the memory: I had to get my basics right again. I create an array and try all possible ways of passing an array. In the following code, fun1(int a1) - same as fun1(int* a1) - where both are of the type passed by reference. Inside this function, another pointer a1 is created whose address &a1 is different from that of the passed...
12
11092
by: raylopez99 | last post by:
Keywords: scope resolution, passing classes between parent and child forms, parameter constructor method, normal constructor, default constructor, forward reference, sharing classes between forms. Here is a newbie mistake that I found myself doing (as a newbie), and that even a master programmer, the guru of this forum, Jon Skeet, missed! (He knows this I'm sure, but just didn't think this was my problem; LOL, I am needling him) If...
0
8674
marktang
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...
0
9157
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
9026
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...
1
8893
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,...
1
6518
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
5860
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
4366
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...
2
2328
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2001
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.