|
Hi,
in OnDraw() function i draw one 3d effect rectangle by the following code.
pDC->Draw3dRect(SwtRect2,WHITE,DARKGRAY);
By this code,the rectangle looks like 3d rect.
Like the same way can we do that for Ellipse.
I use Ellipse() fucntion but it draws only a flat elipse.
I want to draw like Radio button,so i want that.
Pls help me.
Anu
|
|
|
|
|
Draw3dRect was introduced in Win3.1 to paint those shadowed rectangles that are the buttons.
Radiobutton look& feel are actually small bitmaps coming form user.dll, hence there is no direct API call.
The trick is to draw two ellipses, the first offset-ed by (2,2) with a pen of size 2 and a grayed color, and the second of regular (1) size, no offset, over the first.
More sophisticated looks can be found drawing three of them, one offset-ed to bottom-right (grayed) and another offset-ed to top-left (lighted) and a third "normal".
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
Hi,
Can any one send code to convert Modal dialog to modeless dialog & converting modeless dialog to modal dialog.
Thanks,
Venkat
|
|
|
|
|
Instead of the DoModal function, Call Create(), ShowWindow() function. Remeber, the CDialog object should not be local variable if you are calling Create() function. Other wise, the window will be destroyed when the object goes out of scope.
|
|
|
|
|
It's all described here[^].
It's time for a new signature.
|
|
|
|
|
Hi,
can any one send the code for converting SDI application to MDI application & code to convert MDI application to SDI application.
Thanks,
Venkat
|
|
|
|
|
There is no direct conversion, the applications are constructed differently. Take a look at the MDI documentation[^].
It's time for a new signature.
|
|
|
|
|
Probably the simplest way is to create a new MDI project, and then re-use the document and view classes of the SDI app.
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
What would be some good ways to exit a C++ program in a way that captures a trace or dump on the way out? Would that dump be human readable or would it somehow load into the VS system and be viewed that way?
|
|
|
|
|
I'm not sure i understand what you mean but check this[^], maybe it can help.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
In my program I have a main thread and many subordinate threads. I use waitformultipleobjects for communication between them. If the main thread is spending too much time doing something (maybe stuck in a loop) then the subordinate threads back up. When one of the subordinate threads gets backed up it's coded to cause a programmatic exit(). Prior to the exit I want to get a snapshot of what's going on so I get try to figure out what the main thread was doing at that time.
|
|
|
|
|
There is a function MiniDumpWriteDump[^] in the Dbghelp.dll. if you call that function it will create a dump file for you.
Later you can analyze this dump using WinDbg.
|
|
|
|
|
Aside of creating that minidump, if possible you could simply create a debug build, place a breakpoint at that exit call (or whatever location suits you) and run it with a debugger, then when it hits the breakpoint you can look around call stacks, memory and whatnot.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
Hey guys, thanks for your feedback. I'll try out these suggestions.
|
|
|
|
|
Hi,
I am newbie to vc++,So kindly bare with me.
Some malicious exe file running in a folder c:\documentsandsetting\alluser\globel\phunk.exe
I have killed the phunk.exe from the process and now i want to delete the file phunk.exe from the folder.
how can i implement GetAllUsersProfileDirectory() APi to delete the file please can anyone put the same code for the above scenario.
|
|
|
|
|
Not an answer to your question, but when you say "kindly bare with me" it sounds like you're asking the reader to get naked with you.
You need to use the spelling "bear" which means the big fuzzy ursine critters as well as carrying something. It's an easy mistake to make - quite a few Americans I know keep saying they support the right to bare arms, which is fairly non-controversial if you use sun-screen.
Cheers,
Ash
|
|
|
|
|
hi i am very sorry for my bad englsih...
|
|
|
|
|
No probs, wasn't a dig at your standard of English - it's an easy mistake to make.
Ash
|
|
|
|
|
Hi.
Your question isn't quite clear. For one, why do you want to delete that file programatically, what you say suggests you simply want to delete a file, so locate it in windows explorer, right click it and select "Delete". You shouldn't have the need to write a program for that. For two, GetAllUsersProfileDirectory[^] simply gives you the path to the "All Users" folder, it doesn't delete anything, but i will assume you know that and you are simply asking how to use this function, something like this (not tested, error checking ommited):
DWORD charsNeeded;
GetAllUsersProfileDirectory(NULL, &charsNeeded);
TCHAR *FolderPath = new TCHAR[charsNeeded + 1];
GetAllUsersProfileDirectory(FolderPath, &charsNeeded);
... the path should be in the FolderPath buffer now, do whatever you want with it...
delete []FolderPath;
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
Hi,
I need to use _contolfp_s function in vc6 to set the floating point control word.
I have already used _controlfp and it is working fine
#include "float.h"
_controlfp(_CW_DEFAULT, 0xFFFFF);
but it seems this is deprecated function and I have to use the new _contolfp_s.
But using this _contolfp_s gives an error undelared identifier as it is checking in the path
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\float.h
I have to Include the below path for my vc6 application
C:\Program Files\Microsoft Visual Studio 8\VC\include\float.h
Where should I Include this?
Thanks
Satya
Today is a gift, that's why it is called the present.
|
|
|
|
|
I haven't used it in years but I doubt VC6 has an implementation of _controlfp_s. Just keep using _controlfp and everything should works swimmingly.
Looking at the error message it looks like you've got VC++ 7.1 installed as well and VC6 is picking up the paths. VC6 and later don't exist together too well so it might be worth isolating them on different computers or virtual machines.
Cheers,
Ash
|
|
|
|
|
Dear all:
I know that I can control the NB screen brightness by using WMI. But it seems that I cant use WMI to change the screen contrast. So if I want to do this work, how can I do it? Can I do it with DirectX?
|
|
|
|
|
Hello,
I need to check that whether a given binary is a valid PE file (Perhaps might some one can rename java file/class file or .js/html files to .exe or .DLL ). In this case i suspect that e_magic field of FileHeader structure would tell this..
or any other field will let the user know about the validity of PE file?
Regards
Usman
|
|
|
|
|
Am not sure if this is what you are looking for or not but here[^] they say:
Old MS-DOS .exe files and the newer Microsoft Windows PE (Portable Executable) .exe files start with the ASCII string "MZ" (4D 5A), the initials of the designer of the file format, Mark Zbikowski. The definition allows "ZM" (5A 4D) as well, but this is quite uncommon.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
The PEF specification is a large set of rules that must be obeyed. Obeying some of them is insufficient to be a valid EXE file. So you could check a few of those rules to rule out the obvious violators, you would have to check everything to be absolutely sure it is a real EXE though.
If all you want to do is discard some obvious non-EXE files, look at the first two bytes, and a couple of the header bytes such as the e_magic field.
|
|
|
|