|
by: Stub |
last post by:
Question 1:
class Count
{
public:
Count() : id(n++) { cout << id << " default ctor" << endl; }
Count(Count const&) : id(n++) { cout << id << " copy ctor" << endl;
Count (Count const& src) : v(src.v) { cout << "Count(Count const&) " << v
<< "\n"; }
};
|
by: klaus triendl |
last post by:
hi,
recently i discovered a memory leak in our code; after some investigation i
could reduce it to the following problem:
return objects of functions are handled as temporary objects, hence their
dtor is called immediately and not at the end of the function. to be able to
use return objects (to avoid copying) i often assign them to a const
reference.
now, casting a const return object from a function to a non-const reference
to this...
|
by: Basil |
last post by:
Hello.
Compiler BCB60.
There is a simple example:
class a1 {
int v;
public:
a1 ():v (0) {}
a1 (int v1):v (v1) {}
|
by: Santi |
last post by:
I have two classes: Product and Fruit which inherits from Product.
If I try to narrow the reference to the base type by a cast, I always get a
reference to the inherited type.
For example:
Fruit lemon = new Fruit();
Product prod = (Product)lemon; // Now prod is a Fruit Type!!
I want to get a Product reference from a Fruit object, is it possible?
thank you.
|
by: MIGUEL |
last post by:
Hi all!
Be patient because what I'm going to explain all of you it's more than
very strange.
I've developed a webservice project that contains two classes. One of
them is going to act as a SOAP header, and the other class is the main
class containing all the web methods. Besides, the project contains
two references pointing at two normal DLLs built also with VS .NET
2003. This references are needed because the web methods use them in
|
|
by: R Reyes |
last post by:
Error: Unable to cast object of type 'ASP.CompanyDirectory_aspx' to type
'CompanyDirectory'.
Code:
clsCompanyDirectory = (CompanyDirectory)Context.Handler;
getCompanyProfile(Strings.ConvertToInt(clsCompanyDirectory.CompanyIDValue));
Question: I have other pages with the exact same code and it does not
error. Why would this error? Am I missing something? How can the same page
not be cast on itself if it's the same type? Or maybe I...
|
by: Johan |
last post by:
Hi,
I'm writing an PowerPoint Add-In using C# which adds a toolbar and a button.
When the user clicks the button, an activex control is inserted into the
presentation. Is it possible to somehow type cast the
Microsoft.Office.Interop.PowerPoint.Shape or the shape.OLEFormat.Object to an
instance of the interop-class created for my activex control by visual
studio? I need to do this in order to transfer the state of another activex
control...
|
by: =?Utf-8?B?TGVvIExleXM=?= |
last post by:
Hi,
The code below generates a compile error on line 3 (dim d...)
Dim o As Object = "1900-01-01"
Dim s As String = TryCast(o, String)
Dim d As DateTime = TryCast(o, DateTime)
The error is : TryCast operand must be reference type, but 'Date' is a value
type.
|
by: GiJeet |
last post by:
Problem using AS operator to cast Tag property
Hello, I’m using the Tag property of a menu item to hold an enum value
of a PictureBoxSizeMode.
Eg: this.menuImageStretch.Tag =
System.Windows.Forms.PictureBoxSizeMode.StretchImage;
now in the ProcessImageClick method I check to make sure the Tag
propety is not null and cast from type Object to PictureBoxSizeMode
|
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,...
|
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...
|
|
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...
|
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...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
|
|
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...
|