|
Hi,
just found some code that might help you:
HANDLE GetMutex()<br />
{<br />
CString Key = m_FileName;
Key.Replace('\\', '_');<br />
<br />
HANDLE hMutex = ::OpenMutex(SYNCHRONIZE, TRUE, Key);<br />
<br />
if (!hMutex) {<br />
SECURITY_ATTRIBUTES sa;<br />
<br />
sa.nLength = sizeof(sa);<br />
sa.lpSecurityDescriptor = NULL;<br />
sa.bInheritHandle = TRUE;<br />
<br />
hMutex = ::CreateMutex(&sa, FALSE, Key);<br />
}<br />
<br />
return hMutex;<br />
}
cu.
a.
i know nothing
|
|
|
|
|
|
hi i have to disable UAC in vista while running my application and at last i have to enable it. how to do this in vc++. im a new bie to vista. pls help me
|
|
|
|
|
You have a non Vista compliant application. I advise you to read and Michael Dunn's articles about Vista here at CP.
If you really need "Admin stuff" in your app, you have to redesign it so, some buttons have a shield icon and start an Real Admin exe.
Greetings from Germany
|
|
|
|
|
You can turn UAC off for a particular user but not switch it on and off willy nilly like you’re after.
Steve
|
|
|
|
|
Is this a good tip? I dont believe so.
(I answered him to)
Greetings from Germany
|
|
|
|
|
Hi all,
How would one go about using the delete command when working with AnsiString?
I have tried:
AnsiString Test;
...
delete [] Test;
But received this error: [C++ Error] E2157 Deleting an object requires exactly one conversion to pointer
operator.
Can anyone help me?
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
AnsiString Test;
is'n allocated dynamically, so you don't need to delete it;
Even it's allocated dynamically via AnsiString *str = new AnsiString("test");
you only need to delete it via "delete str" and not via "delete[] str"
Regards
|
|
|
|
|
|
I have read this article:Memory leaks in C++ and how to avoid them[^] , and it stated the following:
A memory leak is what happens when you forget to free a block of memory allocated with the new operator
or when you make it impossible to do so.
So can I assume that that one only free's a block of memory when the new operator was used.
i.e.
char *string;
string = new char[20];
delete [] string;
char *tString = "this is a test; // is it nessacery to delete this pointers memory??
Many Thanks
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Programm3r wrote: So can I assume that that one only free's a block of memory when the new operator was used.
i.e.
Programm3r wrote: char *tString = "this is a test; // is it nessacery to delete this pointers memory??
You can assume so, compiler allocated memory for constant string and let the compiler free's it.
|
|
|
|
|
|
Read the MSDN about new and delete ...
Greetings from Germany
|
|
|
|
|
Dear all
I need to develop a new algorithm for clustering( for example, human, animal and inanimate objects). actually this is a brand new topic for me. i never did such topic before. does anyone has any clustering code using VC++, let me work as reference. thanks a lot.
urgent!!!!!!!!!
Li Zhiyuan
4/07/2007
|
|
|
|
|
Think about a class structure. Basic class maybe "CObject" and derive other classes with additional features. They all can you put in a CObjArray. (MFC)
This is a real student task.
Greetings from Germany
|
|
|
|
|
Hi all,
How to find programmatically (C++/MFC) whether entered text is LTR - Left To Right (English) or RTL - Right To Left (Arabic) text.
Thank you
|
|
|
|
|
HI. Is this question is regarding a particular control or edit box / OR / any for string?
Nice talking to you. If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
|
This depends on the actual system language better check this with GetLocaleInfo(...)
Greetings from Germany
|
|
|
|
|
What if Locale is Set to English, and Arabic is selected from Language Bar. GetLocaleInfo() won't help..
|
|
|
|
|
Each entered character has a UNICODE code point. It is possible to look at the numerical value of that code point and determine what language it is from by what range of numbers it is in. I don't have the windows code to hand as I'm not at work today but you'll probably want to look at The UNICODE consortium[^] for a start to get an idea of what LTR and RTL languages are defined. Part of the information windows will give you on any given character is an RTL flag. This on its own is not enough to determine language though as both Hebrew and Arabic RTL languages are supported on Windows.
I spent most of last year developing a mixed LTR/RTL English/Arabic/Chinese/Japanese/Korean capable edit control for Windows CE and my brain only partially melted
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
|
|
Hi all,
I am from c,c++ background... i am working on VC++ from last few month.. i want to know about the interview question that can be asked... can anybody guide me...
Thankns in advance...
Tasu
|
|
|
|
|
you want interview questions?
Just i am posting a link for asp.net but it not contails only asp dot net. it contains all interview questions.
Many interview questions
Nice talking to you. If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|