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

Pragma to suppress deprecated GetCurrentThreadId

I would like to know if there is a pragma id that I can use to suppress the
warning I get (.NET 2.0) for the GetCurrentThreadId.

I want to use warnings as errors and I don't want to change the
GetCurrentThreadId as we in the testing stages for our product (I have read a
few comments about problems just switching to the ManagedThreadId).

Does such a pragma id exist, and if so, what is it?

Thanks,

ken
Sep 23 '08 #1
3 3766
On Sep 23, 2:42*pm, KenDev <Ken...@discussions.microsoft.comwrote:
I would like to know if there is a pragma id that I can use to suppress the
warning I get (.NET 2.0) *for the GetCurrentThreadId.

I want to use warnings as errors and I don't want to change the
GetCurrentThreadId as we in the testing stages for our product (I have read a
few comments about problems just switching to the ManagedThreadId).

Does such a pragma id exist, and if so, what is it?
Use #pragma warning disable <WARNINGID(and re-enable it) just round
the relevant lines of code.

Jon
Sep 23 '08 #2
KenDev wrote on 23-9-2008 :
I would like to know if there is a pragma id that I can use to suppress the
warning I get (.NET 2.0) for the GetCurrentThreadId.

I want to use warnings as errors and I don't want to change the
GetCurrentThreadId as we in the testing stages for our product (I have read a
few comments about problems just switching to the ManagedThreadId).

Does such a pragma id exist, and if so, what is it?

Thanks,

ken
#pragma warning disable 0618
// the "obsolete" code that you still want to use
#pragma warning restore 0618
The "disable" line disables a specific compiler warning (0618 in this
case) from this line onward in this file.
The "restore" line restores normal behaviour from that line on.
Hans Kesting
Sep 23 '08 #3
Thanks.

"KenDev" wrote:
I would like to know if there is a pragma id that I can use to suppress the
warning I get (.NET 2.0) for the GetCurrentThreadId.

I want to use warnings as errors and I don't want to change the
GetCurrentThreadId as we in the testing stages for our product (I have read a
few comments about problems just switching to the ManagedThreadId).

Does such a pragma id exist, and if so, what is it?

Thanks,

ken
Sep 23 '08 #4

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

Similar topics

10
by: Steven T. Hatton | last post by:
Stroustrup says this: http://www.research.att.com/~bs/bs_faq2.html#macro "So, what's wrong with using macros?" "And yes, I do know that there are things known as macros that doesn't...
6
by: Shri | last post by:
Can anybody tell me where i can find a detailed document on #pragma .... --shri
7
by: Nick Butler | last post by:
In C++ there is a very useful function to programatically disable warnings temporarily. Can this be done in C# ?
1
by: Gary James | last post by:
I'm looking for a way to suppress the CS0659 compiler warning message about class overrides Equals but does not provide a GetHashCode() override. In C++ VS allows this through the use of the...
2
by: Mochuelo | last post by:
Hi, Is there a non-obsolete alternative to the obsolete GetCurrentThreadID? I just need an ID (ideally, an int) that will distinguish any two threads. Thanks.
1
by: peter.moss | last post by:
I have an application that use log4net for operational logging. I store some user data elsewhere and need to tie the two together. To achieve this I pass the ThreadId across on the user table so...
5
by: chris_doran | last post by:
/COMMENT has been removed from the linker that comes with VS2005, and use in source code of: #pragma comment(exestr, "this is a string") gives the message: warning LNK4224: /COMMENT is no...
7
by: John Nagle | last post by:
How do I suppress "DeprecationWarning: Old style callback, use cb_func(ok, store) instead". A library is triggering this message, the library is being fixed, but I need to make the message...
26
by: Rick | last post by:
I'm told that "#pragma once" has made it into the ISO standard for either C or C++. I can't find any reference to that anywhere. If it's true, do any of you have a reference I can use? ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
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,...
0
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...
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,...

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.