473,654 Members | 3,096 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Warning C4800

I have a little issue I hope you can help me with. I retrieve the processes
that are running on my computer and get the C4800 warning in certain
situations. The code snippet below illustrates my challenge.

Process* localAll[] = Process::GetPro cesses();

printf("\nProce ss name: %s",localAll[x]->ProcessName) ; //works fine

cout << "Process name: " << localAll[x]->ProcessName << endl; //c4800

// writing to a file

writeFile << "Process name: " << localAll[x]->ProcessName << endl; //c4800

warning C4800: 'System::String __gc *' : forcing value to bool 'true' or
'false' (performance warning)

Why does it work with 'printf' but not with the others?
Nov 17 '05 #1
1 2088
I'm sorry I can't exactly tell you the solution to your problem, but
printf takes whatever parameters you pass, so it doesn't exspect
anything. cout, however, seems to exspect a boolean value in this
situation. I doubt that there is an operator (<<) defined for cout which
takes a System::String as parameter, but I am not sure about this. So
maybe the compiler tries to pass a boolean value instead of a String --
try converting to a C-style string before passing it to cout or
writeFile.

Regards,
Felix Arends
-----Original Message-----
From: Jazzkt [mailto:ja**@msn .com]
Posted At: Tuesday, September 07, 2004 5:40 PM
Posted To: microsoft.publi c.dotnet.langua ges.vc
Conversation: Warning C4800
Subject: Warning C4800
I have a little issue I hope you can help me with. I
retrieve the processes that are running on my computer and
get the C4800 warning in certain situations. The code
snippet below illustrates my challenge.

Process* localAll[] = Process::GetPro cesses();

printf("\nProce ss name: %s",localAll[x]->ProcessName) ; //works fine

cout << "Process name: " << localAll[x]->ProcessName << endl; //c4800

// writing to a file

writeFile << "Process name: " << localAll[x]->ProcessName <<
endl; //c4800

warning C4800: 'System::String __gc *' : forcing value to
bool 'true' or 'false' (performance warning)

Why does it work with 'printf' but not with the others?


Nov 17 '05 #2

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

Similar topics

3
2717
by: Bas Wassink | last post by:
Hello there, I'm having trouble understanding a warning produced by 'splint', a code-checker. The warning produced is: keywords.c: (in function keyw_get_string) keywords.c:60:31: Released storage Keywords.Keyword reachable from global A global variable does not satisfy its annotations when control is transferred. (Use -globstate to inhibit warning) keywords.c:60:11: Storage Keywords.Keyword released
3
2559
by: Bill Burris | last post by:
How do I find what is causing this warning from the Linker? If I use /NODEFAULTLIB I get hundreds of undefined symbols. LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library Here is the compiler options: /Od /I "C:\DriverX4\Include" /I "..\ThreadLib" /AI "..\Utility\bin\Debug" /AI "..\Logging\bin\Debug" /AI "Debug" /D "WIN32" /D "_DEBUG" /D "_WINDLL"
12
3256
by: Howard Kaikow | last post by:
In the code below, ALL the lines that start with PPTfile << are getting the following error at build time. "//i:\C++\C++Code\FileOperations\Form1.h(127) : warning C4800: 'System::String __gc *' : forcing value to bool 'true' or 'false' (performance warning)" I get the following output, which is obviously wrong: Process ID = 0x1
3
7202
by: DJTN | last post by:
I'm getting the following error when I try to compile my setup project in VS 2002. I have re-installed the .net framework 1.1 and it didnt solve the problem. WARNING: Unable to find dependency 'mscorlib' (Signature='B77A5C561934E089' Version='1.0.5000.0') of assembly 'System.dll' WARNING: Unable to find dependency 'mscorlib' (Signature='B77A5C561934E089' Version='1.0.5000.0') of assembly 'System.Windows.Forms.dll' WARNING: Unable to...
1
1997
by: spanov | last post by:
i've got problem installing python-2.3.5 from sources on FreeBSD 5.3 root@server# ./configure > conf_log configure: WARNING: curses.h: present but cannot be compiled configure: WARNING: curses.h: check for missing prerequisite headers? configure: WARNING: curses.h: see the Autoconf documentation configure: WARNING: curses.h: section "Present But Cannot Be Compiled" configure: WARNING: curses.h: proceeding with the...
0
2406
by: Manish | last post by:
PHP INI File Setting ------------------------------------------------------------------------------------------------------------------ error_reporting = E_ALL & ~E_NOTICE No warning message are displayed when script executed from the browser. Only Error, Fatal errors are displayed. But when the same script is executed from the command line 192.168.0.2# php lpmonitor.php Warning messages are displayed.
1
6408
by: Ian | last post by:
I've just discovered the msclr::lock class in the C++ Support Library online documentation. This seems like a much cleaner way to implement thread protection than using monitor::enter/try/finally/monitor exit. However, I cannot get around one of the warning messages and am requesting help in understanding what is causing the warning. All of the online sample code for the class msclr::lock generates the same warning message. I have...
92
6185
by: Heinrich Pumpernickel | last post by:
what does this warning mean ? #include <stdio.h> int main() { long l = 100; printf("l is %li\n", l * 10L);
4
2147
by: cody | last post by:
It is possible to declare and use/instantiate a class with a uninitialized readonly field without even a compiler warning. Why don't I get warnings? public class Stuff { public readonly int a; } By definition, readonly fields can only be initialized inside a
0
8376
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
8290
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
8815
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
8708
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
8594
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6161
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
5622
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();...
1
2716
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
1
1916
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.