|
Just made a test ...
works with Visual Studio 6 on another machine. Does not work on my machine with Visual Studio 2003 ! Same procedure, new MFC app with the wizards, insert a new tab control in the dialog, add a simple button, implement the event handler of the button to do: InsertItem; DeleteAllItems; InsertItem;
Glups. Does anybody have the same problem or does this just come from the piece of s**t behind my keyboard ?
|
|
|
|
|
How to stop other Process use ReadProcessMemory to Inject into my Process?don't use APIHOOK?
|
|
|
|
|
The only way is hooking the ReadProcessMemory system-widely and checking if a process wants to read from your process.
You could also patch the ReadProcessMemory function (patch on assembler level to immediately return), but I wouldn't do it. Patching can lead to serious problems. This would require that you need to overwrite the Windows kernels of the users, and I don't think that most users like it if their kernel is patched...
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)
|
|
|
|
|
I've not tried this so it's simply a guess. ReadProcessMemory() requires that the memory being read be accessible for read access. Otherwise, the function fails. That implies that your process could somehow "lock" its heap memory.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Hello all,
I am using context menu (with TrackPopupMenu()).
When I use it with an usual window, all is OK.
If I use it in a "real" fullscreen window, it appears only now and then.
I used SetForeGround(motherWindow) before,
and postmessage (WM_NULL, ...) after
and I still get a variable behavior.
here is the code:
SetForegroundWindow(myHwnd);
int result = TrackPopupMenuEx(myMenu,TPM_RETURNCMD|TPM_TOPALIGN|TPM_LEFTALIGN|TPM_RIGHTBUTTON , pt.x, pt.y, myHwnd, NULL);
PostMessage(myHwnd, WM_NULL, 0, 0);
I also use fileDialog the same way (with setforeground and postmessage), which does not appear when called . I managed to get focused on it, but it takes my window out of fullscreen mode.
fullscreen window is a DX or openGL render space.
Hope someone will be able to help me ?
Thanks in advance
|
|
|
|
|
I only know that bool is a boolean type that only
return true(1) or false(0). Then what about BOOL?
I know they are different, but I don't know how
they are different.
|
|
|
|
|
A BOOL i simply a typedef of an 4 byte int .
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
bool -> true | false
BOOL -> TRUE | FALSE
BOOL is in fact a 4 byte long integer variable. But you should only set it to TRUE or FALSE.
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)
|
|
|
|
|
Any more example? Why do we need two boolean logic data tpyes?
Does BOOL appear in C language?
|
|
|
|
|
Alex Ngai wrote:
Any more example? Why do we need two boolean logic data tpyes?
BOOL is a good choice for 32-bit applications
bool, naah, it works if you want to use it... but no...
Alex Ngai wrote:
Does BOOL appear in C language?
Just include windows.h and tada!
You can also define it yourself:
typedef int BOOL;
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
BOOL isn't standard C language no. It's defined in the Windows headers. It's used by Windows API functions to pass flags.
_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)
|
|
|
|
|
|
The header file that I have says its a plain int;
Thank You
Bo Hunter
|
|
|
|
|
Right.
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)
|
|
|
|
|
There are no archive insertion/extraction operators defined in CArchive for "bool" so Serialization will not work.
Use bool as much as possible if u r not dealing with windows api.
while porting OS from 16 bit to 32 bit, sizeof "BOOL"( which is typedef of integer) also increased.If in future, while porting OS to 128 bit, size of BOOL(same as sizeof int) will b 16 bytes. R u going to tolerate this stupidity if u r not dealing with WinAPI?
If u r using more than one boolean variable in ur code, I 'll suggest u to use one bool with bitfields. This way u will accommodate upto 8 bool variables. I believe that MS Access stores boolean datatypes this way.
The chosen One
|
|
|
|
|
Well, I wonder if VS.Net support pure C language? Since there is no
C file that you can create when you open a new project in VS.Net.
|
|
|
|
|
Yes it does. Just rename the file to .c
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
By saying Pure C language, I mean C99, the latest ANSI/ISO standard
for C. Have you written a project that using only C, and does not
contain any code that is C++ stardand? And how is the result?
Is the result what you expected? Any strange error during compiling
and running?
|
|
|
|
|
I've written an app i pure C yes. I discovered that the declarations of varibles couldn't be done anywhere in the code and has to be declared in the beginning of the scope. I've read in my "C: The Complete Reference" that C99 supports declarations anywhere in the code.
http://duden.mine.nu/wr/Client/
That's the project I've made.
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
Well, I have just read your project. I have a question reguarding to
that. In C++, it support OOP, so it is logically right to split files.
Header being class definition, and cpp being implementation and
driver.
However, C does not do OOP, so how do they split files? What do they
put in header file? Is it common to put everyting in a .c file? Well,
you did that for your WZ project.
P.S. I'm learning C++, but completely new to pure C.
Thanks
|
|
|
|
|
Yeah I did put everything in one .c file because it was just a test project and it had only a few hundreds lines of code. But yes, you do the same as in C++, put all your function declarations in one header file and globals and #defines and whatever you want and then implement it in your source file (.c or cpp).
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
At the moment, very few compilers support C99 - it's too new.
I believe that Microsoft is not intending to ever support C99 - they will only support C89 (as revised in 1995).
C99 adds a few features that frankly are only of use in building larger scale programs, and for that, there's C++.
IIRC, VC.NET (the environment) adds the /TP switch to your project settings, meaning that all files are compiled as C++ even if they have a .c extension. Turn this switch off if you want .c files compiled as C.
|
|
|
|
|
No, Visual C++ .NET 2002 does NOT support ISO/IEIC 9899:1999 C Language.
In MSDN of Visual Studio .NET 2002:
"Because the timing of the release of C99, this version of Visual C++ is not conformant with that standard."
You may try this sample code, which is of C99 code:
#include <stdio.h>
void main()
{
int v[10] = {v[0] = 3, v[5] = 5 };
int i;
for(i = 0; i < 10; i++)
{
printf("[%d +1] = %d \n", i, v[i]);
}
}
The result is wrong.
BuggyMax
|
|
|
|
|
Hi...
I'm not sure why the error - 'OnSelchangeLUCOMPTop' : local function definitions are illegal, comes out...how shd i ammend this...thanks.
void CComp::OnSelchangeLUCOMPTop()
{
UpdateData(TRUE);
Tselection1 = "Selection Changed";
CMain::uc_top = m_uc_ts.GetCurSel();
m_uc_epo.EnableWindow(TRUE);
m_uc_epp.EnableWindow(TRUE);
}
|
|
|
|
|
fynox wrote:
CMain::uc_top
That's illegal. I assume you somewhere have declared a pointer to the CMain class in your CComp class: CMain *pParent . For example declare in your header file: CMain *pParent and initialize it from your main class: CComp dlg; dlg.pParent = this; .
Then use this: pParent->uc_top = m_uc_ts.GetCurSel(); .
Hope that helps
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)
|
|
|
|