|
Yes, it is same as on both.
And this is static library.
|
|
|
|
|
Your problem is that you're trying to link with two versions of the VC++ library. One's from VC++6 and the other's from VC++9.
The cleanest way of getting around this is to rebuild the VC++6 component using VC++9 - build it and clean up the errors and warnings. You can do some fiddling about with linker switches (/NOD and explicitly link your app with the libraries it wants) but there's a fair chance it'll fail somewhere in the build (if you're lucky) or produce all sorts of interesting errors (when run by your customer/professor).
Cheers,
Ash
|
|
|
|
|
Trying to link with a static library .lib file produced on vc6, using vs2008 is asking for a whole lot of grief. Mainly because of what Ash has replied to you with. You're best approach now is to try to get the static library to build on vs2008. What are the errors when you compile the library?
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
|
|
|
|
|
Whenever you get a linker error of this type, whinging that something has already been defined in a library starting with MSVC, it's almost certainly because you're trying to link two or more object files that have been compiled for different versions of the C++ runtime library. Generally most people ship their libraries to link with the release multi-threaded DLL version of the library, but this isn't exclusively true.
So what can you do about it?
If you have the library source change the compiler settings of the library to match your application. If you haven't got the source then change the compiler settings of your application to match the library - the author should have documented it somewhere.
To find the setting you need to fiddle select the project then dig through the project->properties->configuration properties->C++->code generation and look for "Runtime library."
Whatever you do unless you really know what you're up to, don't try linking against different versions of the library, all sorts of things can go horribly wrong in strange and interesting ways.
Cheers,
Ash
|
|
|
|
|
|
Hi,
I am working on Excel Automation.
Implemented the logic to retrieve all the running Excel instances, now I am getting IDispatch pointer. Assigning this IDispatch Pointer to Excel object.
Following is the code:
IDispatch* p=NULL;
HRESULT hr = AccessibleObjectFromWindow(hwnd, OBJID_WINDOW, __uuidof(IDispatch), (void**)&p);
if(hr == S_OK)
{
try
{
Excel::WindowsPtr pWindow = NULL;
HRESULT hr = p->QueryInterface(__uuidof(IDispatch),(void**)&pWindow);
Excel::_ApplicationPtr xl;
xl = pWindow->Application;
But its throwing exception at above line. The com error is: m_hresult is "Member not found".
I googled but there is no clarity in solution.
If any clue, please let me know.
Thanks in Advance.
Regards,
KTTransfer.
|
|
|
|
|
Hi,
is there a way to modify the screen contents on the fly? I would like to modify one specific pixel before it is sent to the monitor.
The reason for this is that I have a strangely behaving stuck pixel on my laptop. The blue part of the RGB is inverted so the pixel is blue when it should be black or yellow when it should be white.
I would like to invert the blue component of that particular pixel before it is displayed so that due to double-inversion it will have the correct color.
Preferably I would like to implement this without a window but I guess I could always display an on-top, one-pixel-big window and send the clicks to underlying one. I would probably have to run this in admin mode to be able to send clicks to admin-owned underlying windows.
A better solution would be to access the screen buffer directly.
How would you guys go about it?
Thanks,
yak
|
|
|
|
|
Well, I would hack the driver.
Oh, wait, I wouldn't, but you might do it.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
I have dialog and i set the background to LIGHTGRAY color in OnPaint()
pDCTmp->FillRect(rect,&CBrush(LIGHTGRAY));
So all static controls has normal dialog background colr.SO i use follwing code in OnCtlColor()
if (nCtlColor == CTLCOLOR_STATIC)
{
pDC->SetTextColor(RGB(0, 0, 0));
pDC->SetBkMode(TRANSPARENT);
}
But nothng happened,
Browsing some articles i try to include this
CBrush m_brHollow = m_brHollow.CreateStockObject(HOLLOW_BRUSH);
if (nCtlColor == CTLCOLOR_STATIC)
{
pDC->SetTextColor(RGB(0, 0, 0));
pDC->SetBkMode(TRANSPARENT);
hbr = m_brHollow;
}
This also no use.Finally i try
pDC->SetBkColor(LIGHTGRAY);
CBrush brush;
if((HBRUSH)brush == NULL)
brush.CreateSolidBrush(LIGHTGRAY);
return (HBRUSH) brush;
But no use.Still it shows the samething.What can i do?
Anu
|
|
|
|
|
Your problem seems to be elementary.When the CWnd::OnCtlColor is finished the brush you have created inside is automatically destroyed by the MFC runtime without warning, so nothing happened.You should declare the brush as your window class member variable not as local variable.At first simply put it in your dialog(for example) h file:
class CMyDialog:public CDialog
{
protected:
CBrush m_brH;
....
}
Initialize in the dialog contructor
CMyDialog::CMyDialog(CWnd* pParent )
: CDialog(CMyDialog::IDD, pParent)
{
...
m_brH.CreateSolidBrush(RGB(0,0,255));
return TRUE;
}
Use it elsewhere without releasing:
HBRUSH CMyDialog::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if (nCtlColor == CTLCOLOR_STATIC)
{
hbr = m_brH;
}
return hbr;
}
and at last don 't forget to release it:
CMyDialog::~CMyDialog()
{
if(m_brH.m_hObject!=NULL)
m_brH.DeleteObject();
}
Life is a stage and we are all actors!
modified on Thursday, May 20, 2010 10:30 AM
|
|
|
|
|
|
Hi,
I want to open control panel in MFC dialog box application.When i click a button, want to open control panel
|
|
|
|
|
Try that:
<br />
::ShellExecute(m_hWnd, NULL, _T("control.exe"),NULL, NULL, SW_SHOW);<br />
Life is a stage and we are all actors!
|
|
|
|
|
|
Dear Sir/Madam,
I want to retrive the system's seral number via using DOS Command in Turbo C.
|
|
|
|
|
What is the "system's serial number"?
Why do you want to use [euphemism] a bit outdated [/euphemism] technology?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
System means our Computer system
|
|
|
|
|
I like to retrive the motherboad Number via DOS command by using in 'C' Language.
|
|
|
|
|
I am not aware of any DOS command that can get this information, you probably need to investigat the WMI classes. Take a look at Win32_BaseBoard[^].
It's time for a new signature.
|
|
|
|
|
How to increase the size of a button according to button text.
Thanks..
|
|
|
|
|
You can use the GetTextExtentPoint32[^] to measure the text. Remember to use the same font the button is.
Steve
|
|
|
|
|
Thnx stev, but the above function is giving height and width of string, how to create button on the basis of the string size.
Thanx..
|
|
|
|
|
You can use GetWindowRect to find out where the button currently is and MoveWindow to resize it.
It might be an idea to create a new control based on BUTTON (or derive a new class if you're using MFC) which resizes itself rather than trying to pack all this lot into the containing dialogue box or window.
Cheers,
Ash
|
|
|
|
|
Every release for visual studio must be contain a version of MSDN. As follow described:
A: The October 2001 MSDN Library integrate with Visual Studio 6.0.
B:The January 2003 MSDN Library integrate with Visual Studio .NET (2002).
C:The January 2006 MSDN Library integrate with Visual Studio .NET 2003.
D: The April 2007 MSDN Library integrate with Visual Studio 2005 (Service Pack 1).
E: The January 2008 version integrate with Visual Studio 2008.
F: The November 2008 version integrate with Visual Studio 2008 SP1.
I only have one question, should i use the newest MSDN for query the usage for function, enum, etc. Or should i use the associated version with VS(if use VS6.0 for development, then use MSDN 2001 oct, if use VS2005, then use MSDN 2007 april)?
One day a pretty girl asked me:"Do u think you are handsome?" "I don't think so!".She gave a slap in my face:"Why lying?"...
|
|
|
|
|
Use the one matching the version of the SDK you have installed.
|
|
|
|