|
Maybe you're right, but I'd say WM_ERASEBKGND is the place to go.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I'm looking to have my app monitor another app (Internet Explorer) and respond to any dialogs( warning, error, connection ) that appears so the user doesn't have to. I have started studying up on hooking, but I wanted to see if that is the correct approach.
As a note, my app starts the IE instance that I want to monitor.
Thanks for any help or suggestions.
-Rick
|
|
|
|
|
a better approach for specifically hooking to internet explorer is to use Browser helper object
check
http://www.codeproject.com/system/hooksys.asp
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hi,
I have already posted this message but somebody told me that it's wasn't clear enough.
Here is my problem.
I have a MDI App that contain a dialogbar(modeless dialog). On my dialog, I have a bitmap. I want my bitmap to have transparency on some part of it so that I can see the default color of my App in those part.
In my Mainframe class, I have a variable named m_wndDlgBar from CDialogBar and my dialog is created in the ressource editor.
I tried to use
LoadMappedBitmap(IDB_LOGO, 0, &color, 1)
with
COLORMAP color;
color.from = RGB(0,0,0);//color to be changed
color.to = COLOR_WINDOW;//default color
thanks!
|
|
|
|
|
I found out that the location of a #import statement matters.
Does the location of #includes matter? I have them as shown on rted. Are they in the right place in the .h file? Should they be moved above or below the #if s?
#if !defined(AFX_SEARCHVIEW_H__4E3DD48E_02D6_42F4_88D5_81E8ECCC08B2__INCLUDED_)
#define AFX_SEARCHVIEW_H__4E3DD48E_02D6_42F4_88D5_81E8ECCC08B2__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXEXT_H__
#include <afxext.h>
#endif
<code>#include "mainfrm.h"
#include "childfrm.h"</code>
class CSearchView : public CFormView
Thanks
Appreciate your help,
ns
|
|
|
|
|
In your case, they should be after the #if's
don't put #include in .h files unless absolutly necessary, for example class inheritance, and non-pointer class objects.
#include "BaseClass.h"
#ifndef _SOMEOBJECT_H_
#include "SomeObject.h"
#endif
class MyClass : public BaseClass
{
SomeObject m_SomeObject;
};
the declaration of m_SomeObject could/should be replaced by
#include "BaseClass.h"
class SomeObject;
class MyClass : public BaseClass
{
SomeObject* m_SomeObject;
};
Max.
|
|
|
|
|
Gosh! I thought I was doing something wrong when I would put #includes in the cpp file!!! SO I started putting them in the .h!
So If I have a A.h and a A.cpp pair with a #include B.h in A.cpp, and I go and do a #include A.h in file C.cpp, everything will work out right?
Thanks
Appreciate your help,
ns
|
|
|
|
|
Why should we put our #include's in .cpp files rather than .h files? (I'm a student, not a programming expert)
Blackmesa
Computer engineering student
Étudiant en génie informatique
------------------------------
|
|
|
|
|
To remove the dependencies of objects.
if in class A I have an Object O and is declared directly in the class declaration, I need to have the #include for it in the .h file.
#include "O.h"
class A
{
O m_o;
};
so, everytime that O changes ( the file is changed ) , a.cpp. and every other files that include a.h will be recompiled.
but if I have
class O;
class A
{
O* m_pO;
};
there's no dependencies in the .h file.
For small projects, it's not that important whether you put #include in the .h files, but for large projects, is can be costly.
See Large Scale C++ Software Design[^] by John Lakos, and in particular section 6.1.
Max.
|
|
|
|
|
Alright, I've looked all over the friggin place, and I'm starting to get frustrated.
All I want to do is have a control that contains rendered HTML from local text that I feed it. I won't be loading anything from the web. Just from text strings in memory.
I've tried the CHtmlView, but on creation it seems to have no document in it. After I Navigate2() some page, then I can call GetDocument() and start replacing the internal HTML. But I don't want to have to Navigate2() anywhere.
Am I completely loopy for wanting to do this?
All I need is a simple control that renders HTML from a string input. Any recommendations?
J
May the bear never have cause to eat you.
|
|
|
|
|
If using the CHtmlView, you need to Navigate to "about:blank" first, then wrench around the document. Or, my personal favorite, go to QHTM[^] and use his control.
Joel Lucsy (jjlucsy@concentric.net)
|
|
|
|
|
I'll try that "about:blank". Sounds like that's what I need. And as to wrenching around the document, is that the way to do it?
CHtmlView::GetDocument() -> IDispatch
IDispatch->QueryInterface -> IHtmlDocument3
IHtmlDocument3->documentElement -> IHtmlElement
set IHtmlElement->innerHTML
Seems convoluted.
On the other hand, QHTM looks like it solves my problem quite nicely. It will even let me do my internal navigation without having to host a custom pluggable protocol for IE...
Thanks!
J
May the bear never have cause to eat you.
|
|
|
|
|
No, you don't need to wrench to hard. I have some code that does it, but it boils down to getting the IHTMLDocument2 interface, then calling the Write method. Thats about it. My code has some other useful functions like setting the background color, overriding the opening of new windows, and so forth, but to just display a document thats all you need to do.
Joel Lucsy
|
|
|
|
|
Perfect. I knew there would be an easier way. Of course having to create a safearray for a single string seems a little extreme, but I'll give it a go.
Thanks for your help!
J
May the bear never have cause to eat you.
|
|
|
|
|
|
Yes, QHTM looks quite handy. I'm undecided as of yet whether or not I need the full IE control...
I saw the XHTMLStatic control, but it's too lite for me. I need pretty much full HTML compliance.
J
May the bear never have cause to eat you.
|
|
|
|
|
how can i set a new Registry Key with a binary or a DWORD value? I have set a String Value for a Registry Key. But I could not set for a Binary or DWORD.
Pl. give me an example coding.
vijay
|
|
|
|
|
BYTE Buffer[256] = {1, 2, 3, 4, 5, 6};
LONG nRetVal = ERROR_SUCCESS;
HKEY hKey = 0;
nRetVal = ::RegOpenKeyEx(HKEY_CURRENT_USER, _T("Software\\MyCompanyName"), 0, KEY_ALL_ACCESS, &hKey);
if(nRetVal != ERROR_SUCCESS)
return ::RegSetValueEx(hKey, _T("My Binary Field"), 0, REG_BINARY, Buffer, sizeof(Buffer)/ sizeof(BYTE));
return nRetVal;
|
|
|
|
|
Do you know any function to return if the app is running from a server or from the local machine ??
Thanks,
Cris.
|
|
|
|
|
what kind of application, environment, technology?
In short what info do you have, and what exactly do you want to know?
|
|
|
|
|
Is a Windows MFC Aplication, dialog based. I want to know when the app is running from another machine (server in a LAN) or from a local machine (the app located in the same machine that it is running).
Then, I need to make my app for don't run from a server, only from the local machine. Ok ??
Any idea ??
[]'s
Cris.
|
|
|
|
|
Write a DCOM app for each server you want to check and use the API I indicated yesterday?
|
|
|
|
|
If I understand correctly, you want to know whether the location of the application executable is on a network drive, or a local drive (the app wouldnt 'run' on the other machine, it is just loaded into memory on your local machine)? If this is the case then you can use GetCurrentDirectory function to retrieve the directory which the application is started in, and then GetDriveType to determine if its a network drive
|
|
|
|
|
Ok, anonymous !! This is what I was finding, the GetDriveType function !!
Thank you very much,
Cris.
|
|
|
|
|
OK I have 2 guesses on what you want
1. You want to know where the actual executable is located that is simple use ::GetModuleFileName
2. You assume there is a possibility to run application on a server and have it visible on the client. In a way, it is true. There are multiple technologies that support that
a. DCOM. That designed to be transparent to the client, so you have to investigate registry to find out if it has proxy and couple of difficult functions like CoGetCallContext, CoQueryProxyBlanket and CoGetObjectContext.
c. COM+ (MTS). See COM+ SDK on how to get Application information.
d. RPC. I am not sure, but I think it is possible to intercept use low level APIs
e. Proprietary software that uses sockets, pipes or some other communication means. Well it depends on what they are doing. Usually you need to use provided API
This is why I asked you about the condition you have. In example you gave there is probably no way to run MFC Dialog APP with no COM on the server, so it actually shows on the client.
|
|
|
|