|
Hi all,
Does anyone know how I can find out what is available from a DLL in code? I can find out what DLL's an app/dll requires (cause I got the code from MSDN ), but I'd like to take this a step further and find out what the DLL offers and what gets used by a calling app/dll. Much like the way Dependency Walker does it...
Cheers,
Dylan
|
|
|
|
|
if you right click on the dll in the explorer there comes this menu up.. if you use the second function ( under "open with" should be sthing like "view item".. i don't know that exactly cause i am using the german version of the os) you should see all the exportet functions of this dll...
hope this works for you...
bernhard
""Politicians and diapers have one thing in common. They should both be changed regularly and for the same reason."
|
|
|
|
|
Thanks for the note, but I'm trying to do this in code
Any suggestions anyone?
|
|
|
|
|
This is kind of tricky to do. An exported function can be represented by a name or an ordinal. If they use an ordinal, all you have is the integer value. If it's a name, it could be mangled.
All exported functions are written to the exports table. the exports table contains the name (and address to the entry point) for each exported routine.
Look on MSDN for articles about the dumpbin utility.
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Thanks very much John, this has given me a good starting point
|
|
|
|
|
Hi all,
I need to get the version of a font file (.ttf).
It is possible to see the version with the
Windows font viewer so I guess it must be
possible to get the file version.
Does anyone know how to get the font file
version programmatically with a API call
or something like that?
Thanks for your help in advance!
Jens Doose
|
|
|
|
|
I have a strange pb with my application:
My app is a dlg application in which i have to use a ADO connection with an Access database:
CString strTemp;
strTemp.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\SwaptionCalculator\\ParameterFile.mdb;");
_bstr_t strCnn(strTemp);
In the last line there is a pb i have never met before today(i would like to specify that this lines haven't be changed since i have started my application, and it runned very well before today!)
So, if i try to run my application, a message arrives, telling me this thing:
"unhandled exception, ....0x00000005. Access Violation"
This happened when the app is at line of the following declaration:
_bstr_t strCnn(strTemp)
So, i would like to know what is the problem, and i thank in advance people who can help me
gerald
|
|
|
|
|
Have you tried debugging into the _bstr_t constructor. I can't believe that line can be giving that error. What other code have you changed recently? My guess is something has corrupted memory.
Michael
|
|
|
|
|
it's exactly what i think sthg corrupt memory, and i have changed nothing in my code which could break it. But, ihave tried to put a breakpoint in the _bstr_t constructor, which could initialize a _bstr_t object from a char* object, i have put this break point at the beginning of the constructor, and the application failed at this moment
|
|
|
|
|
Something in your code must have changed or you are loading some different data into memory somewhere. I'm not sure why you are using .Format when a simple assignment would do the job. You may need to post the code for the rest of the function so that we can help better.
Michael
|
|
|
|
|
you will find in the following post all the code concerning the dlg app. The function CalcHWEuropeanSwaption is defined in another part of my code, but it has no relation with the ado connection.
void CSWAPTIONCalculatorDlg::OnBermudanswaption()
{
BermudanSwaption ber;
double swaption;
UpdateData(TRUE);
::CoInitialize(NULL);
try
{
_ConnectionPtr pConnection=NULL;
CString strTemp;
CString strParam,strParamFin;
int decimal,sign;
strTemp.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\SwaptionCalculator\\ParameterFile.mdb;");
_bstr_t strCnn(strTemp);
TESTHR(pConnection.CreateInstance(__uuidof(Connection)));
pConnection->Open(strCnn,"","",adConnectUnspecified);
swaption=ber.CalcHWEuropeanSwaption(m_dlgStartDate,m_dlgSwaptionEndDate,m_dlgSwapEndDate,0,1,1,0.03,0.03,"TauxZCEuro","SurfaceVolatilite");
m_dlgPrice=swaption;
strParamFin.Format("%.5f",m_dlgPrice);
CEdit* Edit=(CEdit*)GetDlgItem(IDC_PRICE);
Edit->SetWindowText(strParamFin);
pConnection->Close();
}
catch(_com_error &e)
{
AfxMessageBox("a pas bon");
}
::CoUninitialize();
}
|
|
|
|
|
You say the code used to work and that you haven't changed anything. What about the data that you are putting into the dialog? Have you tried rebuilding all your project, sometimes the debug info can get out of synch with the source code and make you look in the wrong places.
I'd be tempted to move the strTemp and _bstr_t code to the top of the function. See if it crashes on the same line of code or in a different place.
Michael
|
|
|
|
|
It probably has nothing to do with access violation, but why are you using CString::Format? Is the code you've posted a real stuff or a simplified version?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
it's just a part of my code, as i'm a beginner in ado connection, i have read some articles about it, and i have found this way of proceeding. So, if you want to suggest me another way of doing, feel free to do it.
|
|
|
|
|
- If I just use the function "TlsAlloc" and do not use the function "TlsSetValue", I think we just allocate an index and do not allocate a memory space to store value of variable.
- Am I right?
- Regards,
Maer
|
|
|
|
|
Index == space to store the value of (void *) which will be passed later in the call to TlsSetValue.
What exactly do you want to do with TLS?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
- Thanks pal!
- Your reply is the one I am looking for. But when I am going to click the "this helped" button to vote for you, I meet a trouble! I can not find the "this helped" button.
- I just want to write an article about different OS with different process/thread implemention method. It is my homework of my class of advanced operating system.
- Have a nice day,
Maer
|
|
|
|
|
Hi All!
I have GUI application. If it running from GUI I output some information using MessageBox. But if it running from command line it must output some information in parent console (cmd.exe) while GUI application working in GUI.
How can I do it ?
Thanks a lot!!!
|
|
|
|
|
|
Yes, it is!
|
|
|
|
|
- The following statements are taken from MSDN:
The WM_DRAWITEM message is sent to the owner window of an owner-drawn button, combo box, list box, or menu when a visual aspect of the button, combo box, list box, or menu has changed.
- But I do not know what means "owner-drawn button".
- Can you show me an example?
- Regards,
Maer
|
|
|
|
|
'owner-drawn' button is a button which has BS_OWNERDRAW style set. With this style on button, Windows will send WM_DRAWITEM message to the parent of button when it needs to be repainter. Parent gets the device context (and other information) in the DRAWITEMSTRUCT and actually paints the button.
Use this owner-draw stuff when you want to change the default look of the buttons. CodeProject has many articles about owner-drawn buttons, but they use MFC, not plain Win32 API.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
- Thanks pal!
- Your reply clarifies my doubts.
- I still have a question. When you are mentioning "parent", are you referring to parent window?
- Can you help?
- Regards,
Maer
|
|
|
|
|
When you are mentioning "parent", are you referring to parent window?
Yes. This is usually a dialog or property page.
If you're going to implement owner-draw in a MFC app, note that MFC does some magic for you and 'reflects' the WM_DRAWITEM message to the button itself - all you need is to override the CButton::DrawItem.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
- Thanks pal!
- Your reply is the one I am looking for.
- Regards,
Maer
|
|
|
|