|
good morning, all
Is there a way to locate certain memory address in app during the debug? say, I wanna find out 0x00FE55A0 is using by who?
the reason is memory leak, I kinda know which class is leaking, but I couldn't see where exactly it is, there is FE5420 is using by m_pValid, but it got deleted when it close down. so the FE55A0 should be somwhere near by, but I never really find it.
thanks for your time!
|
|
|
|
|
Hello,
You can use the Visual Leak Detector[^] to trace down those pesky bugs and then eliminate them!
Good hunt!
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
You can set a breakpoint on a memory address such that the application will break when the data at the specified address changes. Then it will show you what line of code just caused that change.
You can do this by using the breakpoints dialog and then go to the data tab and enter your address in the edit block.
|
|
|
|
|
Thanks for your reply.
I have problem setting them up, it has message box says "Cannot set the breakpoint when "0x00FE55A0" (length: 1)changed". not sure why, It should be the valid adreee, because it's the leak report says 1305 bytes leak from. and I could see the 0x00FE54D0 in somewhere....thank you!
|
|
|
|
|
I would go with the other suggestion then.
I am not sure why that error would come up. I tried it myself on my platform and I was able to set the break point.
Since you have an idea where/when the code is changing, you could try to watch it in the memory window. Just press the memory button on the debug toolbar (when you are in debug) and then type the address of the memory location that you want to watch. You can then step through the code until your address changes.
|
|
|
|
|
|
I need to check the status of a socket on my client application before sending data....I was wondering if there was a way to tell whether the socket was connected to the server at any given point. I know there is WSAGetLastError, but doesn't that have to wait for the framework to alert that there is an error first?
Thanks for your help.
|
|
|
|
|
You can use select() to check if the socket is writable. If it is you know that the connection is established and you can send data.
|
|
|
|
|
can this be done with CAsyncSocket?
What is the return value...I don't see it in the MSDN library
|
|
|
|
|
If you are using CAsyncSocket it has that virtual method OnSend() which is called when the socket is connected and able to send data. You can override it in your derived class and set a member variable which you can later test before calling Send(). You can still use select() because CAsyncSocket has a member m_hSocket which stores the socket's descriptor.
|
|
|
|
|
NYTSX wrote: can this be done with CAsyncSocket?
Try CAsyncSocket::GetPeerName(...) if you are connected it will return with peername and port otherwise call GetLastError for WSAENOTCONN macro
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi,
i have been playing around with NTFS reparse points and junctions. I finally found the tutorial by Mike Nordell and managed to make my application work. I can now build a junction to a path like "C:\mydirectory".
My question is concerned with building junctions over the network. If i specify "\\ServerXYZ\mydirectory" as the target path, the DeviceIOControl() routine returns unsuccessfully and GetLastError() returns 4392, which means that the parameter structure must have an error. Something is wrong with the way i'm specifying the path!
Is it possible to use the DeviceIOControl() routine setting a junction point that is located on another computer?
Thanks in advance...
|
|
|
|
|
I believe junctions are only possible on the local computer and on only on ntfs.
John
|
|
|
|
|
Hi,
on my wizards first page the user has to make a choice, and according to this choice the page displayed when the "next"-button is pushed should be chosen (because there are different possibilities). How can I arrange that in my program???
I used CPropertySheet, CpropertyPage and SetWizardMode() in my program.
Thanks in advance!
|
|
|
|
|
have a look at CPropertyPage::OnWizardNext ; you can return the ID of the next property page to be displayed.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
When I execute my program, I encounter a very strange error,
this error occurs only in "Release log" version and
"Debug" version, But in "Release" version, everything is ok.
The difference between "Release log" and "Release" version is only "print log", but when I comment out "print log" codes,
The "Release log" version still has error.
Who can tell me the reason,Thanks a lot!
|
|
|
|
|
chenxiujie wrote: very strange error
What error ?
chenxiujie wrote: is only "print log",
Are you sure about that ? Is really _every_ setting the same in both versions ?
~RaGE();
|
|
|
|
|
It sounds like you still have some code differences to track down.
Look at you "print log" code.
|
|
|
|
|
How can I get from registry an application associated with given file extension?
krasy
|
|
|
|
|
search the HKEY_CLASSES_ROOT\.xxx key where .xxx is the extension you are looking for.
this key contains a string, let's say abcdefgh.
now, search the HKEY_CLASSES_ROOT\abcdefgh\shell\open\command key, where abcdefgh is the string found on the previous key.
this key contains a string, such as "C:\Program Files\MyProgFolder\myProg.exe" "%1".
here it is !
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
|
Use AssocQueryString() .
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
As simple as possible, thanks...
|
|
|
|
|
Anyone know how to do this?
That's the icon that appears in the main part of the taskbar, not the system tray/notification area usually in the bottom right-hand corner of the desktop.
Presumably this is the same icon that appears in the top-left corner of the application's main window, the IDR_MAINFRAME icon in an MFC app. Thing is, I need to be able to change it at run-time, not compile-time.
The two most common elements in the universe are Hydrogen and stupidity. - Harlan Ellison
Awasu 2.1.3 [^]: A free RSS reader with support for Code Project.
|
|
|
|
|
did you have a look at the Code generated by the Wizard into OnInitDialog ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|