i wanna use the Sleep fucntion in a CLR vc++ app, if i include windows.h it gives a huge list of errors, if i use _sleep() then it dowsnot work at many systems since its obslete. what should i do? i am bound to use CLR bcoz my code uses items from the namespace System.

P.s i am using visual studio 2010

Recommended Answers

All 4 Replies

#include <windows.h>

Sleep(1000);

that works fine.. doesn't give me any errors..

if i include windows.h in a CLR console app (c++) it gives so much ambigious call errors of IServiceProvider. so i cant use Sleep() and solution to fix it?

It's in System.Threading namespace -- link here

sweet :) thanks. solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.