|
Thanks bob, I shall look into them.
From a lengthy search around the net, I came upon a comment from an MVP, which said, "...get the view image via IViewObject and use the view change notification. It seems you are supposed to derive a class from
CAxWindow and implement IAdviseSink's methods (it already derives from IAdviseSink)."
This seems a relatively straight forward approach in theory, but I wasn't aware that CAxWindow is derived from IAdviceSink, or at least it doesn't seem so from looking at CAxWindow's implementation in AtlWin.h. Does this sound feasible to you? I would appreciate a little guidance to appreciate this method if true.
Many thanks,
Andy
|
|
|
|
|
I think I misunderstood your situation. I was assuming that you were also creating the controls you were hosting. Now I'm thinking your refering to hosting someone elses ActiveX controls and wanting to have them draw into a memDC. Correct me if I'm off track.
I don't use ATL so I won't be much help with the CAxWindow stuff.
I have used IViewObject to get the control to draw to a MemDC and I based my approach off of Andrew Wirger's article[^]. Have a look in the IViewObject section of the article if you haven't already found it.
Your approach sounds reasonable but again, I have little experience with ATL.
|
|
|
|
|
hi all
i had implemented the key board hooks the capture the key strokes but it work for only the current appplication not for all application(application from which these are executed).
when i switch windows of application then it did not work and i had to call the setwindows hook functin once again, is it due to the AfxGetapphandle() or why these are not working here is the code.
it is setting window hook
HINSTANCE hInstance;
hInstance=AfxGetInstanceHandle();
hHook = SetWindowsHookEx(WH_KEYBOARD, KeyboardProc,hInstance, 0);
}
it is call back function
LRESULT CALLBACK KeyboardProc(int nCode,WPARAM wParam,LPARAM lParam)
{
if (nCode<0)
{
return (CallNextHookEx(hHook,nCode,wParam,lParam));
}
else if (((DWORD)lParam & 0x40000000) &&(HC_ACTION==nCode))
{
KeyLoggerMain(wParam);//show which key is pressed
}
LRESULT RetVal = CallNextHookEx(hHook,nCode,wParam,lParam);
return RetVal;
}
it function working is same as i found from the MSDN.
Tasleem Arif
|
|
|
|
|
tasleem143 wrote: HINSTANCE hInstance;
hInstance=AfxGetInstanceHandle();
i think the problem is with the instance u taking.
try the following way
create a global vaibale of HINSTANCE.
initialize this variable with the hinstance passed in the DllMain().
pass this hinstance in the SetWindowsHookEx()...
or if ur using MFC dll initialize the hinstance as shown below
BOOL CDllApp::InitInstance()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
hins = AfxGetInstanceHandle();
return CWinApp::InitInstance();
}
nave
|
|
|
|
|
i was not implementing it in the form DLL its in the form of application MFC APP wizard(exe). i think dats why problem was comming i had tried to pass null in the place of hinstace but it did not work look i had to implement it in the form of DLL now.
Tasleem Arif
|
|
|
|
|
yaaaa.
u must implement the hook function in the dll for making it global.
nave
|
|
|
|
|
Hi,
Is there any function to find whether the entered string in an edit control is a number or not.
Thanks in advance.
Sandhya
|
|
|
|
|
I use strtod() , strtoi64() , strtoui64() , strtol() , or strtoul() . Check the value of the end pointer (second parameter) to make sure it is NULL , and check the return value and errno for possible error codes.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
You can set ES_NUMBER for your edit control
|
|
|
|
|
Hi to all
i made an application in which VC++ as front end and MySQL as back end and in case of linking form to backend
an linking error is generated that libmysql.lib not found
can any one tell me where i am lacking and how i remove this error
Yogi
mailing me
Yogi
|
|
|
|
|
do u have the libmysql.lib in ur system?Just search....
if u find it, copy the path and put it in
project->Setting->Link
in the category combo box select "Input"
now in the Additional library path, paste the path of the lib("libmysql.lib")
then try building...
nave
|
|
|
|
|
Are you sure you have this file in your system?
|
|
|
|
|
Hi there,
I've taken Microsoft's example MIME filter (mimeflt.exe on MSDN) and
made a quick change to register it as a text/html MIME filter as opposed
to text/xml.
As a test for some future functionality I plan on putting in, I return
INET_E_USE_DEFAULT_PROTOCOLHANDLER right at the beginning of
my Start() method.
For some reason, when the browser starts up for the first time, it STILL
calls my ReportData() method, then my Read() method, etc.
When I navigate to subsequent websites, it successfully uses the
default protocol handler, and it is no longer calling any of my methods
as I would expect.
Any idea why it's not respecting INET_E_USE_DEFAULT_PROTOCOLHANDLER
when it hits the first web page in a session?
Here's the code for my start method:
STDMETHODIMP CXMLMimeFilterPP::Start(
LPCWSTR szUrl,
IInternetProtocolSink *pIProtSink,
IInternetBindInfo *pIBindInfo,
DWORD grfSTI,
DWORD dwReserved)
{
return INET_E_USE_DEFAULT_PROTOCOLHANDLER;
USES_CONVERSION;
ATLTRACE(_T("Start - url=%s, sti=%x\n"),OLE2T((LPWSTR)szUrl), grfSTI);
HRESULT hr = E_FAIL;
m_grfSTI = grfSTI;
m_bIncomingIsUnicode = false;
m_bSplitUniWord = false;
if (!(grfSTI & PI_FILTER_MODE))
{
hr = E_INVALIDARG;
}
else
{
// get the protocol pointer from reserved pointer
PROTOCOLFILTERDATA* ProtFiltData = (PROTOCOLFILTERDATA*) dwReserved;
_ASSERTE(NULL == m_pIncomingProt);
if (NULL == ProtFiltData->pProtocol)
{
// !! We can't do anything without an interface to read from
_ASSERTE(false);
return E_INVALIDARG;
}
m_pIncomingProt = ProtFiltData->pProtocol;
m_pIncomingProt->AddRef();
// hold onto the sink as well
_ASSERTE(NULL == m_pOutgoingProtSink);
m_pOutgoingProtSink = pIProtSink;
m_pOutgoingProtSink->AddRef();
m_bFirstRead = true;
m_pHTMLBuffer = new CStringDataBuffer(2048);
hr = S_OK;
}
return hr;
}
Thank you very much in advance!!!
-Kevin
|
|
|
|
|
Does anyone know of any links to good tutorials on making ActiveX controls using MFC in VS 2005?
|
|
|
|
|
I got this from a Google search using your question header
http://www.codeguru.com/Cpp/COMTech/activex/controls/article.php/c5517
John P.
|
|
|
|
|
already saw that tutorial, but it looks like it's from VC6. Stuff seems to be a lot different in VS2005.
|
|
|
|
|
|
Hi,
How do u prevent a user from reading a file / Opening a Directory in windows.
I want All the files / Directories to be locked
Luck is Opportunity with hardwork
|
|
|
|
|
What do you mean by "locked?" You can open a file exclusively that would prevent others from opening it. Or you could change the permissions of the file/folder such that only certain users/groups can access it.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Ok,I will be in brief..
If a user tries to access a file in windows A request is sent to the Server machine and a messagebox pops up indicating the a user is trying to access a file in the client....The admin in the server allows or denies access to a file ..Suppose if the admin denies access a control message is sent to the client..And The user gets a message that "The File cannot be viewed B'coz you are denied access" and if he permits the file Opens in the Client Machine.
I have a service running in the Client and another in the Server ...
-- modified at 17:37 Friday 11th August, 2006
Luck is Opportunity with hardwork
|
|
|
|
|
I have an application that uses two monitors, either side-by-side, or one over top of the other. Right now, my AfxMessageBox appears in each half of the two screens --- not very clean to the user. Is there a way to move the message box to a new x/y location or would it be simpler to create a new dialog of my own and reposition that one to where I'd like it to go?
Many thanks to all of you who answer these questions. You are a tremendous repository of knowledge for those of us less skilled.
John P.
|
|
|
|
|
Since MoveWindow requires a handle to the window and the AfxMessageBox is esstentially a modal dialog, I do not think that you are able to move the messagebox. So, AFAIK the easiest thing to do would be to create your own dialog and do whatever you want with it.
|
|
|
|
|
I believe you are correct. I searched throught the MFC documentation and saw NOTHING on moving the AfxMessageBox or the MessageBox. But then, MS doesn't always document EVERYTHING you need to know
Thanks for your help
John P.
|
|
|
|
|
I worked in an operation that used 2-3 video cards and the software that came with the cards that integrates with the video options had configuration options to make popups appear in various locations to prevent it from popping up cut in 2 pieces like on a 2 monitor system.
Does your card's software have these settings?
|
|
|
|
|
Good question --- now if only I could find the ICD!
Not much documentation around on this one.
Thanks for the tip, though.
John P.
|
|
|
|