|
boon kian wrote:
BOOL BOAPI ShowMessage (int, int)
That entirely depends on what the BOAPI macro is defined as. It's probably a calling convention such as __stdcall
boon kian wrote:
#typedef bool (TYPEOF_InitP) (int* a);
Assuming the # is a typo, that still isn't legal AFAICT. If you meant
typedef bool (*TYPEOF_InitP) (int *a);
then that means TYPEOF_InitP is a function pointer, that can point to functions that take an int* parameter and return a bool .
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
-- Buffy
|
|
|
|
|
Hi Mike,
Thank you. But i still have some doubts to clarify:
BOOL BOAPI ShowMessage (int, int) is a function.
So when u need to call the function, u would do a normal
ShowMessage (1,2) rite ?
But when you call the function am i rite to say that a BOAPI macro would run first follow by the ShowMessage function ? If not, when would the BOAPI macro runs or how is it been used?
Sorry for my poor command of the c-language. Please advise. Thank you.
bk
(btw u are rite abt the # typo and the missing * could also be a typo from the original source)
|
|
|
|
|
Yes, it's a normal function, so ShowMessage( 1, 2) would "work".
In this instance, I think it's more likely that BOAPI is a simple text substitution, to something like __stdcall, as Mike has already said. This makes the code look like this
BOOL __stdcall ShowMessage(int, int)
which just says how the stack is used in terms of pushing params and cleaning up.
There is no additional code to be executed.
Steve S
|
|
|
|
|
Hi Steve and Mike
Thanks a lot !! I think i roughly get the idea already !
bk
|
|
|
|
|
is there a toolbar expert?
the quest:
disable a button.
the code:
m_wndToolBar.GetToolBarCtrl().SendMessage(TB_ENABLEBUTTON,(WPARAM)ID_...,(LPARAM)MAKELONG(FALSE,0));
or
m_wndToolBar.GetToolBarCtrl().EnableButton(ID_...,FALSE);
the problem:
the button is gray for a fraction of a second and them changes back to enable
the info:
i have a event handler for this button and its working.
i can disable the menu item with the same ID.
i have all event handler in the C...App.
i am using the "m_bAutoMenuEnable = FALSE".
no, i am not enabeling the button elsewhere.
yes, i am out of ideas...
the question:
what's the problem?
the state of mind:
MSN:maxsnts@hotmail.com
|
|
|
|
|
simply disable menu item associated with the button, or change auto-disable menu feature in CWinApp class.
includeh10
|
|
|
|
|
thanks for your reply , but as i can disable the menu item and the toolbar button remains enable
|
|
|
|
|
if double click a cpp file, VC is loaded automatically and displays the file.
OK, now i need to load my app if user double clicks our file with special extension.
i know i need to do something with register, but what and how?
thx for any light.
includeh10
|
|
|
|
|
REG file:
REGEDIT
HKEY_CLASSES_ROOT\.vgb = VGrab.Document
HKEY_CLASSES_ROOT\VGrab.Document\shell\open\command = VGRAB.EXE %1
HKEY_CLASSES_ROOT\VGrab.Document\shell\open\ddeexec = [open("%1")]
HKEY_CLASSES_ROOT\VGrab.Document\shell\open\ddeexec\application = VGRAB
HKEY_CLASSES_ROOT\VGrab.Document = VGrab file
Now replace all vgb and VGrab by your file.
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
no path of my app in register?
includeh10
|
|
|
|
|
Yes, sorry. Replace VGrab.exe by the full path name of your application. The DDE command remains "VGRAB".
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
when a menu is popup,how i could get it's HWND?
love program
|
|
|
|
|
use EnumWindows to get the menu handle.
menu is a window also, and must be active one in enums.
then get its parent, which is window u need.
includeh10
|
|
|
|
|
Hello,
how can one see at compilation time if the compiler compiles the application for 32-bit or 64-bit processors?
sizeof(int) doesn't work for all compilers.
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
c++ is 32 based (win95 and above), nothing with processor.
result (exe) is always same.
it is impossible to find 64 bits from compiling.
includeh10
|
|
|
|
|
Hmm. But 64-bit is coming, that's for sure.
And Microsoft's C/C++ will compile 'int's as 32-bit, and 'long's as 32-bit, '__int64' will be 64-bit.
But GNU's GCC will compile 'int's as 32-bit, and 'long's as 64-bit.
Now, when I want to define a 64-bit type, how do I decide which type is the correct one?
Thanks for your reply
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
cpp is OS related, if u compile a app under windows, don't hope to use it under unix, so nothing to warry about.
includeh10
|
|
|
|
|
includeh10 wrote:
cpp is OS related
I am currently programming a console-based tool for Windows and Linux. It compiles perfectly on both operating systems.
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
it doesn't mean "OS independent".
and if it is at commercial level, i am surprised.
otherwise what is usage of 32 and 64?
includeh10
|
|
|
|
|
Why are you surprised?
I have floppy disks full of portable code that work as command line applications for Windows, MS-DOS or a number of UN*X variants and linux.
Steve S
|
|
|
|
|
includeh10 wrote:
cpp is OS related, if u compile a app under windows, don't hope to use it under unix
Actually, MFC is OS related. CPP should be portable.
|
|
|
|
|
cpp is OS related
I want you to tell me what you are talking about.
Thank You
Bo Hunter
|
|
|
|
|
You can do something like this to support both MSVC and GCC:
#ifdef __GNUC__<br />
typedef long long _int64_t;<br />
#else<br />
typedef __int64 _int64_t;<br />
#endif
The long long type in GCC is at least 64 bits wide on both 32-bit and 64-bit platforms.
- Mike
|
|
|
|
|
sizeof(int) works for all standard C and C++ compilers. By using sizeof and #include <limits.h> you should be able to make your code work correctly independently of the word size of the CPU.
|
|
|
|
|