|
In the Microsoft SDK, you will find this tool, (Dependency Walker) which appears to be quite sophisticated, but, for which the Microsoft MSDN site provides very little useful information. I'm wondering if any of you programmers have any thoughts or suggestions about its utility. Do any of you use this tool?
Feng Yuan, author of, Windows Graphics Programming has this to say about the Dependency Walker:
"Dependency Walker (depends.exe) lists all the DLLs your module imports implicitly in a nice recursive way. It helps you to get a clear understanding of how many modules will be loaded into your program when it's running, how many functions are imported. Check this simple MFC program; you will be amazed how many functions are imported without your knowledge. You can use it to check if a program will run on the initial version of Windows 95, which does not have system DLLs like urlmon.dll or provide so many exported functions in ole32.dll."
Is there source code available for us inexperienced code nitwits to investigate? I'd like to know how they did it. ...not that I'd actually understand it, but, I'm sure it would make interesting reading.
|
|
|
|
|
To produce good quality installation programs this tool is
essential. You need to use it to determine what DLLs to
include with your installation package.
You can cross check them here:
<http://support.microsoft.com/default.aspx?scid=/servicedesks/fileversion/dllinfo.asp&fp=1>
to eliminate ones that are certain to be on your user's computers.
Obvious, legal caveat, don't distribute Dlls that you don't
have the right to distribute.
Oh, one other thing that occasionally comes along to bite you,
sometimes other people's code loads the dll's by hand (LoadLibrary)
which is obviously not detected by the walker. This is a major
PITA, but it happens, and you have to watch out for it.
|
|
|
|
|
|
Its also helpful in tracing errors. You can sometimes find what function the error occurred in by looking up the address in Depends.
Jason Henderson start page ; articles
henderson is coming
henderson is an opponent's worst nightmare
* googlism *
|
|
|
|
|
I really appreciate the response, thank you. The tip about the LoadLibrary function and the website address were especially useful. Thanks.
|
|
|
|
|
Okay, this sounds like a simple question but I don't know where to look for info on it.
I want my program to be able to open user documentation. When it's a doc or txt file, I can just use ShellExecute() but, for unknown file types, it's going to need a default program to use. How do I have a program shell to a specific other program? For example, how do I tell Notepad to open a specific file?
|
|
|
|
|
ShellExecute(NULL,NULL,"NOTEPAD",<complete path and name of the file>,NULL,SW_SHOWNORMAL);
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hello,
I would like to know if there is any manner in which I can prevent my application (or its process) from exposing its diagnostic information to tools like Spy++.
Any pointers in this regard would be most helpful!
Thanks!
|
|
|
|
|
Write for Mac.
Seriously, there is no way to hide from Windows the fact that you're sending messages unless you stop sending messages.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
I have an application where I want to hide the mouse pointer while the app is running and restore it when it exits. How would I do this?
|
|
|
|
|
Handle ( from memory ) WM_SETCURSOR, and set it to NULL.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Trying to track a linker problem, so I've created a new MFC app using the basic wizard in Visual Studio .NET to demonstrate the issue. Used all the default Wizard options. Have reduced the "InitInstance" function the the following :
BOOL CTestApp::InitInstance()
{
AFX_MODULE_THREAD_STATE temp;
return FALSE;
}
This complies and links in DEBUG configuration (obviously doesn't run, but that's not the point here).
In RELEASE configuration this compiles, but deos not link. Generates this :
Test error LNK2019: unresolved external symbol "public: __thiscall AFX_MODULE_THREAD_STATE::AFX_MODULE_THREAD_STATE(void)" (??0AFX_MODULE_THREAD_STATE@@QAE@XZ) referenced in function "public: virtual int __thiscall CTestApp::InitInstance(void)" (?InitInstance@CTestApp@@UAEHXZ)
Any help greatly appreciated - why is the linker failing to find this code in RELEASE builds only?
|
|
|
|
|
I am trying to create a very simple C++ POP3 client. I have the following code (minimilized for ease of reading) that will allow me to connect to a POP3 server, receive the Welcome, and send the user name. Trying to receive the response to the user name seems to "freeze" -- CPU usage stays low (<10%), but nothing seems to be happening. Any thoughts/suggestions/criticisms/praise?
<br />
CString sPOP3ServerIP = "valid.ip.address";<br />
CString m_sUsername = "ValidUser";<br />
CString m_sPassword = "ValidPassword";<br />
<br />
CSocket m_socket;<br />
m_socket.Close();<br />
if ((INVALID_SOCKET == m_socket.m_hSocket) || (NULL == m_socket.m_hSocket))<br />
{<br />
if (!m_socket.Create())<br />
{<br />
TRACE("Unable to create socket. Error code: %i\n", GetLastError());<br />
return;<br />
}<br />
}<br />
<br />
if (!m_socket.Connect(sPOP3ServerIP, 110))<br />
{<br />
TRACE("Unable to connect to %s. Error code: %i", sPOP3ServerIP, GetLastError());<br />
return;<br />
}<br />
<br />
TCHAR buff[4096];<br />
memset(buff, 0, 4096);<br />
int nRead;<br />
nRead = m_socket.Receive(buff, 4096); <br />
buff[nRead] = 0;
CString sTempMessage(buff); <br />
TRACE("Connected. Message received [%s]\n", sTempMessage);<br />
<br />
CString sMessageSend = "";<br />
int iLength = 0;<br />
if ("+OK" == sTempMessage.Left(3))<br />
{<br />
sMessageSend.Format("USER %s", m_sUsername);<br />
iLength = m_socket.Send(&sMessageSend, sMessageSend.GetLength());<br />
if (SOCKET_ERROR == iLength)<br />
{<br />
TRACE("Error %i on send USER NAME\n",GetLastError());<br />
return;<br />
}<br />
memset(buff, 0, 4096);<br />
<br />
nRead = m_socket.Receive(buff, 4096); <br />
<br />
buff[nRead] = 0;
CString sTempMessage(buff); <br />
TRACE("USER Sent. Message received [%s]\n", sTempMessage);<br />
<br />
<br />
sMessageSend.Format("PASS %s", m_sPassword);<br />
iLength = m_socket.Send(&sMessageSend, sMessageSend.GetLength());<br />
if (SOCKET_ERROR == iLength)<br />
{<br />
TRACE("Error %i on send PASS Word\n",GetLastError());<br />
return;<br />
}<br />
memset(buff,0,4096);<br />
nRead = m_socket.Receive(buff, 4096); <br />
buff[nRead] = 0;
CString sTempMessage1(buff); <br />
TRACE("PASS Sent. Message received [%s]\n", sTempMessage1);<br />
}<br />
<br />
sMessageSend.Format("QUIT");<br />
iLength = m_socket.Send(&sMessageSend, sMessageSend.GetLength());<br />
if (SOCKET_ERROR == iLength)<br />
{<br />
TRACE("Error %i on send QUIT\n",GetLastError());<br />
return;<br />
}<br />
memset(buff,0,4096);<br />
nRead = m_socket.Receive(buff, 4096); <br />
buff[nRead] = 0;
CString sTempMessage1(buff); <br />
TRACE("QUIT Sent. Message received [%s]\n", sTempMessage1);<br />
<br />
m_socket.Close();<br />
return;<br />
Thanks for any advice.
|
|
|
|
|
First of all: I do not know WHY it freezes, but I give you a hint how to make it better:
Derive the CSocket class and override the OnReceice()-function, you won't then have to wait until you receive a packet but just get noticed through this function when a new packet arrives.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
If memory serves correctly (sorry, it's been a while) you need to insert a line break (\r\n) at the end of each request to the server other wise the server can't detect the end command, ie:
USER guest\r\n
PASS mypassword\r\n
Hope this helps....
|
|
|
|
|
hello @all,
does someone know, how I can round a double-number on two right-of-comma positions?
sunny
|
|
|
|
|
Hi,
I just came across an old article where the author had a program that was essentially an endless loop that would scan a directory for files and move them from that directory to somewhere else on the machine.
Under 'possible enhancements' he mentioned that he could use multiple instances of this same process to squeeze more performance - ie, to move more files, either in the same source directory or different directories.
This seems kind of goofy to me. I say the only performance gain you'd get would be on multi-processor machines, and that otherwise you'd actually be degrading performance since you're increasing the load on the OS scheduler.
Thoughts?
HB
|
|
|
|
|
It seems to me that the performance bottleneck would be the disk I/O in any case, and so extra processes/threads are unlikely to increase performance by any significant margin.
Dave
|
|
|
|
|
My app uses a CScrollView for one of it's document types and there can be a very large number of records to be displayed. I have now found that the TextOut() vertical position variable (an integer) is overflowing and therefore OnDraw() is redrawing the view with later data records. What is the correct method of displaying a VERY large number of records in a CScrollView window ??
Doug
|
|
|
|
|
Hi,
I'am creating a MDI App with a dialogbar in it. Inside of the dialogbar I have a bitmap that I have loaded with the ressource editor. I want some part of the bitmap to have the system color.
I have tried:
MainFrame::Mainframe()
{
CBitmap bitmap;
COLORMAP tabcolormap;
tabcolormap.from = RGB(255,255,255);
tabcolormap.to = COLOR_SYSTEM;
bitmap.LoadMappedBitmap(IDB_LOGO,0,&tabcolormap,1);
}
My App run well but the bitmap doesn't change.
My dialogbar is created with:
CDialogBar mydialog;
if(!mydialog.Create(this, IDD_DLGBAR, CBRS_RIGHT, IDD_DLGBAR))
{
TRACE0("Failed to create dialog bar\n");
return -1; // fail to create
}
any ideas?
thanks!!
|
|
|
|
|
I did not get exactly what you ment..
maybe the bitmap repaints before it appears..
try to handle tha onpaint event for it..
|
|
|
|
|
2 questions:
1. How do I search this message board? I had seen postings before but since I can't search for it, I can't find the answer. I thought there used to be a search link.
2. When a user selects "Display Properties" | "Settings" tab " | "Advanced" button | "Font Size" combo and selects "Large", is there a way to detect this programmatically? I need to resize my grid controls depending on whether normal or large fonts were sel'd cuz everything is not displayed or visible.
|
|
|
|
|
1. There's a "Search" edit control at the top. I think it will search the message board.
2. You can do it like this:
HDC a_hDC = ::GetDC( NULL );
BOOL a_bIsLargeFonts = (::GetDeviceCaps( a_hDC, LOGPIXELSX ) != 96);
::ReleaseDC( NULL, a_hDC );
Didn't compile it, but that's the basic idea.
Chris Richardson
Programmers find all sorts of ingenious ways to screw ourselves over. - Tim Smith
|
|
|
|
|
Chris Richardson wrote:
1. There's a "Search" edit control at the top. I think it will search the message board.
I had tried that...but it seems to only search articles and not this message board.
Thanks, for the tip. It got me started on where to look and my final solution was only slightly different from yours, having read up on it some from MSDN, where they suggest that large font selection was not guaranteed to be 120 DPI so I changed it slightly.
|
|
|
|
|
Hi,
I have written a tapi application which successfully makes a call(dial). But in my application i'm not able to accept an incoming call. I got the LINECALLSTATE_OFFERING call status, and there i tried the lineAnswer() API, but it just doesn't accept the incoming call. Is it the correct way for accepting a call?
Kindly help-
Vini
|
|
|
|
|