|
Thank you Stuart
I will test it immediately!
Actually what I would like to achieve is to directly move an entire block of data from the stream to vector someway!
I have doubt that std::copy probably might be slow, but I have to test it before saying that
Have a nice evening!
ManuStone
|
|
|
|
|
I am working on a button that has a custom shape, and I wanted to give the user the option to match the button color scheme used by XP. I was planning to fill the button region with a gradient matching the current XP theme.
I asked this question on the Yahoo WTL forum. The answer makes writing a custom shaped button a little more difficult.
I am trying to use theme colors in XP to draw a gradient background
that is not rectangular. I am utilizing atltheme.h to call
GetThemeColor(BP_PUSHBUTTON, PBS_HOT, TMT_GRADIENTCOLOR1, &c). I am
trying to retrieve just one gradient color at the moment. I've tried
using DrawThemeBackground for a button. The colors are correct, but
the shape cannot be changed to fit the region I am filling.
I've discovered that most theme parts do not return gradient colors.
(I am able to get some colors, just not the gradient colors.) Does
anyone know how to retrieve the gradient colors used to draw themed
buttons? Most of the examples I have found hard code the gradient
colors to look like the theme colors.
The answer I received:
Themed buttons are actually drawn using a template bitmap, so there are no
gradient colours to retrieve.
Is this documented some place? I searched using google and I've had no luck locating any references to bitmap templates used for buttons.
|
|
|
|
|
Jim Barry answered all of my questions on Yahoo WTL[^]. Many thanks to him.
Short answer: Oh yes, totally undocumented.
Jim's answer also made it clear to me why custom shapes are difficult to theme if you want to use the "Button" theme.
I am most grateful for Jim's quick and accurate answers.
|
|
|
|
|
Hello friends,
How can I use the VB.NET's library in VC++.
Any article that will give the clear idean on this problem.
Thanks in advance to all of you.
ritz1234
|
|
|
|
|
You could either try using COM interop[^], or you could check out how to use the /clr switch[^] with the C++ compiler.
--
Kein Mitleid Für Die Mehrheit
|
|
|
|
|
I developed a desktop application with WTL, which contains a toolbar. The tool bar was ceated like as following codes. It works well. But when I tried to modify the style of the toolbar and make it to be docable or vertical. I failed in all attempts. I wonder why it becaoms so difficult with WTL while it's very easy with MFC to modofy a toolbar from horozontal to vertical dynamically. I tried to look for useful sample codes from internet. But, failed to find any matching samples. I believe it's a simplist requirement for a toolbar to be docable or to present in vertical direction. There must be many developers who ever encountered the same confusion as me. Then how do they resolve thire problems?
Can anyone provide me some hints or contribute some of his samplke codes. I'll apprieciate so much. I attahched my sample. Can anyone help me to modify the toolbar into vertical or docable one? Thanks a lot in advance.
BOOL CreateToolBarCtlr(HWND hParent, CToolBarCtrl& toolBarCtrl, RECT rcBar, LPCTSTR lpszCaption) { ATLASSERT( hParent && lpszCaption); if(hParent == NULL || lpszCaption == NULL) return FALSE; <br />
ATLASSERT(toolBarCtrl.m_hWnd == NULL); <br />
if( toolBarCtrl.m_hWnd != NULL) return FALSE; <br />
DWORD dwStyle = CCS_NODIVIDER | CCS_NOPARENTALIGN | CCS_NORESIZE;<br />
dwStyle |= TBSTYLE_TRANSPARENT | TBSTYLE_FLAT | TBSTYLE_TOOLTIPS |<br />
TBSTYLE_CUSTOMERASE; dwStyle |= ATN_CHILD_STYLE; <br />
toolBarCtrl.Create(hParent, rcBar, lpszCaption, dwStyle, 0); <br />
ATLASSERT(toolBarCtrl.IsWindow()); <br />
DWORD dwStyleEx = toolBarCtrl.GetExtendedStyle(); <br />
dwStyleEx |= TBSTYLE_EX_DRAWDDARROWS; <br />
toolBarCtrl.SetExtendedStyle(dwStyleEx); <br />
toolBarCtrl.SetButtonStructSize();<br />
toolBarCtrl.SetImageList(m_hImageList); return TRUE; }.
|
|
|
|
|
Hi, everyone
It's really urgent for me to learn more about how to create a vertical or docable toolbar with wtl. I'll apprieciate you so much if you give me any advice, even if give me any WTL forum URL, where I may found answers or solutions to my question.
Thanks a lot in advance.
|
|
|
|
|
HWND hWndToolBar = CreateSimpleToolBarCtrl(m_hWnd, IDR_MAINFRAME, FALSE, ATL_SIMPLE_TOOLBAR_PANE_STYLE| CCS_VERT | TBSTYLE_WRAPABLE );
That should get you a vertical toolbar. Or try viksoe.dk ( look for atldock or WTL Docked UI )or even here[^] on CodeProject.
|
|
|
|
|
Hi,
Charles, Thanks a lot for your reply. I tried according to your hint. But didn't get vertical toolbar. And I don't know what's wrong happened.
Can you contribute a sample WTL project which demonstrates the vertical tooblar implementaion.
You may also send it to me by Email to JackLin5168@gmail.com or JackLin5168@yahoo.com .
Thank you so much. Charles.
Jack. China
modified on Monday, May 5, 2008 3:27 AM
|
|
|
|
|
Can anyone help me to resole this problem? I think there must be solution to my question.
|
|
|
|
|
Did you ever solve this problem? I am interested in the solution as well
|
|
|
|
|
Hello,
I have the following code that searches a list of wchar_t * strings.
What I want is a function like this:
vector <wchar_t *="">paths;
find (paths.begin(), paths.end(), L"some string");
What do I need to do to get this to return the string I'm searching for?
- BRC
|
|
|
|
|
This will not return a string but an iterator to the matching string. Your code would look something like this.
bool Comparer : public std::binary_function<wchar_t*, wchar_t*,bool>
{
public:
bool operator()(const wchar_t* s1, const wchar_t* s2) const
{
return (wcscmp(s1, s2) == 0);
}
};
std::vector<wchar_t*> paths;
std::vector<wchar_t*>::const_iterator it;
it = std::find_if(paths.begin(), paths.end(), std::bind2nd(Comparer(), L"some string"));
if (it != paths.end())
{
...
Pax Domini sit semper vobiscum
|
|
|
|
|
Hi,
I am having an issue compiling the ATL/Com dll;
I have Three classes and their interfaces in a com dll as:
1- IMailInterface
2- IMyInterface1
3- IMyInterface2
Now,MFC application uses these interfaces. My application will never directly deal with 2nd and 3rd interface. Everything will be done with the help of IMainInterface. I want to add a method to IMainInterace as
GetMyInterface1(IMyInterface1** ptr); which will retrun the IMyInterface1 pointer
But while comiling getting an error error as:
D:\Work_ganesh\MPlusSrvOpticalDevice\Work In Progress\Ganesh\Samples\DemoCOM\DemoCOM.idl(18):error MIDL2025 : syntax error : expecting a type specification near "IMyInterface1"
D:\Work_ganesh\MPlusSrvOpticalDevice\Work In Progress\Ganesh\Samples\DemoCOM\DemoCOM.idl(18) : error MIDL2026 : cannot recover from earlier syntax errors; aborting compilation
Error executing midl.exe.
I tried adding header file but it didn’t worked.
Thanks.
"A winner is not one who never fails...but the one who never quits"
|
|
|
|
|
Ganesh_T wrote: But while comiling getting an error error as:
D:\Work_ganesh\MPlusSrvOpticalDevice\Work In Progress\Ganesh\Samples\DemoCOM\DemoCOM.idl(18):error MIDL2025 : syntax error : expecting a type specification near "IMyInterface1"
D:\Work_ganesh\MPlusSrvOpticalDevice\Work In Progress\Ganesh\Samples\DemoCOM\DemoCOM.idl(18) : error MIDL2026 : cannot recover from earlier syntax errors; aborting compilation
Error executing midl.exe.
Could you post the actual idl code? That would tell me much more about what went wrong.
Nathan
|
|
|
|
|
Hi,
Can any one give me the details about CoCreateInstanceAsAdmin API.
Thanks & Regards
...swamy
|
|
|
|
|
I thought this[^] explained it pretty well.
--
Kein Mitleid Für Die Mehrheit
|
|
|
|
|
hi All,
My VB Client using ATL COM works fine while running under Debug mode but in the release mode it gets crashed as ATL COM tries to fire event to the VB Client
Here are the Details of what i have developed as ATL COM in C+
I have developed a simple ATL COM in C++ , This ATL Com has a dependency which is a DLL , this DLL sends a notification to the ATL COM by using a registering a function of a ATL as callback , i have used a static function of ATL Object as callback function as we cannot give member function of the class as callback function due to "this" pointer.
Now Dll sends notification to this static function of ATL COM and this ATL COM send the notification further to the COM Client by firing event.
Important to note , since notification is received by static function of ATL class , so i had to use global pointer to the ATL COM in that static function to Fire_Event , as soon as global pointer fires events VB client in release mode gets crashed
Here is the code snippet
CTest_ATL *g_pTestATL; // Glboal Pointer
STDMETHODIMP CTest_ATL::funSubscribe(void)
{
g_pTestATL = this;
m_hDLL = LoadLibrary(TEXT("\\DLL_PlaceCall.dll"));
if(NULL == m_hDLL)
{
return S_FALSE;
}
return S_OK;
}
// This is a callback "static" function which gets registered to the DLL
// As this static callback function gets called i am firing event using
// global pointer to ATL_COM as shown below
int CTest_ATL::EventCallBack()
{
g_CallMonitor->Fire_IncomingCall(CComBSTR("This is a COM Message"));
return S_OK;
}
Any pointers in this issue will be a great help.....
with regards
Abhiraj
|
|
|
|
|
garammasala wrote: My VB Client using ATL COM works fine while running under Debug mode but in the release mode it gets crashed as ATL COM tries to fire event to the VB Client
Do you have any code you depend on inside an ATLASSERT statement? These are removed in release builds. Another possibility is that the optomizer is breaking something. You may want to create a release build with debug information so that you can step through the code the compiler is actually generating for the release build.
Also, unrelated to your problem, it looks to me like g_pTestATL and g_CallMonitor could be static member variables of CTest_ATL.
Nathan
|
|
|
|
|
Hi Nathan
< Also, unrelated to your problem, it looks to me like g_pTestATL and g_CallMonitor could be static member variables of CTest_ATL >
I made a mistake while giving the question i.e "g_CallMonitor" is nothing it is the global pointer "g_pTestATL" which is firing the event from the static function.... replace g_CallMonitor with g_pTestATL
I have found the solution to the problem but was not really able to understand the whole solution , Below is the link
http://vcfaq.mvps.org/com/1.htm
May be you can through some light....
|
|
|
|
|
garammasala wrote: I made a mistake while giving the question i.e "g_CallMonitor" is nothing it is the global pointer "g_pTestATL" which is firing the event from the static function.... replace g_CallMonitor with g_pTestATL
That makes perfect sense.
garammasala wrote: I have found the solution to the problem but was not really able to understand the whole solution , Below is the link
http://vcfaq.mvps.org/com/1.htm[^]
May be you can through some light....
I'm not sure what you don't understand. I assume that you've implemented one of the options and had it work, because otherwise you wouldn't know for sure it was a solution. I've used both the hidden window and the GIT solution, so I may be able to answer any more specific questions you might have about them. In general, using multiple threads well will require lots of studying and lots of practice. There are probably articles on CodeProject that can tell you a lot about it.
Nathan
|
|
|
|
|
yes Nathan
Your are right that i have implemented one of the options and my work was done...
Since ATL COM is very vast so no idea where to start exactly to find the solution for the same ,also the solution given in the link which i gave requires a lot of deep understanding of ATL before the solution provided can be understood, As you have said there are so many articles in the Code project that can tell me a lot better about ATL and basically the solution given in the links...
so will request to point some of those if you can... ?
with regards
Abhiraj
modified on Monday, April 28, 2008 1:38 PM
|
|
|
|
|
Hi,
I’m currently having a problem with getting a WTL project to work. I’m reasonably experienced in C++ native Win32 programming, but I’m very much a novice when it comes to any kind of ActiveX programming.
The situation is this: I trying to write program in Visual Studio 2005 Express using C++ and WTL that is going to interact with another program, eSignal, using an ActiveX API that eSignal provides. I have managed to setup the basics so that I can communicate from my software to eSignal. The problem is that I’m unable to setup an event listener using WTL that manages the events coming from eSignal.
The eSignal developers have provided sample code on how to do this, but it uses MFC. VS2005 Express, which I’m using, has no MFC, so I have to convert their code into WTL, and with my limited experience, I’m unable to do that.
I would greatly appreciate if someone more skilled in WTL and MFC than me, can help me in this matter. I only need to know how to set up an event listener that will process the events coming from eSignal. The rest I should be able to manage. I will provide the MFC sample code below. The part that I’m having problems with is the m_pEvents property of the MainDialog class.
Edit:
Code removed.
I've decided to upgrade to a version of VS that has MFC, so I'll be using MFC instead.
modified on Thursday, April 17, 2008 9:33 PM
|
|
|
|
|
We have a template class as below
template <class T>
class EXP_IMP_CTPERF CTPERFPtr
/*] END Class */
{
public:
// constructors
CTPERFPtr();
CTPERFPtr(const CTPERFPtr<T>& in_CTPERFPtr);
CTPERFPtr(CTPERFObject *in_Object);
CTPERFPtr(const CTPERFPointer& in_Ptr);
// destructor
virtual ~CTPERFPtr();
// assignment operators
const CTPERFPtr<T> &operator=(const CTPERFPtr<T>& in_CTPERFPtr);
const CTPERFPtr<T> &operator=(T *in_Object);
const CTPERFPtr<T> &operator=(const CTPERFPointer &in_Pointer);
// == operator
bool operator==(T *in_Object);
bool operator==(const CTPERFPtr<T>& in_CTPERFPtr);
bool operator==(const CTPERFPointer &in_Pointer);
bool operator!=(T *in_Object);
bool operator!=(const CTPERFPtr<T>& in_CTPERFPtr);
bool operator!=(const CTPERFPointer &in_Pointer);
operator CTPERFPointer&();
operator T*() const;
// returns true if the pointer really points to an object of that class
static bool isClassOf(CTPERFPointer& in_Object);
static bool baseObject(T &in_Pointer);
// to get the object T
T *operator->() const;
T *getPtr() const;
};
Now i have two classes say Base and derived.
class Base {};
class Derived: public Base {};
Now a function gets CTPERFPtr<base /> as one of its input parameter.
void Func(CTPERFPtr<base />& base_in)
{
}
The function call is done like
CTPERFPtr<derived> derive;
Func(derive);
Can somebody explain how this works?
|
|
|
|
|
Explain how what works? The instantiation of derive ? The call to Func ? The declaration of CTPERFPtr<> ?
Please specify more precisely what it is that you are wondering.
--
Time you enjoy wasting is not wasted time - Bertrand Russel
|
|
|
|