|
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.
|
|
|
|
|
HI sir,
How can i get handle of another window.
I am tryiong to send a message to static text box,which is in another window,how can i do it.
I am trying with this.
I have 2 window example (a) and (b)
n a.h
I am doing as
extern HANDLE hwnd;
in b.cpp
HANDLE hwnd;
and using this function to display the message
SetDlgItemText(hwnd,IDC_STATIC1,"ds");
But the the handler is not coming here.
what changes i have to do,please let me know.
Thanks
Raj
|
|
|
|
|
You may use such global (there are better ways, I believe), however you have to properly initialize it at runtime.
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]
|
|
|
|
|
Have you intitalised hwnd to the handle of the text box? Perhaps if you show some more of your code it will become clear.
It's time for a new signature.
|
|
|
|
|
Richard MacCutchan wrote: Have you intitalised hwnd to the handle of the text box?
This is what i am doing.
I have created one dialog based application(say Test)
In that dialog,i have added one static text box(IDC_MYSTATIC).
From that dialog i am invoking another dialog(say Test1).
In that dialog,i have added a button as(Display message).
My plan is when i click that button.I want to display some msg on
(Test) dialog.
So what i am doing is:
IN Test.h.
extern HANDLE hwnd;
Then in second dialog.
In Test.cpp
HANDLE hwnd
Then on
DisplayMesage()
{
SetDlgItemText(hwnd,IDC_MYSTATIC,"ds");
}
I dont know whethier i am passing handle correctly or not.
I am getting hwnd as NULL
Thanks
Raj
|
|
|
|
|
If your code shows the actual runtime flow then hwnd is not initialized when you call SetDlgItemText .
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]
|
|
|
|
|
Well you have answered my question with "no", so it is no surprise that it does not work. The value of hwnd must be the handle to the window containing the item that you are trying to set the text of. Defining a variable in a header file has no effect on this, you need to get its value from within your Test1 dialog. I would guess (if you are using DoModal() to run Test1) that the correct value can be found from the GetParent()[^] function.
Perhaps a bit more time studying the basics of Windows Programming (Charles Petzold[^] has written some excellent guides) would be useful.
It's time for a new signature.
|
|
|
|