|
Opwar wrote:
How do you find a programs memory allocation?
See if this article helps. If not, I'm failing to understand your question.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I have created a single document application with MFC wizard. I want to capture file name being opened when user selects a file and opens it through the file open dialog box. How can I do this?
Thanks
|
|
|
|
|
CDocument::GetPathName() after document is opened
You can override CDocument::OnOpenDocument() to do the open--I've done this many, many times. (I suggest overriding this, calling the base class, then stepping through the code to understand what the base class is doing [with dirty flags and all that.])
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
|
Hello. I have tried to build my project which references msxml4.dll but when I try to build it I get the following error:
Cannot open type library file: 'msxml4.dll'
I can manage to find this on the Internet I think but should I just put it somewhere in my path or is there a proper way of installing it along with maybe an SDK? I have tried installing the Internet SDK but it does not install the file I want. I have tried searchig for it on my hard disk after installing the SDK but it is not there.
Thank you for any help.
|
|
|
|
|
Where/how are you referencing msxml4.dll?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Thank you for your reply.
It is in my stdafx.h file but I have been looking for information and I have seen that it is provided as part of the operating system I think. I think my problem is that I am on Windows 2K so the version is not the one I am making a reference to. I have changed it now to msxml3.dll and it now builds. I wonder how easy it is now to upgrade to msxml4.dll. Is this just installing MS XML Parser 4.0?
|
|
|
|
|
Hi,
I would like to know if there is any function (while reusing the webBrowser control) that give me the ability to add headers in every request that makes my application using the webBrowser control.
I would appreciate any help..
Thanks in advance!
-Manos Moschous
|
|
|
|
|
why nobody answered in my question....???
please any help..??
Thanx
|
|
|
|
|
Can someone show me an example of how to use a critical section object, EnterCriticalSection, etc. Just a simple example is fine.
Jerry
|
|
|
|
|
read the SDK
Don't try it, just do it!
|
|
|
|
|
CRITICAL_SECTION m_criticalsection;
InitializeCriticalSection(&m_criticalsection);
EnterCriticalSection(&m_criticalsection);
..
..
LeaveCriticalSection(&m_crticalsection);
hope it makes sense
i can't even remember what my point is now, but anyway, i'm correct
Barring unforeseen acts of God and Adminstrators, my server will be up tomorrow. I'm more worried about the Adminstrators.
|
|
|
|
|
class CriticalSection
{
private :
CRITICAL_SECTION cs_ ;
public :
CriticalSection ()
{
::InitializeCriticalSection ( &cs_ ) ;
}
~CriticalSection ()
{
::UninitializeCriticalSection ( &cs_ ) ;
}
operator CRITICAL_SECTION* ()
{
return &cs_ ;
}
} ;
class CriticalSectionGuard
{
private :
CRITICAL_SECTION * pcs_ ;
public :
CriticalSectionGuard ( CRITICAL_SECTION * pcs ) : pcs_ ( pcs )
{
::EnterCriticalSection ( pcs_ ) ;
}
~CriticalSectionGuard ()
{
::LeaveCriticalSection ( pcs_ ) ;
}
} ;
class SharingSomeResource
{
private :
CriticalSection cs_ ;
...
public :
SomeMethodRequiringSynchronisation ()
{
CriticalSectionGuard csg ( cs_ ) ;
}
...
} ;
Above not compiled so probably rife with typos. Also not considered copy construction and operator=, as one ought. But should give the general idea.
Paul
|
|
|
|
|
Hi,
I have a child window that can only be sized by integral multiples of a given size.
I would like to have the parent window leave exactly enough room for the child window but cannot find a successfull way of doing it.
I have tried handling WM_WINDOWPOSCHANGING on the parent, resizing the child, and then getting the updated child dimensions, but that doesn't work as expected.
Any ideas?
Cheers.
--
Maxime Labelle
maxime.labelle@freesurf.fr
|
|
|
|
|
Try handling the WM_SIZING message of the parent. The LPARAM is a pointer to a RECT structure that you fill to represent the size of the window.
Inside the handler, once you determine the proper client size, try using the AdjustWindowRect API to set the RECT structure. I've never used the API myself so I'm not sure of the intricacies, I just came across it recently in MSDN.
From MSDN: "The AdjustWindowRect function calculates the required size of the window rectangle, based on the desired client-rectangle size."
It takes the window style and a menu-present flag as input. You may have to do some additional calculations if your window has toolbars.
Hope this helps. Sorry I'm not more familiar with the API, as I said, I just came across it last week, but it seems like a useful one in your case.
|
|
|
|
|
Hi,
Thanks for the ::AdjustWindowRect() API that I was not aware of. It makes things a little less clunky to actually calculate the required client area.
However, the problem doesn't lie in the calculation of the required client area. The problem is to actually update the size of the parent window by constraints on the size of the child window. Handling the WM_SIZING message as you suggest does not seem to work for me...
--
Maxime Labelle
maxime.labelle@freesurf.fr
|
|
|
|
|
Maxime Labelle wrote:
Handling the WM_SIZING message as you suggest does not seem to work for me...
What behavior are you seeing?
- Nothing happening
- Resizing to an unexpected size
- Moving to an unexpected location
- something else?
|
|
|
|
|
Is ResizeParentToFit() what you are after?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
You might also investigate: WM_WINDOWPOSCHANGING, CWnd::OnWindowPosChanging
|
|
|
|
|
I have a home network with two PCs. One PC has a modem connection to the Internet. The other computer connects using Internet Connection Sharing (ICS). Is there anyway that the gateway computer can determine whether the client PC has a connection to the internet.
I can determine whether the gateway computer has a connection to the internet using InternetGetConnectedState, but the flags returned are the same wther it is connected on its own or in conjunction with the other PC.
|
|
|
|
|
you can't.
Don't try it, just do it!
|
|
|
|
|
Their is an API just for ICS, however I was not able to get it working properly.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/intconnsharingfirewall.asp
ms-help://MS.VSCC/MS.MSDNVS/ics/ics_port_2fmt.htm
Jory
|
|
|
|
|
I am trying to use CRITICAL_SECTION for a resource that is shared in my application. I am not sure how to specify the shared resource. If I have a simple value Y...how would I specify it to be shared and initialize it using InitializeCriticalSection(&CriticalSection);
Thanks,
Jerry
|
|
|
|
|
misunderstood.....
the critical section does not protect a variable! you have to use it to do it by entering the cs every time you access the variable and leave it then. only one part of the app can enter the cs, so other threads have to wait.
Don't try it, just do it!
|
|
|
|
|
Hello,
Can anyone help me to understand the following error I get while running my program:
" This instruction at "0x10213035" referenced memory at "0x00000065". The memory could not be read.
Click on OK to terminate the program"
and
" This instruction at "0x102125fe" referenced memory at "0x00000092". The memory could not be written.
Click on OK to terminate the program".
lvidot
|
|
|
|