|
IE notifies you when you can and can't go back/forward. Intercept the OnCommandStateChange event (DISPID_COMMANDSTATECHANGE):
void __stdcall CWebBrowserWindow::OnCommandStateChange(
long Command, VARIANT_BOOL Enable )
{
switch( Command )
{
case CSC_NAVIGATEFORWARD:
m_bCanGoForward = ( Enable == VARIANT_TRUE ) ? true : false;
break;
case CSC_NAVIGATEBACK:
m_bCanGoBack = ( Enable == VARIANT_TRUE ) ? true : false;
break;
default:
break;
}
}
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
Where shall I implement this function? In my main application? If in my main application, how do I tell IE to use this callback function?
Thanks for your help!
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
I can tell you exactly how to do this if you are using ATL/WTL but I haven't got the code available for an MFC implementation. Basically what you have to do is to register with the web browser control that you want to receive events from it and then intercept the messages you want. In MFC you would probably use the BEGIN_EVENTSINK_MAP macro just to give you a hint.
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
Unfortunately I am using MFC without ATL/WTL.
I will try the BEGIN_EVENTSINK_MAP macro.
Thank you very much for your help!
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
I am trying to incorporate GDI+ drawing functions in my APP. I have seen that when doing so the print preview is
reduced to a ridiculuous size, while the printing action
remains OK.
Is there a way to solve this problem ?
thanks
jac.
|
|
|
|
|
Hi.
I'm creating a simple server-client application.
The client should listen for commands from the server, eg the server sends a shutdown command to the client, and then the client will shutdown windows.
But i'm not certan how to shutdown windows? is there any functions or anything like that?
Also, I'm in need of a way to turn of the monitor when a certan command has been send from the server to the client, but i'm not sure what to look at.
Thanks for any help I could get;P.
|
|
|
|
|
You can exit windows with ExitWindowsEx()
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi !!
There is a AllocSysString member in CString class. I want to give the same functionality to the string represented by std::string. Is it possible ???
|
|
|
|
|
AllocSysString is used for BSTR's so
just off the top of my head...
#include <comdef.h>
class MyString {
public:
std::string& get() {
return m_str;
}
operator BSTR () {
_bstr_t tmp;
tmp = m_str.c_str();
return tmp.copy();
}
protected:
std::string m_str;
};
this is pretty crude, but may give you some ideas...
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
|
|
|
|
|
Thanks for your response. Can you please also tell me that how can i use the operator BSTR of your class. Example if i have string
std::string strName = "Jim";
BSTR bstrName;
Now please tell me how i use your class to copy my std::string in BSTR.
Thanks.
|
|
|
|
|
std::string strName = "Jim";
BSTR bstrName;
MyString s;
s.get() = strName;
bstrName = s;
Thats it. But before you go using it, you should definitely read up on C++ operator overloads and conversion operators. COnversion operators are what allow you to do what we did above in the line:
bstrName = s;
Basically the compiler sees you have a conversion operator for the type of the assignment (in our case a BSTR) and then calls it for you.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
|
|
|
|
|
Hi,
I have a Application which uses a user-defined Dll.This Dll has many String constants defined in DLL resource string table.My problem is that I want to use that StringConstants ID defined in Dll in the main application..
So any idea ....how to do it.
cheers,
Super
------------------------------------------
Too much of good is bad,mix some evil in it
|
|
|
|
|
The first parameter to LoadString() is the instance handle of the resource DLL. For example:
HINSTANCE hInstance;
TCHAR szBuffer[128];
hInstance = LoadLibrary(_T("MyResourceLib.dll"));
LoadString(hInstance, ID_MSG_SOMESTRING, szBuffer, sizeof(szBuffer));
|
|
|
|
|
Hi professionals!
Where can I download DirectX 8.1 debug symbols of Visual C++ 6(SP5)?
John Seo(seojt@kogsoft.com)
|
|
|
|
|
Is it possible to download the DDK for Windows 2000 (Driver Development Kit)
from somewhere?
Microsoft distributes it on CD.
I could not find a link for downloading.
Thank you in advance,
seval
|
|
|
|
|
|
Hello,
I use "CreatePopupMenu()" to display a menu with right mouse click on a button.
This is an "ownerdraw" menu, so I draw bitmaps and I write text into each line.
My problem is there are too many lines to display. So I would like to add a vertical scrollbar into the popup menu.
|
|
|
|
|
Hi, I need my CListView derived class to have its horizontal scroll bar always visible (sometimes, of course, disabled). I tried following code:
BOOL CFileView1::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
__DWORD newStyle = dwStyle | WS_VSCROLL;
__return CWnd::Create(lpszClassName, lpszWindowName, newStyle, rect, pParentWnd, nID, pContext);
}
but with no effect...
Will somebody help me?
Standa.
|
|
|
|
|
Hi Standa,
DWORD newStyle = dwStyle | WS_VSCROLL | LBS_DISABLENOSCROLL;
return CWnd::Create(lpszClassName, lpszWindowName, newStyle, rect, pParentWnd, nID, pContext);
May help you.
Best of luck
KVRN Kiran Kumar.
|
|
|
|
|
CFileFind won't help you much there. You will have to look into clipboard formats, specially CF_HDROP. Check out this MSDN article[^] for example.
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
Hi, everyone!
I have only noticed that reference variable are used as
parameter of a function before (or return value). For
example,
Source Code:
--------
function (const T& t)
--------
But today when reading the source code of some other's
today. I noticed that a local variable is declared as
reference type. Before I only noticed that lcoal variable
are used as pointer to origin type and origin type.
Source Code:
--------
T *pt;
T t;
--------
But now I noticed that a variable is declard like this in a
function,
Source Code:
--------
T t1;
T & t2 = t1;
--------
I want to know if a reference is used as a local variable, are there
any special things to notice? Or simply just the same as the reference
variable of a function parameter?
Thanks in advance,
George
|
|
|
|
|
In the second way of usage, references are merely a convenient way to designate other variables much the same way as pointers do, but without the -> mess. You only have to keep in mind a subtle but important difference between references and pointers. Consider the following:
T t1;
T t1b;
T * pt2=&t1;
pt2=&t1b; The same cannot be done with references:
T t1;
T t1b;
T & t2=t1;
t2=t1b; The last sentence does not make t2 "point" to t1b : instead, it copies t1b into t1 , exactly as if you had wrote
t1=t1b; In C++ jargon, this fact is commonly expressed as references do not rebind. Keep it in mind and be happy.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks, Joaquín buddy!
George
|
|
|
|
|
Hi ppl
well my problem is with explicit linking here.Actually there is this function called "SetLayeredWindowAttributes" that i want to link explicitly following is the code:
typedef BOOL (CALLBACK*LPFNSETLAYEREDWINDOWATTRIBUTES)(COLORREF,BYTE,DWORD);
...
BOOL CMainFrame ::TranparentWindow()
{
HINSTANCE hDLL; // Handle to DLL
LPFNSETLAYEREDWINDOWATTRIBUTES lpfnSetLayeredWindowAttributes; // Function pointer
COLORREF color = RGB(100,100,100);
BYTE alpha;
DWORD what;
hDLL = LoadLibrary(_T("USER32.DLL"));
if (hDLL != NULL)
{
lpfnSetLayeredWindowAttributes = (LPFNSETLAYEREDWINDOWATTRIBUTES)GetProcAddress(hDLL,"SetLayeredWindowAttributes");
if (!lpfnSetLayeredWindowAttributes)
{
// handle the error
FreeLibrary(hDLL);
return FALSE;
}
else
{
// call the function
BOOL status;
status = lpfnSetLayeredWindowAttributes(color,alpha,what);
}
}
}
I am calling this function on the OnCreate message handler there are no linker problems as well when the program is executed it give me an error regarding ESP tellimg me something about conflicting calling conventions anyone having any idea wats the problem here please do tell me
Thanks in advance
Ahmed Ajmal
|
|
|
|
|
Seems you're missing the first parameter (an HWND ).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|