|
Sauce! wrote: I have been searching about for an article I had a while back that details some of the errors that can occur between a debug or release build and how to fix them, but I've had no luck with that.
Perhaps it was this one.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
YES! Thankyou!
<3 <3 <3 <3 <3
|
|
|
|
|
If we declare a function pointer as
typedef void (*myPtr)(void);
myptr NewPtr;
This means that NewPtr is a function pointer of type myptr, where myptr is inturn a function pointer to a function which returns void and takes no function parameters.. then what does the below piece of code mean?
Can somebody please interpret this piece of code for me?
typedef NTSTATUS (NTAPI *pfnNtQueryInformationProcess)(
IN HANDLE ProcessHandle,
IN PROCESSINFOCLASS ProcessInformationClass,
OUT PVOID ProcessInformation,
IN ULONG ProcessInformationLength,
OUT PULONG ReturnLength OPTIONAL
);
pfnNtQueryInformationProcess gNtQueryInformationProcess;
Thanx
-- modified at 9:07 Thursday 4th October, 2007
|
|
|
|
|
exactly the same as your code, at the difference that the pfnNtQueryInformationProcess is a typedef to a function pointer to a function which returns a NTSTATUS and gets as parameters a HANDLE, a PROCESSINFOCLASS, a PVOID, an ULONG, and a PULONG...
then you declare a variable gNtQueryInformationProcess of that type so defined...
what don't you understand in this ?
|
|
|
|
|
Then it should have been declared as
typedef NTSTATUS (*pfnNtQueryInformationProcess)(
IN HANDLE ProcessHandle,
IN PROCESSINFOCLASS ProcessInformationClass,
OUT PVOID ProcessInformation,
IN ULONG ProcessInformationLength,
OUT PULONG ReturnLength OPTIONAL
);
pfnNtQueryInformationProcess gNtQueryInformationProcess;
What is this NTAPI in between? What is its signifance?
Thanx
|
|
|
|
|
kiranin wrote: What is this NTAPI in between
it is the calling convention... see how it's defined if that interrest you, but it's probably one of these : __stdcall, __fastcall, __cdecl, __thiscall...
|
|
|
|
|
hm.. yeah dats rite.. its a calling convention.. herez the piece of code frm winnt.h
#if ((_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)) && !defined(_M_AMD64)
#define NTAPI __stdcall
#else
#define _cdecl
#define NTAPI
#endif
Thanx
|
|
|
|
|
pfnNtQueryInformationProcess is a function pointer to a function that returns NTSTATUS , has an NTAPI calling convention, and takes five arguments.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi all,
I am busy testing the use of minidumps, but I received this messge
Debugging information for @project 1.exe' cannot be found or does not match.
Binary was not built with debug information.
I am well aware of how to do it in Visual Studio
You can use the following options:
Compiler: /Zi (/Z7 and /ZI can also be used in some cases - see their documentation for more information)
Linker: /debug (in release builds also use /opt:ref option)
All these options can be set in the IDE.
My question is, how can I do it in Borland Developer Studio 2006 ??
Can anyone please help me ??
Many thanks
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Hi All,
I am doing project in VC++ 6.0 in which i am displaying tabs on the window area.I want to load a particular page whenever user click on particular tab.These tabs are created at run time.So how can I identify which tab is clicked by user.If anybody know the solution of this, then please forward it me.
Thanks in Advance
Atul
|
|
|
|
|
you wil recieve a TCN_SELCHANGE message when user changes the tab item.
|
|
|
|
|
Atulmahajan wrote: So how can I identify which tab is clicked by user.
Check out the PSN_SETACTIVE notification.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Does anyone knows if
in file.h
namespace MyNamespace{
...
enum MyEnum{
...
EnumItem,
....
};
...
};
then in file.cpp
using namespace MyNamespace;
...
foo(MyNamespace::MyEnum::EnumItem, ..);
or
foo(MyEnum::EnumItem, ..);
...
gives error C2825 and error C2275 in the first case
and
gives error C2039 in the second case
It doesn't work also if I remove the line using (of course then using extended variable usage)
can it be related to a bug of the compiler in VS2003? I'm quite sure that I'm not wronging the code sintax.
Russell
|
|
|
|
|
Hmm. This
namespace MyNamespace{
enum MyEnum{ EnumItem,SecondItem };
};
int _tmain(int argc, _TCHAR* argv[])
{
MyNamespace::MyEnum firstItem = MyNamespace::MyEnum::EnumItem;
MyNamespace::MyEnum secondItem = MyNamespace::MyEnum::SecondItem;
return system("pause");
} gives a warning C4482: nonstandard extension used: enum 'MyNamespace::MyEnum' used in qualified name with VC 2005.
That is meaning that enums are second class citizens and the correct way of refering them would be:
MyNamespace::MyEnum firstItem = MyNamespace::EnumItem;
MyNamespace::MyEnum secondItem = MyNamespace::SecondItem;
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
yes!
you are right.
I found only now your same conclusion.
thank you
Russell
|
|
|
|
|
Sorry,
looks solved:
this is a wrong usage
MyNamespace::MyEnum var=MyNamespace::MyEnum::EnumItem
this is correct
MyNamespace::MyEnum var=MyNamespace::EnumItem
Russell
|
|
|
|
|
i am using list control in report view and want to color the header of that list control, how this is done
malik
|
|
|
|
|
AFAIK either you need to owner draw it or Custom draw( LVN_CUSTOMDRAW ) it.
|
|
|
|
|
custom draw is only way to do so.. for that you have to subclass CListCtrl
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
hi
I need to call the following function somewhere in a program:
void __fastcall TFormMain::btnUpdateClick(TObject *Sender)
{.....}
This is the event of mouse-click on a button.
How can i call this function in the program itself (which otherwise gets called on 'mouse-click'??
|
|
|
|
|
Try sending a WM_COMMAND message to the button
ex:SendMessage(WM_COMMAND,/*ID_OF_BUTTON*/);
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
By calling it directly. I do not know how the function is implemented, so I do not know if it can handle a NULL Sender parameter or not - e.g.:
btnUpdateClick( NULL ); If you have to call it outside of the TFormMain class, you need a way to expose it from that class.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
|
Hi
can anyone help me finding a book about developing "com add-in" for office applications using mfc ?
thanks alot
Tarek
|
|
|
|
|
See Here ....[^]
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|