|
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.
|
|
|
|
|
|
Hello,
I am trying to define safe integer types. For example an UWORD8 should always be an 8-bit unsigned integer variable.
To define UWORD8, I tried this:
#if defined(__int8)
typedef unsigned __int8 UWORD8;
#elif (sizeof(char) == 1)
typedef unsigned char UWORD8;
#else
#error Cannot define an 8-bit unsigned integer type.
#endif
...
#if defined(__int64)
typedef unsigned __int64 UWORD64;
#elif (sizeof(int) == 8)
typedef unsigned int UWORD64;
#elif (sizeof(long) == 8)
typedef unsigned long UWORD64;
#elif (sizeof(long int) == 8)
typedef unsigned long int UWORD64;
#elif (sizeof(long long) == 8)
typedef unsigned long long UWORD64;
#else
#error Cannot define an 64-bit unsigned integer type.
#endif
But it doesn't compile. The compiler says:
fatal error C1017: invalid expression for integer constant ,
always in the lines where I check the sizeof()s.
What am I doing wrong? How would you define safe integer variables? Any better way?
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)
|
|
|
|
|
say, just one line in a cpp file:
int i=sizeof(int);
it causes a compile error because sizeof() is a runtime staff (similar call a function).
in ur file, u have multiple lines of the example.
includeh10
|
|
|
|
|
You are mixing up preprocess or commands and C++ keywords (which are compiled). sizeof and __int64 are not preprocessor commands so you can't have them in #if conditions.
The way to do what you want is test compiler-specific preprocessor constants and have a block of typedef s for each compiler. Eg:
#if defined(MSC_VER) && MSC_VER >= 1200 // MSVC 6+
typedef unsigned char UWORD8;
typedef unsigned __int16 UWORD16;
typedef unsigned __int32 UWORD32;
typedef unsigned __int64 UWORD64;
#elif defined (GNU_CPP) // or whatever GNU's symbol is
#endif
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber
There is a saying in statistics that a million monkeys pounding on typewriters would eventually create a work of Shakespeare. Thanks to the Internet, we now know that this is not true.
|
|
|
|
|
If your compiler has the inttypes.h header available (such as GCC), you're in luck. This header defines types such as int64_t and uint64_t . So, you might want to create something like this:
#ifdef __GNU_C__<br />
#include <inttypes.h><br />
#define HAS_INTTYPES<br />
#endif<br />
<br />
<br />
<br />
#ifndef HAS_INTTYPES<br />
#ifdef MSC_VER<br />
typedef __int64 int64_t;<br />
#elif __BORLANDC__<br />
typedef __int64 int64_t;<br />
#endif<br />
#endif
This was just off the top of my head. Hope this helps
- Mike
|
|
|
|
|
Hello everybody, I hope you`r all fine I have finished a project excecpt 1 thing i haven`t found any resource explain it Printing a Bell which contain : no,product`s name ,price ,total etc... how can i print it as you know the bell contains subjects i just want to print just what i sell[product info.] so any help will help thank you and big fat bye .
|
|
|
|