|
hello...
I am working on VC++ programming.....I want code for getting list of all Services running on computer
Plz help me..
Reply me as early as possible
Thanking You.
Sincerely,
VIRAL PATEL
|
|
|
|
|
Not sure if this is what you need
but a list of services installed can be seen here
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
if u want to get all the runnig process use the Api EnumProcesses()
nave
|
|
|
|
|
|
Hello i have a button if i press the button it should open explorer window and it should not show the D:drive its should be restricted to access.
how can i do that please help me
|
|
|
|
|
sundar_mca wrote: it should not show the D:drive its should be restricted to access.
http://www.codeproject.com/system/SysUtil.asp
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi people,
I need some help with IHttpNegotiate interface.
I have a BHO that also implements IBindStatusCallback and IHttpNegotiate interfaces. Also it implements IDispatch interface to catch DWebBrowserEvents2 . So in IDispatch 's Invoke method I create a URLMoniker , as url I pass the url entered in the browser and bind it to my instance of IBindStatusCallback. I was expecting that IHttpNegotiate 's BeginningTransaction method will get called for every request done by browser while loading the given url, I mean for requests to css,jscript,image, etc. but it only gets called for request done for the url itself. Can someone advise how to catch all the requests ?
Thanks.
Here is a bit of code where I create and register the URLMoniker:
<br />
STDMETHODIMP CIEPlugin::Invoke(DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags,<br />
DISPPARAMS* pDispParams, VARIANT* pvarResult,<br />
EXCEPINFO* pExcepInfo, UINT* puArgErr)<br />
{ <br />
switch (dispidMember)<br />
{<br />
case DISPID_NAVIGATECOMPLETE2 : <br />
BSTR url;<br />
m_spWebBrowser2->get_LocationURL(&url);<br />
DWebBrowserEvents2 *pstm;<br />
IMoniker* ppmk;<br />
CreateURLMoniker(NULL, url, &ppmk); <br />
IBindCtx *pbc;<br />
CreateAsyncBindCtx(0, this, NULL, &pbc);<br />
RegisterBindStatusCallback(pbc, this, NULL, 0); <br />
ppmk->BindToObject(pbc, NULL, DIID_DWebBrowserEvents2,(void**)&pstm); <br />
break;<br />
default:<br />
break;<br />
}<br />
return S_OK;<br />
}<br />
HRESULT CIEPlugin::BeginningTransaction (LPCWSTR szURL, LPCWSTR szHeaders, DWORD dwReserved, LPWSTR *pszAdditionalHeaders)<br />
{<br />
MessageBox(NULL, bstr_t(szHeaders), "B", MB_OK);<br />
return S_OK;<br />
}<br />
|
|
|
|
|
Hi All,
when im closing a socket, the windows socket library ASSERTS.
when I debugged the code it is happening byb the following statment at CAsyncSocket::Close function.
"VERIFY(AsyncSelect(0))"
I could not find out the problem. can u help me?
regards
Sarath
Sarath
|
|
|
|
|
I'm trying to use the CWnd::CreateControl method to create an .NET UserControl. Everything is ok until the control (window) is closed.
It seems that it is some reference count problem because the code stops at an ASSERT in the CCmdTarget class.
I provide an example. The client is built in VS 6.0 and the usercontrol is built in .NET 2005.
http://www.codeguru.com/forum/attachment.php?attachmentid=14627
Anyone else that have had the same problem. Please help me with this.
|
|
|
|
|
Hi,
How to convert an array of Hex values to int in Visual C, is there any function for converting?
chaitu
|
|
|
|
|
in what variable do u keep the hex values?????
if ur hex vaue is in some string u can use sscanf to convert it to integer..
nave
|
|
|
|
|
this doesn't mean anything to convert from hexadecimal to int...
hexadecimal IS an integer, but it only differs from the graphical representation...
if you have 32 apples, it is the same as having 0x20 apples...
what you certainly mean however is reading hexadecimal characters from a string (but that is important to know if it is a string or not) into ints... if so, sscanf() is done your you.
otherwise, give more details about what you really have, and what you really want...
cheers,
|
|
|
|
|
It is an array BYTE data[212 Byte], i would like to chanage the hex values saved in the array to int values, as i should decode the polar coordinates from the Hex values saved in the data array.
|
|
|
|
|
if it is an array of bytes, then you don't need to "convert", you only need to copy, because as i said in my previous post, hexadecimal is only a representation of the binary in memory...
|
|
|
|
|
v2.0 wrote: if you have 32 apples, it is the same as having 0x20 apples...
It reminds me of another discussion[^]
|
|
|
|
|
Cedric Moonen wrote: It reminds me of another discussion[^]
exactly... i wanted to link the post, but couldn't find it...
the comparison still deserves '5'
|
|
|
|
|
Ya i got it guys....actually am alramed, i would like to convert the Hex to decimal value
|
|
|
|
|
chaitanya22 wrote: Ya i got it guys
Nope you didn't get it, otherwise you would not have asked again. What do you want to do EXACTLY ? And don't answer 'converting hex to decimal value' because this is totally nonsense ! Again, I will express it another way: it's like asking "I have 7 apples, I want to convert these apples in hexadecimal". Mmmmh, sounds, err, how to say....special, isn't ?
This is the same for your question.
So, formulate your question precisely. What do you want to do ? Convert a string representing a number ?
|
|
|
|
|
I would like to convert Hex number i,e 40 or 0x0C or 0x04B to binary value or decimal value.
|
|
|
|
|
|
The function I think you're looking for is strtol() declared in <stdlib.h>.
strtol() takes a string and converts it into a long.
You'll find more info about it here[^].
Hope this helps
--
Roger
It's supposed to be hard, otherwise anybody could do it!
|
|
|
|
|
would that function convert Hex number to binary value?
for eg:0x65=1100101,, i would like to ahve so...
|
|
|
|
|
Even with the explanation of the apples you still don't get it. In other tearms: hex numbers and decimal numbers doesn't exist (it's a bad use of the language). Instead you should say hexadecimal REPRESENTATION or binary REPRESENTATION of a number.
Let's take an example:
int BinValue = 0b1100101;
int HexValue = 0x65;
int DecValue = 101;
In this example, all three numbers are exactly the same and if you compare them, the result will be true.
Hope it is clear now.
|
|
|
|
|
Do you mean a string in hexadecimal format? You can do such a conversion with strtol. If you set the last parameter to 0 it does even automatically detect the number base depending on the first characters, e.g. if you have a string like 0xFF it will be converted to the integer value 255.
Here is an example code:
<br />
const char* szNumber = "0x1234";<br />
char* pHelp;<br />
<br />
int nNumber = strtol(szNumber, &pHelp, 0);
Regards
Konrad
|
|
|
|
|
Hi
friends
I have a structure declared like this
typedef unsigned char byte;
typedef struct date
{
short year;
byte month;
byte day;
}date_t;
and a function
void function(date_t t)
{
}
here I want to set some default value to this argument "date_t t' say NULL.
void function(date_t t=NULL)
{
}
How I can do that?
|
|
|
|