|
vcforums wrote: I would like to know what is Network Shutdowner.
Given the capitalization, I suspect it is the name of an application. Is this something that you have seen, used, or just heard about?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Hi
How does the one dynamicly allocate some CDialog and some controles wich are also allocated, and where do I set position on say like CButton?
TNX
|
|
|
|
|
|
Hi,
I send SB_THUMBTRACK with WM_VSCROLL message to ListCtrl, but ListCtrl does not respond to it. But same to a TreeCtrl does not make any problem.
Do anybody know why?
- NS -
|
|
|
|
|
Sending SB_THUMBTRACK, SB_THUMBPOSITION, SB_ENDSCROLL messages will not work for CListCtrl in Win2K and XP. These messages will works only in 95/98 and ME. I believe the problem is with implementation of some Win32 API functions for different versions of Windows.
You can probably try this alternative...
Call CListCtrl::Scroll with the X and Y coordinates.
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Oh I see...
Could you tell me the reason?
- NS -
|
|
|
|
|
NS17 wrote: I send SB_THUMBTRACK with WM_VSCROLL message to ListCtrl, but ListCtrl does not respond to it.
What does the call to SendMessage() look like?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
List controls do not respond to WM_HSCROLL or WM_VSCROLL messages. They use their own LVM_SCROLL message.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
I use a custom scrollbar derived from CWnd. This scrollbar can send WM_VSCROLL message to the list control directly, because the list control window handle is with the scrollbar. All other messages except SB_THUMBTRACK can be processed by the list control. But this same for tree control is working fine.
Then what could be the best solution for this problem?
Thank you.
- NS -
|
|
|
|
|
hai,
I m having a problem with msxml2.lib in debug mode compilation. Its just puzzling me. I installed xml sdk3.0 version in my system. when i tried to compile a simple code in vc++ 6.0( Just com object creation of xmldomdocument )
i got this error "msxml2.lib(msxml2_i.obj) : fatal error LNK1103: debugging information corrupt; recompile module
Error executing link.exe"
I had included msxml2.h , msxml2.lib in library options also. I am having visual studio 6.0.
Can anyone give suggestions for this, i need to call those apis in debug mode only.
Advanced thanks for giving any kind of suggestion
manu
|
|
|
|
|
I'm pretty sure the last version of the Platform SDK compatible with VC6 was Feb 2003.
The two most common elements in the universe are Hydrogen and stupidity. - Harlan Ellison
Awasu 2.2 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|
Hi!
I have a problem with dll programming. I am programming dll's for the micorosft flightsimulator.
Anyway in DEBUG mode i have the strange problem that i get a assertion in ntdll.dll telling me that a incorrect adress is passed to RtlFreeHeap when the sim wants to unload my module...so the problem is only on closing my dll. The error occours in the fs9.exe and not in my dll but i pass many (correct) pointers to the exe of course and its working with them.
I had found that the invalid adress that is passed to the RtlFreeHeap function is a pointer to a constant character string "xxxxxx" located in the .rdata section of my dll. When i remove the constant for my code the problem is still present but points to antoher adress also somewhere in the .rdata area of my dll.
Has anybody a idea what could be wrong with my heap setup and/or dll compilation that causes a problem with my .rdata memory area. Is there maybe something that i do not know about constants in dll's or resources in dlls.
My dll needs much memory, but still in the minimal configuration the error is present.
Again the problem is only on closing where the fs9.exe wants to free my memory? ans is not present during normal operation. Additional i could find that error when compiling in release mode.
Is there somewhere a tutorial about "do nots" in dll code programming...
hope somebody can help me
regards
Florian
|
|
|
|
|
Don't know much details about FS, as I never program anything for that, and I just hope this will not be complete OT
My rule for dll programming is: Do not release memory allocated in another module.
This means if you allocate something in your dll (eg the malloc/new is called inside your library) the corresponding free/delete should be called also in your code inside the same library.
Maybe you have some situation when you passed something you allocate to the fs9.exe and it tries to release it for whatever reason or vice versa - you're releasing something allocated in fs9.exe or another module.
|
|
|
|
|
Hi!
Everthing solved and cleared, i have changed a char* of the exe instead of copying my string to this pointer...so when the exe tries to clean up its char* it pointed to a constant memory location of my dll and so causes a conflict...
thank you anyway
florian
|
|
|
|
|
Hi
I want to add a range to rand() function
How can i do it
is it possible to produce a negative number out of it
uzma
the more u give the most u receive
|
|
|
|
|
From MSDN:
The rand function returns a pseudorandom integer in the range 0 to RAND_MAX . Use the srand function to seed the pseudorandom-number generator before calling rand .
#include "stdlib.h"
#include "stdio.h"
#include "time.h"
int main( void )
{
int i;
srand( (unsigned)time( NULL ) );
for( i = 0; i < 10;i++ )
printf( " %6d\n", rand() );
}
Owner drawn
Jesus Loves
|
|
|
|
|
To complete owner drawns response :
If your range is, say [x;y], then use the following formula:
random_nb = (((rand()*(y-x))/(RAND_MAX))+x;
should work with negative values as well.
~RaGE();
|
|
|
|
|
Hi,
I am using ReadFile() method passing OVERLAPPED structure for reading from a socket in Asynchronous mode. Also i am using IO Completion ports for I/O notification. Is it possible that the ReadFile() can fail due to timeouts?.ie. If the packet that i am reading takes a lot of time to arrive, in that case will the ReadFile() fail?.
If indeed ReadFile() fails due to timeouts, how can i get that error information?.
Thanks in advance,
Pradeep
|
|
|
|
|
Hi,
You can use GetOverlappedResult(...)to retrive status of an OVERLAPPED operation
Or try loking af GetQueuedCompletionStatus(...)
Thomas
|
|
|
|
|
Hi,
Thanks for your help.
Also can any one pls let me know where i can find the documentation on OVERLAPPED structure.
typedef struct _OVERLAPPED {
DWORD Internal; // [out] Error code
DWORD InternalHigh; // [out] Number of bytes transferred
DWORD Offset; // [in] Low 32-bit file offset
DWORD OffsetHigh; // [in] High 32-bit file offset
HANDLE hEvent; // [in] Event handle or data
} OVERLAPPED, *LPOVERLAPPED;
In Programming Server Side Applications for Win2k by Jeffrey Richter, there is explanation about the OVERLAPPED structure. But, it doesn't explain more about the variable "DWORD Internal; // [out] Error code" and especially what values it can take.
Pls let me know where i can find the information. I have already searched msdn but of no use.
Thanks in advance,
Pradeep
|
|
|
|
|
Names like dwInternal are deliberately not explained. If you find out what it does, and start relying on that behaviour, who will get the blame when that undocumented behaviour changed in (eg) Vista?
(a) I used variables marked Reserved for operating system use, so its my fault when the application fails in five years. I will of course provide that length of future support.
OR
(b) Its that evil Micro$oft. How dare they change the function of these variables, breaking my application!
Don't take this polemic too personally. But I read too many examples tampering with internal structures...
Old New Thing is a good blog to read about this.
Iain.
|
|
|
|
|
Hi,
I wonder if anyone here knows how to intercept the "activate window" items on the Windows menu of a standard MFC app? You know the ones, the list of MDI client windows with the hint "Activate this window"?
If anyone knows it would be most useful to me,
Thanks.
Jim
|
|
|
|
|
Looking through my string resources, I find "Activate this window" is String Resource with an ID of AFX_IDS_MDICHILD.
If you want to change it to another constant string, just change this string resource.
If you want it to be more dynamic, you will need to override void CFrameWnd::OnMenuSelect(UINT nItemID, UINT nFlags, HMENU hSysMenu ,
which looks a bit more complex...
If you are more specific about what you want to change to, I/we may be able to help more.
Iain.
|
|
|
|
|
The problem we are attacking is to do with the fact that our document format saves the positions of the child windows. Our application is a traffic engineering program and it uses a lot of different views, each in a child window. For this reason we recommend our users to use a dual-monitor system.
We want to deal with a posible situation where a user is running on a two monitor system and passes a file to a user with only one: some of the windows could disappear off screen. We cannot make them reposition when they get the focus as the user may wish to move the window off screen for a few moments while they are working and we don't want windows jumping about all over the place.
We just want the windows to reposition when the user activates the window... so this is why we want to intercept the 'Windows' menu.
Thanks for your reply, I'll take a look at using CFrameWnd::OnMenuSelect and see if I can make that work.
Thanks!
Jim
|
|
|
|
|
In that case, I'd look at the command value(s) that "window 1", "window 2", etc pass. These will go through the normal command routing mechanism.
I've just looked, and the first window command is
#define AFX_IDM_FIRST_MDICHILD 0xFF00 // window list starts here
You could use
ON_COMMAND_RANGE_EX (AFX_IDM_FIRST_MDICHILD, AFX_IDM_FIRST_MDICHILD + 8, MyWindowHandler)
...
BOOL CMyFrame::MyWindowHandler (UINT nCmd)
{
....
return FALSE;
}
I can't remember the exact details of the handler definition, or whether the return should be true or false, but you can do the legwork - I'm too lazy.
Probably simpler than getting a menuselect handler wrong!
Iain.
|
|
|
|