|
Thank you for your help. I have trouble understanding what you explain but I think you guide me in the good direction.
For the version of the CRT, I think I use the DLL version but how can I be sure (I was not the one who did the configuration for this software).
Let's show some code which seems to be linked to my problem.
First in the DUtils.dll. We have a file "DUtils.h" which look like this :
(I do not know how to format the code for the forum )
*********************************
// Include file for DUTILS DLL
#pragma once
#pragma message(" --> Including "__FILE__)
// this is done so that classes are exported when building the
// DLL but imported when referencing the DLL
// class defined to be exported should have the CLASS_DUTILS
// inserted in their class definition
#ifdef DUTILS_IMPL
#define CLASS_DUTILS __declspec(dllexport)
#ifdef _DEBUG
#pragma message("Building DUtilsd.dll")
#else
#pragma message("Building DUtils.dll")
#endif
#else
#define CLASS_DUTILS __declspec(dllimport)
#ifdef _DEBUG
#pragma comment(lib, "DUtilsd")
#pragma message("Referencing DUtilsd.dll")
#else
#pragma comment(lib, "DUtils")
#pragma message("Referencing DUtils.dll")
#endif
#endif
************************
This file is included in the "stdafx.h" of the project (exe or dll) that which to use classes defined in DUtils.dll"
In the "StdAfx.h" of DUtils.dll, we have the 2 following lines :
***************************
#define DUTILS_IMPL
#include "dUtils.h"
***************************
And part of the DUtils.dll we have for example a class called DCStringArray, which looks like this (DCStringArray.h) :
***************************
#pragma once
#pragma message(" --> Including "__FILE__)
class CLASS_DUTILS DCStringArray : public CStringArray
{
public:
// construction / destruction ----------------------------------
DCStringArray();
DCStringArray(const DCStringArray& other);
virtual ~DCStringArray();
DCStringArray& operator =(const DCStringArray &other);
void BuildFrom(LPSTR lpBuffer,LPSTR seps) ;
void BuildFromCommaSeparated(CString str);
void BuildFromItemsSeparatedBy(CString sListItem, CString sSeps);
BOOL AddIfNotExists(const CString& s);
BOOL Contains(const CString& s) const;
int ContainsNoCase(const CString& s) const;
void FillWithSeparation(CString &s, const CString& strSeparator) const;
};
***************************
NB : We also have one called DCString derived from CString.
Now in DCData.dll, a DLL which uses DUtils.dll (#include "DUtils.h" in "stdafx.h"), we have for example a class called DCAcquisitionHolder (defined in DCAcquisitionHolder.h") which looks like this (DCStringArray is only used in this constructor) :
******************************
#pragma once
#include "DCStringArray.h" // for channel names
class CLASS_DCDATA DCAcquisitionHolder : public CObject
{
public:
// -----------------------------------------------------------------------
DCAcquisitionHolder();
DCAcquisitionHolder(const DCAcquisitionHolder& other);
DCAcquisitionHolder(const DCStringArray& channelNames);
virtual ~DCAcquisitionHolder();
(...some other functions ...)
};
******************************
And now "DCAcquisitionHolder.cpp" :
**********************************************
DCAcquisitionHolder::DCAcquisitionHolder(const DCStringArray& channelNames)
{
Init();
for (int i=0; i < channelNames.GetSize(); i++)
{
DCChannelHolder* pChannel = new DCChannelHolder(channelNames[i]);
m_channels.Add(pChannel);
}
}
**********************************************
And so when compiling, here is one of the 50 errors that we have :
************************************
************************************
------ Build started: Project: DCData, Configuration: Release Win32 ------
Linking...
DUtils.lib(DUtils.dll) : error LNK2005: "public: __thiscall ATL::CStringT<char,class strtraitmfc<char,class=""
atl::chtraitscrt<char=""> > >::CStringT<char,class strtraitmfc<char,class="" atl::chtraitscrt<char=""> > >(class
ATL::CStringT<char,class strtraitmfc<char,class="" atl::chtraitscrt<char=""> > > const &)"
(??0?$CStringT@DV?$StrTraitMFC@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@QAE@ABV01@@Z) already defined in
DCAcquisitionHolder.obj
Can you see more what happens now ?
|
|
|
|
|
I can not believe I am the only one who gets these errors. Its been 3 weeks now and I still can not use VC7.
Heeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeelp
|
|
|
|
|
Can someone direct me to a good place for information about DeskBands? I have looked at all of the articles on this site, and they don't give me the information I need. There are a few things I am trying to figure out and any help would be greatly appreciated.
1) I'm not sure how to trigger a call to GetBandInfo or if there is a way to call a SetBandInfo method. I need this to happen because my window min, max etc change but the only way to get the deskband to notice is to resize the taskbar manually.
2) I need to know how to tell Explorer to release the deskband because it never does.
3) I need to know if there is a way to start a deskband programatically ( ie without using the mouse to select it )
Thanks
|
|
|
|
|
Hello, Did you ever find a way to programatically start/open/close/reposition, etc the deskband? I also need to do so...
Thanks, Demián.
|
|
|
|
|
Did you ever get any answers?
|
|
|
|
|
I wanna use WINDOWINFO and GetWindowInfo in my applican but the compiler can not identify them.Any idea?
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
That function requires windows98 or later, ans WindowsNT4.0 with the SP3.
The compiler will not let you see this function because you probably have this definition in your "stadafx.h" file:
#define WINVER 0x0400
That basically says use version 4.0 and below API functions. You will need to change this definition to this:
#define WINVER 0x0500
The only drawback to doing this is that you will have to check the version of the OS that your app is running on before you call the version 5.0 API functions if you want your app to run on Windows 95.
Good Luck.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Thanksssssss,I change it and it works now.
How do you know these things kilo?
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
I worked for a company that had to analyze every aspect of the Windows API in order for their product to work properly. Needless to say I learned things that you wouldn't believe about the Windows API, and I learned how to read the documentation very well in order to find the details that I needed.
I would like to add one thing, I think that the MSDN documentation is excellent. So many times I see people complain that Microsoft's documentation sucks, and they complain that this feature is not documented. I find that if I spend a few extra minutes reading all of the remarks and information for each function you can usually solve your problems.
Anyway, the way that I knew how to solve this problem is that at the bottom of the docuementation for each function in the SDK docuemntation you will see this:
Requirements
Windows NT/2000 or later: Requires Windows NT 4.0 SP3 or later.
Windows 95/98/Me: Requires Windows 98 or later.
Header: Declared in Winuser.h; include Windows.h.
This will help you decide if you can use it or not, and which version headers that you need to use in order
to get the compiler to give you access to the functions.
If you have any more questions ask away.
Good Luck.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
If you have windows.h included and User32.lib it should work... and what I know these are already included?
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C# and C++!
|
|
|
|
|
Thanks Rickard,the problem was what kilo said.
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
Is this the correct way to set a CView's background?
CView::OnEraseBkgnd(pDC);
CRect r;
CBrush b;
b.CreateSolidBrush(RGB(200,200,200));
GetClientRect(&r);
pDC->FillRect(r,&b);
return true;
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
I would say yes, except that you probably do not want to send a call to the base class since you are redrawing over the entire screen anyway. You may end up with a flicker if white, then your gray color that you define.
Are there any problems that you are seeing?
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
kilowatt wrote:
I would say yes, except that you probably do not want to send a call to the base class since you are redrawing over the entire screen anyway. You may end up with a flicker if white, then your gray color that you define.
Are there any problems that you are seeing?
Thanks Kilo. I am not facing any probs. The reason I had to do this was that I assumed that the background of the view would be RGB(255,255,255) but it was not that
So I thought what the heck and made the background and my image background my own slightly grayish color.
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
but please be warned..
it is not not not nice at all to set a window's background not in the color the user defined in his / hers settings..
e.g. i have got a slight grayish background for all windows (otherwise my eyes burnt after staring 8 hours++ at the monitor)
<rant>
and i hate all programmer and want to rip out their nuts *you can add any hate - fantasy you like, e.g. slipknot lyrics*, who override my settings with stupid settings (e.g. white)..
like lotus notes does.. (at least the client i have to use)
if you don't want to use windows settings use another platform...
and if you are a smart programmer you would use a transparent bitmap, altough it could look totally crappy if the background could be too dark...
but.. you are a smart programmer, aren't you? so you are paid to find a solution..
maybe it is not a too good idea to override windows settings.. not?
bernhard
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous." U.S. Secretary of State Colin Powell at George Bush's ranch in Texas
|
|
|
|
|
Well in this case I am the single end-user. This is a test program where I am trying to decode an unknown image format. I like grays. I want a gray background since I am going to be running this program close to 600 times today and tomorrow before I manage to crack the image format
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Should work. You can use CDC::FillSolidRect which could be marginally faster - it uses a trick with ::ExtTextOut and doesn't create brush.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
Hi,
For some bizzare reason I can't run any of my GDI+ projects in Debug mode. Keep getting compile-errors when i try to dynamically instantiate a Bitmap object. Also the IDE doesn't list the members of GDI+ objects as I code.
Anyone any clues?
Cheers
Richard
|
|
|
|
|
You don't mention what compile-errors you're getting.
If you're getting Error C2660: 'new' : function does not take three parameters, then an MFC generated define, DEBUG_NEW, defines a "new" operator that takes three parameters. It only applies to debug builds. You can undefine DEBUG_NEW so that debug builds also work or use the scope resolution operator ( :: ) before new to use the default C++ version, like this:
bitmap = ::new bitmap
|
|
|
|
|
Hi,
I have been looking at the GDI+ BitmapData Class for direct pixel data access. In MSDN it mentions you can get "bottom up" bitmap as well as "top down", when do you get bottom-up, is this present in any particular standards?
Cheers
Rich
|
|
|
|
|
I do not know if it is present in any standards, but in the regular GDI, when you get access to the bits through GetDIBits, you can specify whether you want a bottom up, or a top-down bitmap.
So it is a common thing, it has been around since windows 3.0, maybe longer. I think it really depends on what you are doing to determine how you may want to scan your bitmap.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Sometimes your bitmap is upside down, or you want to flip your bitmap vertically at runtime, this is an easy way to accomplish that with no extra code beside specifying the scanline order that you desire.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I have a STA COM object which is the gate to a service that has 15 threads, each corresponding to a Logical connection against an MVS. When this COM object lives inside the COM+ I can see from the performance monitor that it utilizes up to 8 threads. So no matter how many clients hit the component it will utilize up to 8 threads.
However, when the same component lives outside the COM+,regsvr32 kkkk.dll, it will utilize all 15 threads.
1. Is there such a limitation in COM+?
2. Why the same component operates perfectly outside COM+?
3. Is there a chance to increase the number of threads while the component lives inside COM+?
Thx
Spiros Prantalos
|
|
|
|
|
Which win32 API should I use to find out which external window has focus?
Thanks
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
GetFocus will return the handle to the window if that window belongs to the calling threads message queue. If a window in that thread does not have the focus, then the result will be NULL.
If you want to find out the focus window that belongs to a different thread or even a different application, you can call GetForegroundWindow to get a handle to the window with which the user is currently working then associate your threads message queue with that window by calling AttachThreadInput . THen you will be able to successfully call GetFocus on that window and get the handle of the control with the focus.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|