|
i want to change the default icon of which appears in window title (white box icon)
|
|
|
|
|
Then try like this if you using MFC.
BOOL CMyDialog::OnInitDialog() {
...
HICON hIcon = AfxGetApp()->LoadIcon(IDI_ADV_DATA);
SetIcon (hIcon, TRUE);
SetIcon (hIcon, FALSE);
return TRUE;
}
Or you write simple win32 style code, like this.
BOOL CALLBACK DlgProc(...) {
switch (..) {
case WM_INITDIALOG:
...
{
HICON hIcon = LoadIcon(0,MAKEINTRESOURCE (IDI_ADV_DATA));
SendMessage(hDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
SendMessage(hDlg, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
}
return TURE;
....
|
|
|
|
|
Thanks ...your code gives success
|
|
|
|
|
Hi,
Im looking for source code for an AD snap-in that allows wake on lan, or shuting down of all or some of the machines in an ou. can find pleanty of source for the wol and shutdown parts, but im stuck on intergrating it into AD.
Any help would be much appreciated.
|
|
|
|
|
Hi,
I have an application that uses the cluster-api (clusapi.dll) on Windows Server 2003. When I run my application under the Administrator account the call to the method OpenCluster works fine, but the problem is that not all users of my application are in fact administrators and when I call GetLastError after the call fails it says: Access is denied
I realize that someone belonging to the Users group are not allowed to make that call, but I can't find in MSDN (or anywhere else) why this is the case and I'd like to check if anyone knows a way around this.
This code always returns NULL since hCluster is NULL after the call to OpenCluster:
HCLUSTER hCluster;
hCluster = OpenCluster( NULL );
if( hCluster == NULL )
{
return NULL;
}
I'm more used to C# coding, but I have written a dll in C++ containing all the cluster functionality I need (and then using that dll in my C# project via p/Invoke).
Any ideas around this would be appreciated.
Thanks!
|
|
|
|
|
Calla wrote: I'd like to check if anyone knows a way around this.
If you did find a way to circumvent security and Microsoft found out, they would likely fix the security hole and then the work around would no longer work anyway. It would be safer to just follow guidelines.
|
|
|
|
|
I guess you're right lm - thanks for your reply. So this is obviously done by design from MS. Well, do you know if there is a way to find out if an NT Service is part of a cluster group? That's what I really need to find out.
|
|
|
|
|
Calla wrote: do you know if there is a way to find out if an NT Service is part of a cluster group?
No, I have no experience with that scenario. Have you looked at the clustering API documentation[^]?
|
|
|
|
|
Yes I have, but no luck yet
Well, thanks anyway!
|
|
|
|
|
Calla wrote: Yes I have, but no luck yet
Sure, it sort of makes sense since the point of clustering/balancing is that you should not have to know which specific machine something is running on. If I were in your shoes, I would want to make sure there is an actual need for what you are trying to do. It seems contradictory.
|
|
|
|
|
|
|
This is sad, but I understand how you are feeling.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Hi, I have only recently got back to VC++ programming and I was only a rookie when I used to program in it but now I need to create an application that can list all the devices attached to the system like "devcon.exe" does. I only just started coding it and I'm now facing a linker error that I just can't resolve! The path to my SETUPAPI.h file exists in the "Directories" under options. And I'm only calling the "SetupDiGetClassDevsEx" function. The program compiles fine but gives the following error while linking:
DeviceMDlg.obj : error LNK2001: unresolved external symbol __imp__SetupDiGetClassDevsExA@24
Debug/DeviceM.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
DeviceM.exe - 2 error(s), 0 warning(s)
Please help! I'm losing my mind!
Thanks and sorry if it's a really stupid question
*** What do you mean add SetupAPI.lib to the linker files list?? Paths of both header and lib file are listed under the "Include files" and "Library files" options. Also SetupAPI.h and .lib are present in the default path ~/VC98/Include and ~/VC98/Lib. I didn't add any external library. Any ideas??
modified on Friday, June 5, 2009 12:36 AM
|
|
|
|
|
You should add SetupAPI.lib to the linker input files list.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I'm sorry if I didn't specify it earlier but please look at the extra detail I've added to the end. Is there anything else I need to do too?
|
|
|
|
|
I've also noticed something now. MSDN shows that SetupDiGetClassDevsEx accepts 7 parameters but I guess VC++6.0 uses an older version as the SetupAPI.h header file in the default path(~/VC98/include) accepts only 6 parameters. So I tried to use the header and lib files available with Windows DDK which has SetupDiGetClassDevsEx with 7 params. But the two seem incompatible as now it shows me 37 errors at compile time, all in the header SetupAPI.h. Any help about how to handle this?
|
|
|
|
|
callousfantom wrote: What do you mean add SetupAPI.lib to the linker files list?? Paths of both header and lib file are listed under the "Include files" and "Library files" options. Also SetupAPI.h and .lib are present in the default path ~/VC98/Include and ~/VC98/Lib. I didn't add any external library. Any ideas??
You should explicitely add SetupAPI.lib to the list of the linker input files (I suppose it is in Project Menu->Settings , Link tab, Category->General->Object/library )
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks!
|
|
|
|
|
How to load and display an image in C++?
|
|
|
|
|
#include "AtlImage.h"
cImage m;
m.Load(_T("C:\\1.jpg"));
m.BitBlt(0,0,640,480);
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Thanks for ur reply. I hv a query
is it a standard lib?? Can i hv cod using std. lib. only?
|
|
|
|
|
shyampasari wrote: Can i hv cod using std. lib. only?
Do you pay for each keystroke?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
what about CImage (and related stuff) ?
This signature was proudly tested on animals.
|
|
|
|
|
How to include it on MS Visual C++??
|
|
|
|