|
How could I get if a user have "administrative privileges" ??
[]'s
Cris.
|
|
|
|
|
check out MSDN's "Windows NT Security in Theory and Practice". AccessCheck is one of the API names you should probably use.
|
|
|
|
|
Hi:
Does anyone know how to disable a button that has a bitmap on it? I'm trying with EnableWindow(TRUE/FALSE) and it disables the button but the bitmap it's gone. Any ideas? One more thing, the buttons are in a dialog. Any answer is more than welcome.
Have a good day,
Luis E. Cuadrado
)
|
|
|
|
|
What kind of button is this? I mean, it's not your plain-vanilla CButton, right? Could it be that it's expecting a bitmap for the "Disabled" state, which you haven't provided?
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
plain-vanilla CButton...that was a good one
Well, I think is a CButton because I added a member varialbe using Class Wizzard, and the button has an object ID. To be honest, I didn't wrote the code to make the button enabled and working. Someone else did it and is not with us anymore. I worked with the regular buttons before, but not with those that have bitmaps on it. I was looking arround the code and this is what I think the other person did:
m_autoBitmap.LoadBitmap(IDB_AUTO);<br />
::SendMessage(::GetDlgItem(m_hWnd, ID_AUTO_BTN), BM_SETIMAGE, IMAGE_BITMAP, (long)m_autoBitmap.operator HBITMAP());
Does this helps? If you need anything else let me know.
Thanks again Alvaro,
Luis E. Cuadrado
)
|
|
|
|
|
Check the properties for ID_AUTO_BTN (in the resource editor). Make sure it has "Bitmap" checked.
I'm not familiar with regular buttons with bitmaps, using the CButton class. You may want to consider using the CBitmapButton class instead which handles 4 different images for the different states. I don't know if CButton handles the Disabled state properly.
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
I am attempting to use a boolean variable to terminate the calculation loop of my program early in case overflow will occur. I would like for my program to continue normally displaying the partially calculated factorial value and processing additional input. Right now it displays an error message and then shows the overflow value and terminates. Please help.
const int MAXCOUNT = 4;
int main()
{
unsigned long product = 1;
unsigned int n, counter = 0;
int i=0;
bool overflow=false;
while (counter <= MAXCOUNT && !overflow)
{
cout << "Enter a non-negative integer:";
cin >> n;
do //calculate n!
{
i++;
if (product > (ULONG_MAX/i)){
overflow = true;
if (overflow = true){
break;
cout << "Error! Value beyond limits. " << endl;
}
break;
}
product = product * i;
} while (i < n);
i=0;
cout << "The value of " << n << "! is " << product << endl;
cout << counter << endl;
counter++;
product=1;
cout << counter << endl;
|
|
|
|
|
if (overflow = true)
you could try changing that line to
if (overflow == true)
and it might help a bit. Can't spot anything just now other than that though, hope you can get it fixed up.
|
|
|
|
|
One way to eliminate hard to see syntax errors like this one is to always put the constant on the left hand side.
if( true == overflow )
You will get a compile error if you try to put
if( true = overflow )
when you wont with
if( overflow = true )
Just my $0.02
Bret
|
|
|
|
|
I test a dialog base program about CEdit subclass. I have Subclass My CEdit, when I input some characters then press enter key, the cursor only move one character. I add muti line with TRUE (Design), when I press enter key, my program exit. This why? How I do?
|
|
|
|
|
Richard White wrote:
I add muti line with TRUE (Design)
And I think you must add the flag "want return" in the same tab where you've found "multi line"
I think...
Hello World!!!
from Raphaël
|
|
|
|
|
Moreover, If you want add some line text with your code you must use a carriage return + line feed caracters (that's: "\015\012" ) for a new line...
Hello World!!!
from Raphaël
|
|
|
|
|
The Enter probably presses the default button (OK). New line in edit is inserted by Ctrl+Enter. You need to set the "Want return" style for the edit box in resource editor.
Pavel
Sonork 100.15206
|
|
|
|
|
Thanks Raphaël Kindt , Raphaël Kindt, Pavel Klocek
I known how to do in design period, now I test CEdit subclass, following line doesn’t work, the cursor only moves one character when I press enter key.
//In Dialog BOOL CMyDlgEditDlg::OnInitDialog () function
...
m_MyEditCtrl.SubclassDlgItem (IDC_EDIT1,this);
...
//In CMyEdit
void CMyEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
if ( nChar==VK_RETURN)
{
TRACE0("You Press Return Key\n");
ReplaceSel("\r\n");
return;
}
CEdit::OnChar(nChar, nRepCnt, nFlags);
}
|
|
|
|
|
Is the a specific reason for why IS forgets some classes?
This has happened to me a few times before and is pretty annoying.
CRect GetTileBounds(Uint32 tileID, CxImage *ts, Uint32 zoom)<br />
{<br />
int i = ts->GetHeight();<br />
<br />
return CRect(0, 0,0, 0);<br />
}
The function compiles just fine, however, when I type "ts->", then I get...
Expression to the left of . or -> has a type which could not be resolved
CxImage is included in the stfafx.h, so I cannot see what the problem is... any advice?
|
|
|
|
|
I don't see your point. If you only type "ts->" and then compile, sure it will throw you an error
~RaGE();
|
|
|
|
|
It's not that he mean, I know what he mean because I've seen that before too!
Sometimes intelli sense stop working. When you type "object." or "object->" you'd expect that VC will show a menu with all members etc. But it doesn't.
I don't know why it does like this, but sometimes you just need a restart of VC and sometimes a restart of the whole system.
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Sorry, now i get it too. I know the pb, but there is no solution
~RaGE();
|
|
|
|
|
I have also tried deleting the NCB file. I am not sure if that really helps.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Sometimes closing VC and reopening helps.
Sometimes closing VC, deleting the *.ncb, *.opt and *.pos files in your Project dir and repoening helps.
Sometimes you simply have to live with it.
Especially when using levels of pointers casted into another type, you can easily ask too much of the poor parsing code.
Maybe it gets better with VC7?
"My opinions may have changed, but not the fact that I am right."
Found in the sig of Herbert Kaminski
|
|
|
|
|
jhwurmbach wrote:
Sometimes closing VC, deleting the *.ncb, *.opt and *.pos files in your Project dir and repoening helps.
That usually works for me.
- Nitron
"Those that say a task is impossible shouldn't interrupt the ones who are doing it." - Chinese Proverb
|
|
|
|
|
Hmm I'll try deleting them. I didn't know about opt and pos files, just tried deleting the NCB.
Thanks to everyone who answered
|
|
|
|
|
Close the workspace (or solution if you're using VS.NET), delete the .NCB file, and reopen the workspace/solution. Deleting the .APS file will also help with problems with the resource editors sometimes.
Software Zen: delete this;
|
|
|
|
|
Hello everybody!
I've got a customer asking for a Windows printer driver that can render the output into a compressed TIFF image file.
I've never written a printer driver before so I am looking for pointers in the right directions.
My requirements are that it should be a regular Windows driver (98/Me/NT4/2000/XP) and it should work exactly like a standard printer driver with the difference that the output has to go to a file instead of a printer.
Any help is highly appreciated. I guess someone has already made a library or some source code of a skeleton of a driver like this. The main problem I see is grabbing the output sent to the driver and decode it and find out its format.
Thanks!
Valerio
|
|
|
|
|