|
I am putting together something and I need to get a list of active windows and the window that is on top, or in focus. How exactly could I go about this? I would imagine there is a specific function to call to for this. Does anyone know what it might be?
-- modified at 14:26 Tuesday 7th November, 2006
|
|
|
|
|
Did you want to do this in C++/CLI (.NET), or did you ask in the wrong forum ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Well I wanted to do it in C++ but if this C++/CLI is actually .NET then never mind. I suppose I should move it to Visual C++/MFC?
|
|
|
|
|
Yes.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I know how to read string values from Access db,
like:
CString strFields[5];
COleVariant varstring
for(field=0; field<5;field++)
{
recordset.GetFieldValue(field, varstring);
strFields[field]=V_BSTRT(&varstring);
}
then the string value from db. goes into strFields
But what if I know the strFields, and want write to update the db.
Does anyone know the adverse procedure?
|
|
|
|
|
This has nothing to do with "managed" development and you cross posted it into 3 forums and that subject is covered in several articles here on CodeProject. So to sum up.... stop posting garbage and do some work.
led mike
|
|
|
|
|
hi all!
I'd like to use Secure CRT memcpy_s(params); instead of old non-secure memcpy( params );
How to use it? where can I get all the necessary headers (and libs?) to use secure CRT in my proj?
thanks in advance,
d.coder
ps:
I use Microsoft Visual C++ .NET (develppment environment 2003 version 7.1.3088)
I've read about Secure CRT in this article:
"Employ Secure CRT Functions in Your C/C++ Applications"
http://www.codeguru.com/csharp/csharp/cs_misc/security/article.php/c11205/
|
|
|
|
|
You can't. It's only in VS2005. Yuo can write your own, it's kind of trivial to do so.
And, this is not a managed C++/CLI question.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian Graus wrote: You can't. It's only in VS2005.
Hey CG,
While I am not 100% sure, I believe the sceure CRT was introduced in VC 2003, except that it didn't raise the warnings.
|
|
|
|
|
Yes, VS2003 had Strsafe functions! The replacement for strcpy was StringCbCopy for example. In order to use the Strsafe functions you had to do he following:
#define STRSAFE_LIB
#include <strsafe.h>
After doing the above, the compiler will view the older functions as deprecated, and the compilation will terminate with errors.
Geo
|
|
|
|
|
what are the base class variables can be accessible in below 3 derived classes ?
class base
{
public int i;
private int j;
protected int k;
}
class deriv1:public base
{
}
class deriv2:private base
{
}
class deriv3:protected base
{
}
-- modified at 8:10 Monday 6th November, 2006
Govindarajan,B.
|
|
|
|
|
Yes they are accessible,
in the first case
deriv1 class gets i,j,k in its public region.
in the second case
i,j,k become private in class deriv2
in the third case i,j,k become protected in class deriv3
but a class can access its variables, so all the three variables are accessible in all the three classes.
regards
Prashant Sabnekar
Regards
S.Prashant Sabnekar
|
|
|
|
|
Hi,
Thanks for your answer .
I have modified the varible's access specifier in base class now.
Before I forgot it.
I want the solution with this modification.
Thanks.
Govindarajan,B.
|
|
|
|
|
Do not listen to Prashant he doesn't know that he is talking about. Use the compiler to figure out the answers for your self.
led mike
|
|
|
|
|
Hi Mike,
The question is changed.
Earlier he kept everything public(i,j,k) so I said these are going to be public,
now he changed them to public, protected, & private.
My comment was actually to the previous question.
Prashant Sabnekar
Regards
S.Prashant Sabnekar
|
|
|
|
|
Prashant Sabnekar wrote: The question is changed.
Ah, well yeah that makes a difference.
led mike
|
|
|
|
|
Prashant Sabnekar wrote: deriv1 class gets i,j,k in its public region.
No, that is wrong.
Prashant Sabnekar wrote: so all the three variables are accessible in all the three classes.
Wrong again.
led mike
|
|
|
|
|
|
Hi Govindrajan,
First of all I want to say everybody that you have changed your question.
earlier you kept everything in public, now you have changed them.
Your solution is :
class deriv1 inherits variables i & k from class base.
i becomes public in class deriv1
k becomes protected in class deriv1
class deriv2 inherits variables i & k from class base.
i becomes private in class deriv2
k becomes private in class deriv2
class deriv3 inherits variables i & k from class base.
i becomes protected in class deriv3
k becomes protected in class deriv3
Regards
Prashant Sabnekar
Regards
S.Prashant Sabnekar
|
|
|
|
|
Actually, this is all mute since this is the C++/CLI forum, and C++/CLI only supports public inheritance.
|
|
|
|
|
Hi to all,
I want to stop a console application programatically in C++ by not using TerminateProcess function. For window applications, I send WM_CLOSE message to the application to stop the process but I could not find a way to do it in a similar way for console appliactions.
Do you have any suggestions?
ebru dogan
|
|
|
|
|
Does it have a message loop? If so, you could try a WM_QUIT message.
|
|
|
|
|
I used the Visual C++ wizard to create a Windows Forms Application and the namespace for the main form in the project header file defaulted to the project name. I'd like to change the namespace to match that of some unmanged code I have, but any time I modify the namespace, the Windows Forms Designer cannot parse the header file. Since the namespace I'd like to use is not a top-level namespace (it has :: in it), creating a new project with the namespace I want is not an option. I am currently using .NET 2003 but will soon be upgrading to 2005, so a solution in either environment would be much appreciated.
Thanks!
-alex
|
|
|
|
|
:: scopes namespaces in C++, but not in .NET. I suspect you need to replace the :: with nested namespaces, as that's what they are.
I am not sure if managed and unmananged code can share a namespace name.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I was silly. The easiest way to fix this is just to define a namespace alias in the header file before the automatically generated code.
|
|
|
|