|
TechyMaila wrote: So How do I know which version of ATL and WTL I am using or is present on the System?
Oh, you mean when compiling. Ok, the versions are in the _ATL_VER and _WTL_VER symbols.
Use the MinDependency build targets to staticly link ATL.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
If you use ATL control containment you need "ATL.dll" even if your statically linking.
Steve
|
|
|
|
|
I code this, but no use?
why?
How to add Timer in activex ?
BEGIN_MSG_MAP(ClistSample)
MESSAGE_HANDLER(WM_TIMER, OnTimer)
END_MSG_MAP()
LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
return 0;
}
alantop
|
|
|
|
|
I believe you will need a Window to get timer messages. It doesn't work in window-less controls.
1- You could use the Multimedia timer.
2- Or you could just create a hidden window that would receive the timer messages.
3- Or create a thread that sleeps for the specified amount of time, and calls a function of your program. (quite inaccurate timing).
this is this.
|
|
|
|
|
You need to start the timer.
UINT nMilliseconds = 1000;
::SetTimer(hWnd,ID_TIMER,nMilliseconds,NULL);
when finish stop it with
::KillTimer(hWnd,ID_TIMER);
|
|
|
|
|
hi,
i've a view on which i have some CComboBox, and 1 CComboBoxEx (class extending CComboBox with some cool things).
i'm setting the background color and the text color of the CComboBox by handling WM_CTLCOLOR messages, and here is some code:
LRESULT MyView::onCtlColor(UINT , WPARAM wParam, LPARAM , BOOL& ) {<br />
HDC hDC = (HDC)wParam;<br />
<br />
::SetBkColor(hDC, WinUtil::bgColor);<br />
::SetTextColor(hDC, WinUtil::textColor);<br />
<br />
return (LRESULT)WinUtil::bgBrush;<br />
};
this does color all the controls of my view succesfully, except the CComboBoxEx ! For this control, the background is set on the whole control except behind texts; moreover, the texts don't get colored. Here is my problem, if anyone has some clues, it would be great ! (since Google didn't have any )
|
|
|
|
|
Hi All,
I want to create a button on a HTML page. When I am clicking the button, it should trigger the Browser Helper Object event, and should execute the code written inside the BHO event. BHO events written in VC++ ATL.
Expecting your valuble suggestion.
|
|
|
|
|
Plz. help me for debugging the project.
The error occured is:
"Error while trying to run project:Unable to start debugging on the web serever side error on sending debug HTTP request."
Reply me.
ok
|
|
|
|
|
I am using a tab control, into which I am inserting a dialog which contains several subclassed edit controls. If I press the tab key from one of the edit controls, the focus is set to the tab control, and not the next edit control.
Any ideas?
Thanks in advance
|
|
|
|
|
if not, how to use thread in the activex ?
alantop
|
|
|
|
|
AfxBeginThread is an MFC function. If you're using MFC then you can use this; if not use beginthread or beginthreadex (CRT) or CreateThread (Win32). Unless you know what you're doing prefer the CRT functions.
Steve
|
|
|
|
|
The CRT functions are required if you're going use the CRT library (these functions initializes the CRT for each new thread). A fact which I was not aware until recently.
--
100% natural. No superstitious additives.
|
|
|
|
|
Me too! I discovered that only this week and I now use _beginthreadex exclusively. If you use CRT (especially date/time) functions in a thread, then without _beginthread[ex] you will leak memory - OK, not a lot, but a leak is still a leak.
|
|
|
|
|
Hi,
I'm having trouble firing an event. I have class derived from IDispEventImpl to advise for multiple object sources. This is fine, however, I'm trying to Fire_XXX() event from this class, but the method is declared in CProxy_IXXXEvents class. Any ideas how I can do this. Here is code snippet.
"..\COMServer.tlb" //receive events from other object
class ATL_NO_VTABLE CServer :
public CComObjectRootEx<ccomsinglethreadmodel>,
public CComCoClass<cserver, &clsid_server="">,
public IConnectionPointContainerImpl<cserver>,
public IDispatchImpl<iserver, &iid_iserver,
&libid_serverib="">,
public CProxy_IServerShellEvents< CServerShell >
{
};
//Sink Class
class CSinkServerEvents :
public IDispEventImpl<0, CSinkServerEvents, &DIID__ICOMServerEvents, &LIBID_COMSERVERLib, 1, 0>
{
BEGIN_SINK_MAP(CSinkServerOEvents)
SINK_ENTRY_EX(0, DIID__ICOMServerEvents, 0x01, Calculate)
END_SINK_MAP()
HRESULT __stdcall Calculate(short value)
{
Fire_OnXXX(value);
return S_OK;
}
};
//This Class I'm trying to access this class method from the EventSink Class.
template <class t="">
class CProxy_IServerShellEvents : public IConnectionPointImpl<t, &diid__iserverevents,="" ccomdynamicunkarray="">
{
public:
HRESULT Fire_OnXXX(short value)
{
...
}
};
Thanks
|
|
|
|
|
I have created simple login password atl com component and added to html or it gives that html. control has a button on clicking which it checks in database
if username and passowrd is valid it enters the relevant info in database
and also displays message box that login is successful or else. I want
that if login is successful it must go to next page. how it is possible?
Either my control must fire some event (window event) which I can catch in html but
It seems to very complicated task as I must have to have handle of html window and lot more. Simplest is html must check in database that login is successful or not ,if yes go to next page.Can any body let me know how to access database through html or redirect me to some reference.
|| ART OF LIVING ||
|
|
|
|
|
How uses ATL to establish to have the doc/view style ActiveX control. Best, may provide an example.
I want to establish treectl in the left side, right side establishes listctl. A little likes the windows explorer.
alantop
|
|
|
|
|
How access Safearray to be quicker in ATL?
alantop
|
|
|
|
|
|
But, I didn't find a quicker accees the method.
alantop
|
|
|
|
|
well i am hello world newbie in aTL.I am using VS.net 2003 for practise.I am wondering why so many imports are required for a hello world type of program.These are generated from ATL wizard.
import "C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\prsht.idl";<br />
import "C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\mshtml.idl";<br />
import "c:\program files\microsoft visual studio .net 2003\vc7\platformsdk\include\dimm.idl";<br />
import "C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\mshtmhst.idl";<br />
import "c:\program files\microsoft visual studio .net 2003\vc7\platformsdk\include\docobj.idl";<br />
import "C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\exdisp.idl";<br />
import "C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\include\objsafe.idl";
|
|
|
|
|
I am trying to add WTL support to the WinAPI DLL project.
I was write in the stdafx.h:
#include <windows.h>
// C RunTime Header Files
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#include <atlbase.h>
#include <atlapp.h>
extern CAppModule _Module;
#include <atlwin.h>
#include <atlgdi.h>
#include <atlmisc.h>
Compiler messages was:
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1149) : warning C4005: 'BIGENDIAN' : macro redefinition
c:\MyProjects\TQPS\402Headers_Libs\Win\XTPLAT40.H(148) : see previous definition of 'BIGENDIAN'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlcore.h(246) : warning C4002: too many actual parameters for macro 'LoadResource'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlcore.h(246) : error C2589: '(' : illegal token on right side of '::'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlcore.h(246) : error C2059: syntax error : '::'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\MsXml.h(1932) : error C2059: syntax error : '('
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\MsXml.h(1933) : error C2238: unexpected token(s) preceding ';'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\PropIdl.h(915) : warning C4002: too many actual parameters for macro 'Create'
and so on... There was 75 errors. That is the problem? The same includes in a blank WinAPI project are working well.
Could anyone help me?
|
|
|
|
|
Hello dandy_andy!
You have make like this:
CAppModule _Module;
BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
{
HRESULT hRes = ::CoInitialize(NULL);
ATLASSERT(SUCCEEDED(hRes));
hRes = _Module.Init(NULL, (HINSTANCE)hModule);
ATLASSERT(SUCCEEDED(hRes));
}
break;
case DLL_PROCESS_DETACH:
{
_Module.Term();
::CoUninitialize();
}
break;
}
return TRUE;
}
PM
|
|
|
|
|
Hi,
I'm pretty new in programming in c++.net, and I was wondering if someone could help me out.
The goal is to control Abobe Acrobat so that it displays a pdf file in my own c++.NET application. I have found an example in the Acrobat SDK called ActiveView which is exactly what I want to achieve, but I have really no idea how it works.
Can anybody give me an explination of how it works, or how to make a start?
thanx!
Bas
|
|
|
|
|
|
Hi,
I developing a component using ATL. This component is suppose to generate events. The wizard generated the Proxy Class implementation of Events (CProxy_xxx).
I am trying to Fire an event using this class implementation.
But I am recieving 0x8002802B ( -2147319765 ) TYPE_E_ELEMENTNOTFOUND error.
I am passing two parameters which are of type IDispatch*
The client used is VBScript.
Does someone here has any idea about what possibly would have gone wrong?
Thanks for looking into this.
S o h a i l K a d i w a l a
modified 21-Apr-21 21:01pm.
|
|
|
|