|
Great ideea ! Now work fine ! Thank you !
|
|
|
|
|
You are welcome.
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 . How can I tell the compiler that should compile only VC6 code ? I have the follow code :
BOOL CMainFrame::ShowNotifyBaloon(PTSTR szBalloonTitle, PTSTR szBalloonMsg, DWORD dwIcon , UINT nTimeOut)
{
VERIFY((nTimeOut *= 1000) >= 10000);
ASSERT (dwIcon == NIIF_WARNING || dwIcon == NIIF_ERROR || dwIcon == NIIF_INFO || dwIcon == NIIF_NONE);
m_NID.dwInfoFlags = dwIcon;
m_NID.uFlags |= NIF_INFO;
m_NID.uTimeout = nTimeOut;
::strcpy(m_NID.szInfoTitle,szBalloonTitle);
::strcpy(m_NID.szInfo,szBalloonMsg);
return ::Shell_NotifyIcon(NIM_MODIFY,&m_NID);
}
that is not recognize in VC6 , but is in VC7 .... does exist some an compiler directive to compile only VC6 code and not VC7 code ?
|
|
|
|
|
There are a number of things you can look for. Open your stdafx.h and check
WINVER,_WIN32_WINNT,_WIN32_WINDOWS,_WIN32_IE,_MSC_VER
They define SDK and compiler version. You can use these in #if directives in your code to make it conditional.
|
|
|
|
|
Here is my stdafx.h
#if !defined(AFX_STDAFX_H__B5537D0B_2DD5_11E0_8FF9_0050BF29759A__INCLUDED_)
#define AFX_STDAFX_H__B5537D0B_2DD5_11E0_8FF9_0050BF29759A__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h>
#include <afxext.h>
#include <afxdisp.h>
#include <afxdtctl.h>
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h>
#endif // _AFX_NO_AFXCMN_SUPPORT
and it's about _MSC_VER ? And which version is it ?
|
|
|
|
|
According to MSDN, if you type cl /? at the command line, you will see the full version for the compiler you are using.
Just make sure you know the difference between SDK version and compiler version before you proceed. You might be able to download a later SDK for your old compiler and make it work.
|
|
|
|
|
It should be 1200 for VC6.
|
|
|
|
|
Yes , it's 1200 , because if I write > 1200 won't compile VC7 code , but if I wrote >= 1200 compile VC7 code ,and , of course give error . Thanks !
|
|
|
|
|
I couldn't understand what you want to achieve exactly.
Flaviu 2 wrote: How can I tell the compiler that should compile only VC6 code ?
If you don't want to compile some codes in later releases than VC6. You can use this guard.
#if _MSC_VER <= 1200
...
#endif
But, your problem seems to be related with SDK version rather than compiler version. If so, (that is, a new feature which is not exist older vers,) you should use other macros such as WINVER, _WIN32_WINNT, _WIN32_WINDOWS, _WIN32_IE or _MFC_VER depending on your feature. Or you can use newer SDK as indicated by Niklas. Or may be, you just need to define target platform or similar appropriately on top of stdafx.h.
#define _WIN32_WINDOWS 0x0600
|
|
|
|
|
Hi ,
I have created a .DLL in one solution and I am trying to use that .dll in another solution.
In Visual Studio 2010 if I want to use same .DLL in the same Solution in which it was created , then I can do "Add->References->Configuratio~->Project"
But when I try to use this .DLL in another solution I cannt see .DLL in the "Project" tab.
How can I add reference to dll which is in another solution. MSDN shows the way for adding references of dll only for those which are in same solution.
|
|
|
|
|
Hi,
You can add the existing project to your solution and then add the lib of that dll project in linker options of the project you want add a reference.
Hope this helps
Nitheesh
Nitheesh George
http://www.simpletools.co.in
|
|
|
|
|
Use the Browse tab and add the reference from the folder of the other solution.
|
|
|
|
|
"Browse" is not available in visual studio for a C++ Projects.
|
|
|
|
|
For unmanaged C++ projects, you add a DLL reference as mentioned by Nitheesh George.
Open Project -> Properties -> Configuration Properties -> Linker -> Input .
Enter the name of the LIB file corresponding to the DLL in the Additional Dependencies text box.
|
|
|
|
|
In addition to what Superman said, be sure that the DLL is in the library search path used by Windows so it can be found when your program runs.
I must get a clever new signature for 2011.
|
|
|
|
|
Thanks a lot .
I tried by setting System environment variable,added Library include & Additional dependency and it solved my issue .
|
|
|
|
|
Hello Friends
I want to draw on a image and for that m using FindWindow for its handle and then crating DC and then Graphics Object but after that when I am drawing using drawImage then its drawing above all the windows not on that specific window whose handle m finding.
Here is the code below:
Bitmap gbmp(fileName);
HWND hwnd = FindWindow(...,..);
HDC hdc;
hdc = GetDC(hwnd);
Graphics g(hdc);
g.DrawImage(&gbmp, 500,500, gbmp.GetWidth(), gbmp.GetHeight());
Any Ideas?
Regards
Yogesh
|
|
|
|
|
You will need to convert the coordinates from screen coordinates to window coordinates.
The APIs ClientToScreen and ScreenToClient do this.
Not sure which class/method in GDI+ does this.
|
|
|
|
|
I hope the window you are finding is not the foreground window? Is that correct?
Here is the reason, even though we get separate DC for each window, keep it in mind that the screen space is shared by all the windows.
So if you try to get the DC of window which is not in foreground and when we paint it other than in WM_PAINT cycle then it'll be painted on the shared screen space.
This is why you are seeing the bitmap image at top of all the windows and not in the found window.
Do your Duty and Don't expect the Result
|
|
|
|
|
I have a problem in that the MFC wizard is not generating complete wrapper code for my activex control.
I have a control which I am developing, called CombinedControl. I have in the past added custom properties to that control (and others like it), and generated C++ wrappers using the wizard (select _DCombinedControl interface in Class View, right click; choose Add Property; set property type to DOUBLE, name is Altitude, no params, set 'Get/Set method' check). I build the control, then add an instance of the control to a host dialog in another project, and create a control variable, which appears as a member of the dialog. If all the stars align, the control variable's class will have Get*() and Set*() access methods. The wizard does this by creating a wrapper class (e.g. CCombinedcontrol1) in my host dialog project which implements CWnd and contains the access functions (e.g. CCombinedcontrol1::GetAltitude()).
My problem is that if I return to my ActiveX control and add more properties(e.g. Heading), the wrapper class never generates access functions for them. They are in the IDL for my ActiveX control, and they are in the C++ wrappers for my control class; but the client app's wrapper never generates the access methods (e.g. CCombinedcontrol1::GetHeading()). I get an empty wrapper, with the class defined but access methods absent.
I have done clean builds, deleted and restored the control from the host dialog, unregistered and re-registered the server ... over and over ... all day. I am going nuts.
Any idea what I am doing wrong??
Better yet, what can I do right?
Thanks loads
Eric
PS. VS Pro 2008, particulars follow.
-------------------------------------------------------------------------------------
Microsoft Visual Studio 2008
Version 9.0.30729.1 SP
Microsoft .NET Framework
Version 3.5 SP1
Installed Edition: Professional
Microsoft Visual Basic 2008 91605-031-5000002-60582
Microsoft Visual Basic 2008
Microsoft Visual C# 2008 91605-031-5000002-60582
Microsoft Visual C# 2008
Microsoft Visual C++ 2008 91605-031-5000002-60582
Microsoft Visual C++ 2008
Microsoft Visual Studio 2008 Tools for Office 91605-031-5000002-60582
Microsoft Visual Studio 2008 Tools for Office
Microsoft Visual Web Developer 2008 91605-031-5000002-60582
Microsoft Visual Web Developer 2008
..hotfixes deleted .... I have the latest service pack.
|
|
|
|
|
Hi everyone . I have an weird problem : into SDI VC6 application , that compile fine to my work , but at home , with the same VC6 environment give me the follow error :
LINK : fatal error LNK1104: cannot open file "libcmt.lib"
I can't figure out what is the problem .. .can you help me ?
|
|
|
|
|
First, make sure you have libcmt.lib on your hard drive by searching for it.
Next, make sure your VC6 directory path for Lib includes that directory.
|
|
|
|
|
I didn't find it on my computer , I need to get it rom my work PC .... thank you for answer .
|
|
|
|
|
Hey
I have a C++ WIN32 app having a dialog with 5 buttons.
Now i want to call the SetFocus() function to set the focus on each buttons. The focus does get set in a way, i.e., if i press the space key in key board, it will infact click the button to which the SetFocus() function was set. But visually it doesn't work.
i.e., it doesn't draw a blue border on the button giving it a visual feel that the button has focus on it.
Why is this happening? Is there a way to have SetFocus() draw the blue border along the button?
If i open a windows folder on top of it, it will draw the blue border along the button that was called with SetFocus() function.
Thanks in advance.
|
|
|
|
|
May be you have to invalidate the button to enforce a redraw ...
|
|
|
|