|
Okay. Very good explanation. I was mistaken that I thought I saw an object being set to NULL. It had to have been a pointer like you said. Many thanks for clarifying this...
Appreciate your help,
ns
|
|
|
|
|
You may have seen a smart pointer which made you think this. A smart pointer is a class which wraps and controls a pointer, and often setting a smart pointer to NULL internally deletes the pointer and therefore does what you were after.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Precisely. This was happening with things like _RecordsetPtr which didnt have the * associated with pointers so I mistakenly thought they were actual objects, which they actually are, except they are pointer-objects.....something like that. Anyways that was exactly where I was swimming in confusion...you hit it right on the head!
Appreciate your help,
ns
|
|
|
|
|
I want to get the keyboard message from my application My application include some dialogs and forms
Thanks!
|
|
|
|
|
What sort of application is it, does it use MFC ? You ultimately want to catch WM_KEYDOWN, WM_KEYUP or WM_CHAR. You don't need MFC for this, but the class wizard will do it for you for free if you're using MFC.
You catch the message per window, not for the whole app.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Thanks!
Yes,My application use MFC.
I am coding for a class,I want to get the keyboard message if every application include this class.
Maybe I will try Keyboard Input API?
|
|
|
|
|
No, it does not work that way. Each MFC class that represents a window ( like CMainFrame, CDialog, CView ) has a message map, and you need to catch the message in those. Ctrl-W will bring up the class wizard, you can choose a class and a message from there and it will plumb it all in for you.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
I used the hook dll in my application,but it get all ketboard messages(include other application's messages).Can I only get the messages from my application use the hook dll?
Thx!
|
|
|
|
|
Why would you want to do that when I've provided a far easier solution ?
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Our application has so much dialogs and forms ,it's difficult to monitor the message in every dialog,and my boss need a common class or dll to monitor our application and other applications.
|
|
|
|
|
I'm not sure how the messages bubble, but you should be able to get all dialogs to send the message to their parent, and then handle them all in the one spot. It's a lot nicer than a global hook, that's just a hack.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Hi,
I am using MSVC 6.0. I activated the /3GB switch in Windows XP Professional and also used a linker flag /LARGEADDRESSAWARE in the application in order to enable the application to address more than 2GB of memory.
The GlobalMemoryStatus reported dwTotalVirtual = 3221094400 and dwAvailVirtual = 3203072000. It seems that the above configuration works.
However, when I do a VirtualAlloc(NULL, 2*1024*1024*1024, MEM_COMMIT, PAGE_READWRITE) to allocate 2GB of memory, I always get a "ERROR_NOT_ENOUGH_MEMORY"?
How can I allocate those available virtual memory?
Thank you.
|
|
|
|
|
I am not sure you are making the right use of this "feature".
There's a difference between be able to allocate a TOTAL of more than 2GB, and be able to allocate a single block of more than 2GB.
The use of the VirtualAlloc API is subordonated to the use of the /PAE flag, not /3GB. There is no special API to use along with /3GB, since it just orders the system to leave under 1GB instead of 2.
The book "windows 2000 programming" explains how to use it. I guess that if you are doing this in a real world case, then you certainly can have more direct MS support for that topic.
Besides that, have you more than 2GB free disk space available (configured disk swapping) ?
How low can you go ? (MS retrofuck)
|
|
|
|
|
Thank you for replying.
I also suspect that VirtualAlloc API might not be able to allocate a single block of more than 2GB. Can we play around with /PAE flag to make it allocate more memory?
Do you mean that the book "Windows 2000 Programming" gives some method on how we can allocate a block of more than 2GB? Who is the author of the book? I need the memory for a Finite Element Analysis software.
I do have more than 2GB free disk space available.
|
|
|
|
|
tsk wrote:
I also suspect that VirtualAlloc API might not be able to allocate a single block of more than 2GB
That's what I have told you. You can allocate the amount of memory you want per process (with a limit of 3GB with /3GB and up to 64GB with /PAE) by chunks, not by a single call.
How this works is explained in the book mentioned. It's from MSPRESS[^].
Never forget Windows is a 32-bit OS, thus cannot address pointers more than 4GB large. And because the kernel takes 2GB of these addresses (without /3GB), that's why you have at most 2GB per process. A lot of problems here because the most significant bit of pointers is 1 and becomes negative (comparisons may fail).
To break the 4GB barrier, Windows, through VirtualAlloc and the /PAE allows you to use pages of memory (with is an old technique). Of course, this constraints the whole design of your program.
tsk wrote:
how we can allocate a block of more than 2GB?
Although that's unlikely, you'll need a horsepower OS, such like MS datacenter (with 4GB or 16GB of physical memory on-board) : again, if you are in a real world case, your company should by this time already be in contact with MS reps.
How low can you go ? (enculage MS)
|
|
|
|
|
Thanks Stephane Rodriguez. I might need to use other alternative such as divide and conquer to solve the equations.
Contact MS reps for what?
|
|
|
|
|
Hi,
I'm running Ms Word Automated... meanwhile I do a lengthy
operation I show an "Please Wait" window..., but the user can click on word and mess up the document ( ).
What I'm thinking... what happens if I set the parent of my "Please Wait" window as the window handle of the WinWord instance ?, Is that possible ? Could block the message pump of Ms Word ?
Thanks in advance, greetings
Braulio
|
|
|
|
|
I'd try to disable main MS Word window using Word's automation model. I don't have the reference at hand, but I believe there should be some property or method for that.
Tomasz Sowinski -- http://www.shooltz.com
*** Purgamentum init, exit purgamentum ***
|
|
|
|
|
There are two alternatives: IIRC, Word automation has an option for hiding the interface.
The other works only in WinNT/2k/XP but serves to any program, is using CreateDesktop to create a second, hidden desktop and opening the program there.
Q261186 - Computer Randomly Plays Classical Music
|
|
|
|
|
Application.Visible = True/False
How low can you go ? (MS retrofuck)
|
|
|
|
|
Thanks but...
Mmmm... I would rather preffer something like "Disable" = TRUE...
Thanks, greetings
Braulio
|
|
|
|
|
IOCompletion ports aren't supported under win9x. winsock supports iocompletion functinality. the documentaition doesn't mention anything of incompatibility. Does anyone know if it's possible to use it under win9x?
|
|
|
|
|
|
[Click for User Profile] Li Zhaoming 8:10 20 Oct '02
Dear Buddies,
I always wondering that:
1) If I want to hide the "help" button in "Customize Toolbar" dialogbox, I should response the TBN_INITCUSTOMIZE notification and return TBNRF_HIDEHELP.
However, TBNRF_HIDEHELP is never defined when compiled.
2) If I want to display a "Chevron" in a Rebar control, I should create the Rebar control with RBBS_USECHEVRON style.
Howerve, RBBS_USECHEVRON is never defined either.
Anything wrong? Is that because the version of SDK? Has the newest version SDK defined these two constans?
Thanks!
|
|
|
|
|
I wrote ADO classes in MFC DLL and exported an function in whitch these classes are used. then call this function in my Exe files and got the following.
help me plz, quickly!!
c:\dark blue\class import\backup 02\backup\hydrosrv\formattable.h(16) : error C2504: 'CRecordset' : base class undefined
Extreme programming. Do the No.1
|
|
|
|