|
Hi everyone. In a program I am writing, I need to check which version of some system dlls are installed, for example. mfc42.dll, comctrl.dll, and a few others. I know there is a few ways of doing this, but what would be the "best" way to do this so that it will be compatible with future versions of Windows, and requires the least amount of overhead? Thanks in advance for any help!
|
|
|
|
|
See April 98 C++ Q&A in MSDN
Q How can I tell which version of a particular module (DLL) is installed on my system? I am trying to figure out which version of comctl32.dll is installed. I have seen code that calls GetProcAddress to try getting various functions like InitCommonControlsEx to determine the version based on which functions are present. This seems kludgy to me. What is the right way to get the version?
A Well, there are two ways: the easy way and the hard way. The easy way is to call a special new entry DllGetVersion. The only problem is, while comctl32.dll supports this function, not all DLLs have it. If there's no DllGetVersion, you have to use the hard way—namely, the FileVersion API, which is perhaps one of the most confusing APIs you will ever come across.............. (see MSDN)
|
|
|
|
|
this is my dilemma I have never done C++ before and I have a class assignment due in one week, can you help me with the code. If you email me I will give you my problem. Please help me
|
|
|
|
|
What do you need to know ? Do you know how to use cin/cout ? Do you expect people to email you instead of answering through the site ? Why did you remove the problem ?
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
No cin or cin out... problem was so long... if you email me i can give you problem...
C++ Virgin
|
|
|
|
|
You don't know how to use cin and cout ?
You know, if we discuss it here, other people might offer advice also. It will all be in the form 'look this up/try this', but I'm sure we're all happy to help you to help yourself.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Christian,
not sure how to get started. I know a wee bit of UNIX from a 3 week class and no C++. The assignment seems so hard for a first assignment.
C++ Virgin
|
|
|
|
|
C++ Virgin wrote:
The assignment seems so hard for a first assignment.
Could you reduce the suspense a little bit by telling us what it's about?
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Nish - Native CPian wrote:
Could you reduce the suspense a little bit by telling us what it's about?
LOL. Nice line Nish.
Michael
|
|
|
|
|
Michael P Butler wrote:
Nice line Nish.
That's what I thought too. But I didn't anticipate what happened later
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Please reduce the suspense. What happened later?
|
|
|
|
|
Ed Gadziemski wrote:
Please reduce the suspense. What happened later?
He emailed me his assignment question docs
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
I'm trying to save the current file i'm working on in a visual studio file from an Addin.
I can not get the save command to work. How do you use the command?
Examples, Suggestions?
Here is the code
STDMETHODIMP CCommands::FileFavoritesCommandMethod()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
//Get the current file working on
CString csCurrentFile;
CComPtr<idispatch> pActiveDocument;
m_pApplication->get_ActiveDocument(&pActiveDocument);
if(pActiveDocument)
{
CComQIPtr<itextdocument,&iid_itextdocument> spActDoc(pActiveDocument);
if(spActDoc)
{
spActDoc->Save();
BSTR bstrName;
spActDoc->get_FullName( &bstrName );
}
}
}
|
|
|
|
|
how do you know that it is not working?
|
|
|
|
|
It's not compiling.
I'm not sure On what to pass in on the parameters, It wants
::Save(THIS_ VARIANT vFilename, VARIANT vBoolPrompt, DsSaveStatus FAR* pSaved)
I've tried
DsSaveStatus saved;
Save(NULL, TRUE, &saved);
return
--cannot convert parameter 1 from 'const int' to 'struct tagVARIANT
Pluss plenty more and they all say they cannot convert parameter 1 to struct tagVARIANT
Scott
|
|
|
|
|
Use the following code
VARIANT vtErr;
vtErr.vt = VT_ERROR;
vtErr.scode = DISP_E_PARAMNOTFOUND;
VARIANT vtPrompt;
vtPrompt.vt = VT_BOOL;
vtPrompt.boolVal = VARIANT_TRUE;
spDoc->Save(vtErr, vtPrompt, &saved);
This would work but life would be much cool if you use CComVariant or _variant_t.
|
|
|
|
|
that worked, thanks.
I tried using _variant_t but it gave an error when compiling. How do you use CComVariant and _variant_t.
thanks
Scott
|
|
|
|
|
#include <comdef.h>
.
.
.
spDoc->Save(vtMissing, _variant_t(true), &status);
|
|
|
|
|
That gave me the linking errors
Commands.obj : error LNK2001: unresolved external symbol "class _variant_t vtMissing" (?vtMissing@@3V_variant_t@@A)
Commands.obj : error LNK2001: unresolved external symbol "void __stdcall _com_issue_error(long)" (?_com_issue_error@@YGXJ@Z)
|
|
|
|
|
You need to have comsupp.lib linked
|
|
|
|
|
|
How can I replace the scrollbars in a CEdit derived edit control with my own, derviced from CScrollBarCtrl? I've tried all sorts of wierd and wonderful methods, but none seem to work. Also, how would I go about doing the same for list boxes, list controls and combo boxes?
____________________
David Wulff
hu·mour Pronunciation Key (hymr)
n. & v. Chiefly British
Dave's Code Project Screensaver and Wallpaper page.
|
|
|
|
|
Have a look at this article. There is a brief discussion of this question.
Please let us know if you can pull it off.
|
|
|
|
|
|
You shoule be able to override the windows CWnd::GetScrollBarCtrl() virtual function for the window that contains the scroll bars. You can then return pointers to your replacement scrollbars for the horizontal and vertical scrollers.
If you take a look at the base class code you will see what you need to do.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|