|
QT is more easy to use than MFC, i think.
|
|
|
|
|
I have to agree there. I've only recently started getting into QT and I'm impressed. I can't see why I'd ever bother with MFC again if I was given a choice.
Steve
|
|
|
|
|
I'm currently updating my XCrashReport article, and I had forgotten that I have some assembler in it:
__asm
{
mov eax, fs:[4]
mov pStackTop, eax
}
The purpose of this is to get the top of the stack, so I can do a stack dump. Unfortunately, I need to replace it, since VS doesn't allow asm code when compiling for x64.
I have found this code, which works ok in x86:
NT_TIB *pTib = (NT_TIB *)NtCurrentTeb();
PVOID pStackTop = pTib->StackBase;
I am just wondering if this will work on x64 as well (haven't had a chance to try it yet).
Anyone have any experience with this technique?
|
|
|
|
|
In x64 , the FS register has been replaced by the GS register.
And you have to use compiler intrinsics instead of inline assembly.
The following intrinsics will allow you to read from an offset in the GS register.
__readgsbyte
__readgsword
__readgsdword
__readgsqword Just for completeness, there are also similar intrinsics available in x86 to read from an offset of the FS register -
__readfsbyte
__readfsword
__readfsdword
__readfsqword
|
|
|
|
|
Thanks, that looks more straightforward.
I got the stack top using
void *pStackTop = (void *) __readfsdword(0x04);
so on x64 I would use
void *pStackTop = (void *) __readgsdword(0x04);
Or would it be __readgsqword ?
|
|
|
|
|
Since all pointers are 64-bit in x64, I guess you should be using __readgsqword .
|
|
|
|
|
This sounds pretty dangerous to me, but I know how it can be when you just have to do some things.
You can declare a simple local variable and take its address, that will give you an address to begin working with.
But you need to ensure that the variable does exist (not removed by optimizer) and you then need to make sure you understand the stack frame layouts under both x86 and x64, they aren't the same.
Harry.
|
|
|
|
|
Hello,
I writed a program that saves data on file, its runs on windows XP ,but whan I execute it on windows 7 its not open the file, I understood its because the uac property,
if somebody know how can I disable the uac from my program ,
I would be vary thankfull for him.
thanks
|
|
|
|
|
I'm guessing you're creating the file in a folder that is not recommended like in C:\ or C:\Windows .
You should change this location so that you will not need elevated privileges.
|
|
|
|
|
can you give me example of recommended place to save the file?
thank you for the halp.
|
|
|
|
|
You could use the MyDocuments folder.
You can call SHGetSpecialFolderLocation with the CSIDL_MYDOCUMENTS parameter to get this location.
|
|
|
|
|
|
I had search in google, but all the template shown is for VB and C# only..is there anyone where can get it for MFC project?
|
|
|
|
|
Visual Studio contains templates for MFC which you can modify yourself or create new versions with the Custom Wizard project type.
It's time for a new signature.
|
|
|
|
|
If the MFC project templates didn't come with Visual Studio it might mean that you're using the express version that didn't ship with MFC. Even if you got the template you won't have the MFC headers, libraries and resources you'll need to create an app.
Cheers,
Ash
|
|
|
|
|
i had create a project wizard, but i cant debug in *.js file. is there any ideal how to debug the js file in visual studio C++ 2008?
i can put a breakpoint on the line , but wheb run the program, nothing is happen...
|
|
|
|
|
Hi,
I have an MDI application and its have three different views.
When user clicks on new button new types of documents window will com.
Now I want to control only one window for a view type.
How to do this one and where to do this one?
|
|
|
|
|
Your question is not clear at all. What do you mean exactly by "I want to control only one window for a view type" ? Could you please be more explicit and if possible explain with an example ?
|
|
|
|
|
Yes,I want to control only one window for a view type" ?
|
|
|
|
|
You only want one instance of a particular view type?
If so you could set a flag when showing a view.
So if the same view is selected in New, you could bring the already displayed view to the foreground.
|
|
|
|
|
Yes I will take the flag.I will try.
thank you I got it.
|
|
|
|
|
What "Yes" ? I didn't ask a question that can be answered by yes or no. I asked for more details that you still didnt provide. Can you please give a concrete example and a detailed description of your problem (I mean more than one line) ? The verb "control" doesn't mean a lot of things out without knowing the context.
And do you mean by view type exactly ?
|
|
|
|
|
cool cool I got idea.
what i want from superman.
|
|
|
|
|
Cedric Moonen wrote: I didn't ask a question that can be answered by yes or no.
Your second question could be answered with a yes/no response. I know that's not what you intended, however.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hi all,
can anybody please tell me how can i change or replace existing formview to another in SDI application.
thanks ina dvance.
|
|
|
|