|
Lemme rephrase the question
Is it possible to add/embedd CDHtmlDialog inside a Win32 DLL?
|
|
|
|
|
How many times do you plan to repeat this question? Yes it's possible, but you are the one who is going to have to write the code to make it happen.
Veni, vidi, abiit domum
|
|
|
|
|
Don Guy wrote: I want to develop a DLL that has a web browser embedded in it. ...then load this
DLL into a web browser like IE, Chrome or Firefox.
So you have a web browser (doesn't matter whether you create it or not) and then run it in a web browser.
Why?
The question is similar to asking if one would want to run Chrome inside of Firefox.
Don Guy wrote: Is this possible to do?
It is possible to create a web browser in a dll. To create a functioning browser then one would simply use the dll in the exe and call probably one method.
That said a web browser is a user tool and a client side tool. I doubt there is any need to have a browser that one can embed and moreover it would likely irritate users because a non-trivial number of them are really attached to the browser they use.
Standard browsers can run executable content if the users allow that. The executable content can be anything, so it could certainly start a browser.
But excluding attempts to circumvent security and attempt to hack information from users I can't see any point to this.
|
|
|
|
|
I am unable to set focus to CProperyPage CEdit control using OnSetActive:
BOOL C_CommPropertyPage2::OnSetActive()
{
CEdit* pBoxOne;
pBoxOne = (CEdit*) GetDlgItem(IDC_EDIT1);
pBoxOne->SetFocus();
return CPropertyPage::OnSetActive(); // added
}
I am able to TAB to the controls and I have tried both value and control without success.
Any help would be appreciated.
Cheers Vaclav
Here is a workaround.
I initially fill the edit boxes with default values. When I reset them, in my case to empty text, I can set focus using the above code. I can live with that.
-- modified 17-Sep-13 13:34pm.
|
|
|
|
|
Have you tried putting
return CPropertyPage::OnSetActive();
as the last line in the handler?
|
|
|
|
|
Yes, sorry I did not included it in the snippet.
|
|
|
|
|
Is the edit control the first control on that tab (that the user can interact with)?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Yes, but it fails to set focus to any. I currently have four.
|
|
|
|
|
Vaclav_Sal wrote: Yes... So the z-order is set correctly?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
I can TAB thru all four edit boxes in sequence, in circular fashion. If that is what you are asking.
|
|
|
|
|
How can I write Outlook addin which support all versions of Outlook?
|
|
|
|
|
|
i can lock a thread, but how about single function?
int Func(int par)
just want to lock it so other function do not call it until it finish, is that possible?
|
|
|
|
|
What do you mean by "lock a function"? By definition you can only lock it if it is running in a separate thread.
Veni, vidi, abiit domum
|
|
|
|
|
|
If you want something inside the function protected from parallel/recursive calls, you can do that by placing a criitical section and a class member variable inside it. If don't want the function to be called at all, you could make it private and add a public function as the only one that calls it. It could look something like that:
void somePublicFunc()
{
EnterCriticalSection(); try
{
if (!alreadyRunning) {
alreadyRunning = true;
privateFunction();
alreadyRunning = false;
}
}
catch (...)
{
alreadyRunning = false; LeaveCriticalSection(); throw; }
LeaveCriticalSection();
}
So privateFunction() will only be called once at a time no matter from which thread (provided you don't add another member function that calls it or introduce any friend classes).
The good thing about pessimism is, that you are always either right or pleasently surprised.
|
|
|
|
|
Not bad but in C++ you should use RAII for this, use the destructor of an auto (stack) object as your finally block.
class CAutoLock
{
public:
CAutoLock(CRITICAL_SECTION& cs)
: m_CS(cs)
{
EnterCriticalSection(&cs);
}
~CAutoLock()
{
LeaveCriticalSection(&m_CS);
}
private:
CRITICAL_SECTION& m_CS;
};
void func()
{
CAutoLock auto_lock(cs);
{
CAutoLock auto_lock2(cs2);
}
}
|
|
|
|
|
Parameter names are commented out in the method signature, as in:
void OnUpdate(CView* , LPARAM , CObject* )
I know that optional parameters would be given as:
void OnUpdate(CView* pSender = 0, LPARAM lHint = 0, CObject* pHint = 0)
So what does the first one mean?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
It means that you're not using them. You can still read the parameter names in the comments, but the compiler won't issue any warnings about unreferenced parameters.
|
|
|
|
|
Oh! Thank you.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Hi all,
I released an article over the weekend (Don't mess up your #defines[^]).
I received a negetive feedback from a guy from germany:
Quote: For one, this article promotes 80's #define's as if they're still a valuable solution (hint: a global const variable can do the same and is always the better option).
Also the later suggestion is not only obvious (use member variables, duh!), but actually needlessly complicates things: you can name structs just like classes without typedef's, and if you really need a global structure for these things, use templates! How can code with #define's and typedef's be called "Optimized for C++11", when it looks more like C72?
Now I am wondering: Is the article that bad? Is he mentioning valid points ( I got him with the "use templates", but I am still not sure whether I can trust him or not - After all, his profile says "Web developer").
Since I want to provide quality articles to the community I'd also want a feedback on what I could improve with the article to make it more valuable and up-to-date.
Thanks for any help
- PP
You know the world is going crazy when the best rapper is a white guy, the best golfer is a black guy, the tallest guy in the NBA is Chinese, the Swiss hold the America's Cup, France is accusing the U.S. of arrogance, Germany doesn't want to go to war, and the three most powerful men in America are named "Bush", "Dick", and "Colon."
|
|
|
|
|
I've just taken a quick look at your article but I agree with the guy. To me it seems that you are a C programmer who is quite new in C++. Defines should be avoided whenever possible. In a lot of cases defines can be replaced with template/inline functions. In some other cases long macros can be replaced to a combination of a short macro + template/inline functions/classes. Macros don't respect name spaces and they arent type safe. Still, some small stupid problems can be solved practically only with macros (for example automatically logging out filename/linenumber/functionname can be done only with a logger macro). But even when you are using a macro its better to keep the body of the macro short by immediately calling a function or intantiating/using a class. Using typedef on structs in C++ is awkward and using header guards is also deprecated in my opinion, in a large project you got a very strange error message with a duplicate (for example copy-pasted) header guard and today all major compilers support "#pragma once".
|
|
|
|
|
This is really not the place for this type of message. Your article showed up in the latest Newsletter, so those who are interested will go and look at it.
Veni, vidi, abiit domum
|
|
|
|
|
I had not come across the word psychopomp before, until you started posting in the forums recently. And last night I saw it a second time while reading a short story; strange coincidence.
Veni, vidi, abiit domum
|
|
|
|
|
Yes and no. Considering how often he changes his name, something like that had to happen sooner or later.
Soren Madsen
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|