|
Hi,
I'm new to Win32 programming, and I have to add dialog resource and management in a static lib in order to be used by other application.
I've added dialog resource in lib project and include all ATL stuff inside lib.
Everything compile ok but ATL create dialog function failed with 1812 error, complaining that no resource are present in exe image.
The base application is a classic win32 project without MFC.
What should I check ?
Thanks
Fabrice
|
|
|
|
|
The tab key doesnt work in Web Browser Control. The following code is supposed to resolve it. However the keydown message is not fired at all. There is another code below this one which is supposed to resolve even this problem but I dont know where to place it.
Code 1:
LRESULT CMyClass::OnKeydown(UINT uMsg, WPARAM wParam, LPARAM lParam,
BOOL& bHandled)
{
// m_spWebBrowser is a data member of type IWebBrowser2.
// Using CComQIPtr in this way queries m_spWebBrowser
// for the IOleInPlaceActiveObject interface which is
// then stored in the pIOIPAO variable.
//
CComQIPtr<ioleinplaceactiveobject,
&iid_ioleinplaceactiveobject=""> pIOIPAO(m_spWebBrowser);
HRESULT hr = S_FALSE;
if (pIOIPAO)
{
MSG msg;
msg.message = uMsg;
msg.wParam = wParam;
msg.lParam = lParam;
hr = pIOIPAO->TranslateAccelerator(&msg);
}
return hr;
Code 2:
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
// Send all keyboard messages to the window of your
// application. hwndApp is the window handle of
// your application.
//
if (msg.message >= WM_KEYFIRST && msg.message <= WM_KEYLAST)
::SendMessage(hwndApp, msg.message, msg.wParam, msg.lParam);
DispatchMessage(&msg);
}
Harshapaul
|
|
|
|
|
hi, i'm currently working on a bho that works tight with image....
as event disp intercepter...i found we need to connect to DIID_DWebBrowserEvents2 in order to intercept event handler under it, but where can i connect to in order to intercept event handler fired by an image events??
thx a lot
|
|
|
|
|
Send me your email address , i will send you dummy BHO Source code that handle DOCUMENTCOMPLETE event.
hope you can modify the rest!!!
"I Think this Will Help"
[Vote One Here,.....]
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
already send a msg to ur email.....
really appreciate for ur help....thx a lot....
|
|
|
|
|
|
hmmmh, this article work wif onclick event, for element which created by the system itself...tat's wad i understand from the coding....correct me if i'm wrong....=.="
but in my case, i would like to intercept from any webpage browsed....e.g. in DWebBrowserEvents2, a dispid DISP_NAVIGATECOMPLETE2 is used to intercept the IE's control whenever the browser finish navigate certain page...
as for my page, i would like the user to click any image from any website, intercept the control and get the image's PIDL for my bho usage.....using this interface IHTMLImgEvents2 http://msdn.microsoft.com/workshop/browser/mshtml/reference/events/htmlimgevents2/htmlimgevents2.asp
again, correct me if i'm wrong in any of these understanding
ur help is appreciated so much
|
|
|
|
|
I'm trying to extend a CEdit ctrl in WTL. But i havn't found out how to paint in the control after the default paint mechanism.
Is there a way to invoke the default paint mechanism while handling WM_PAINT, something like CEdit::OnPaint(...)?
|
|
|
|
|
|
This is simplified version of what I am doing but still shows the issue : The Copy Ctor is being called by the for_each algorithm. Whilst in this case it isn't an issue, but in my live app it is. Why is the copy ctor being called and can I prevent it..?
class ProcessVector
{
public:
ProcessVector(const ProcessVector &rhs)
{
cout << "copy ctor" << endl;
}
ProcessVector()
{
cout << "ctor" << endl;
}
~ProcessVector()
{
cout << "dtor" << endl;
}
void operator ()(int i)
{
cout << i << endl;
}
};
int main(int argc, char* argv[])
{
std::vector <int> test;
for (int i = 0 ; i< 5; i++)
test.push_back(i);
for_each(test.begin(), test.end() , ProcessVector() );
return 0;
} gives the following output
ctor
0
1
2
3
4
copy ctor
dtor
dtor Regards
Angel
*********************************************
The sooner you fall behind, the longer you have to catch up.
|
|
|
|
|
It's by design - the C++ Standard specifies that the function object is passed by value, not by reference and that a *copy* of the function object is returned by for_each . You'll have to work round whatever problems this causes you.
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
Easy, add an extra level of redirection to manage the lifetime. This issue is described as Stateful Predicates in the book Exceptional C++
#include <algorithm>
#include <vector>
#include <iostream>
using namespace std;
class ProcessVector
{
public:
ProcessVector()
{
cout << "ctor" << endl;
}
~ProcessVector()
{
cout << "dtor" << endl;
}
void operator ()(int i)
{
cout << i << endl;
}
ProcessVector(const ProcessVector &rhs)
{
cout << "copy ctor" << endl;
}
};
class ProcessVectorIndirect
{
public:
ProcessVectorIndirect(ProcessVector* process)
: pProcess(process)
{
}
void operator ()(int i)
{
(*pProcess)(i);
}
private:
ProcessVector* pProcess;
};
int main(int argc, char* argv[])
{
std::vector <int> test;
for (int i = 0 ; i< 5; i++)
test.push_back(i);
ProcessVector vect;
for_each(test.begin(), test.end() , ProcessVectorIndirect(&vect) );
return 0;
}
|
|
|
|
|
Hi,
I want two atl controls to communicate with each other. what area of COM / ATL should i be looking into. Connection points or something?
I want the second control to list the first control in a datasource property.
Thanks
Gary
|
|
|
|
|
hi,
I tried to catch an event in vb script which is fired from a com object. It works in vb but not in vbscript!
interface just like this
dispinterface _INotiEvents
{
properties:
methods:
[id(2), helpstring("method Notify")] HRESULT Notify();
};
script:
Sub objInstance_Notify
alert ( "Event" )
End Sub
Something I have to care about, so that vbscript is able to catch the event?
thx and greets
|
|
|
|
|
Did you use "source" attribude in IDL when were declaring the coclass?
My site - Body Jewelry
|
|
|
|
|
yes it looks like this:
coclass Noti
{
[default] interface INoti;
[default, source] dispinterface _INotiEvents;
}
somewhere a sample where events are catched in script?
thx
|
|
|
|
|
Hello People,
I'm trying to design some kind of windows form app. which I can also use as a plug-in in IE. just like Acrobat reader for instance. I'm a total newbie and I don't even know in which direction to think, so every comment is welcome.
Thanks
|
|
|
|
|
Hi,
I'm trying to load from a resource or file a bitmap, 16x16 and display it in my ATL control. so far i have been unsuccessfull. this is the code i have used.
HRESULT CIBPPDatabase::OnDraw(ATL_DRAWINFO& di)
{
RECT& rc = *(RECT*)di.prcBounds;
HDC hdc = di.hdcDraw;
HBITMAP hNoteBmp;
HDC hNoteDC;
hNoteDC = CreateCompatibleDC(hdc);
hNoteBmp = (HBITMAP)LoadImage(NULL, "C:/Connec.bmp",IMAGE_BITMAP,
0,0, LR_LOADFROMFILE );
if (hNoteBmp == NULL)
MessageBox("NULL");
SelectObject(hNoteDC, hNoteBmp);
SetBkMode(hNoteDC, TRANSPARENT);
BitBlt(hdc, 0, 0, 32,
32, hNoteDC, 0, 0, SRCCOPY);
DeleteObject(hNoteBmp);
DeleteDC(hNoteDC);
return S_OK;
}
Any help would be appreciated.
Thanks
Gary
|
|
|
|
|
1. You're blitting to (0,0) in the target DC, which is wrong. That should be (rc.left, rc.top)
2. Is the size 16x16 or 32x32? Make sure you get the size right.
3. You're leaking a bitmap handle every time through, you need to select hNoteBmp out of hNoteDC before deleting hNoteBmp and hNoteDC.
--Mike--
LINKS~! Ericahist updated! | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
Hi Michael,
Well my code now reads as follows, but i still ain't got no bitmap to display on my control.
HRESULT CIBPPDatabase::OnDraw(ATL_DRAWINFO& di)
{
RECT& rc = *(RECT*)di.prcBounds;
HDC hdc = di.hdcDraw;
HBITMAP hNoteBmp;
HDC hNoteDC;
hNoteDC = CreateCompatibleDC(hdc);
hNoteBmp = (HBITMAP)LoadImage(NULL, "C:/NEW.bmp",IMAGE_BITMAP,
0,0, LR_LOADFROMFILE );
if (hNoteBmp == NULL)
MessageBox("NULL");
SelectObject(hNoteDC, hNoteBmp);
//SetBkMode(hNoteDC, TRANSPARENT);
BitBlt(hdc, rc.left, rc.top, 32,
32, hNoteDC, 0, 0, SRCCOPY);
DeleteDC(hNoteDC);
DeleteObject(hNoteBmp);
return S_OK;
}
Wonder what is happening.
Thanks
Gary
|
|
|
|
|
I believe you have to supply the bitmap's dimensions in the LoadImage() and they should be correct (get them from your bitmap properties).
Igor.
|
|
|
|
|
I've done some extra scratching about and came across a variable in the constructor called m_bWindowed = TRUE;
If i change that to m_bWindowed = FALSE then my bitmap is loaded and displayed correctly.
only issue now is; my control is no visible at designtime, good but also at runtime.
I'll keep poking around, i have a feeling it could be something i selected in the wizard when i added an ATL object to my project. Thing is you should be able to reverse that setting some how.
Thanks
Gary
|
|
|
|
|
Hi All,
Well i've fixed the problem; which wasn't really a problem.
It seems that the activex test control container does not so the control the way i thought it should.
i.e it displays textout on your atl control, but not the graphic? Huh?
So i tested it in a project and the graphic appeared for design time, and disappeared at runtime. fabulous.
Thanks to everyone who helped, it was appreciated.
Thanks
Gary
|
|
|
|
|
Hallo,
I’m writing a Winlogon/Notify packet. I have therefore written a dll and made the necessaries registry entries. The communication between winlogon.exe and my dll is ok.
I’m unfortunalty facing a curious problem trying to work with the member variables from the PWLX_NOTIFICATION_INFO object passed from WinLogon.exe
Follow some code lines.
<br />
void __stdcall MyLogOn(PWLX_NOTIFICATION_INFO pInfo)<br />
{<br />
if((pInfo!=NULL)&&(pInfo->Domain != NULL))<br />
{<br />
size_t iSize;<br />
char *cDomain = NULL;<br />
iSize = wcstombs(0, pInfo->Domain,0);
cDomain = new char[iSize];<br />
cDomain[iSize] = NULL;<br />
<br />
wcstombs(cDomain, pInfo->Domain, iSize);<br />
} <br />
}<br />
<br />
What is wrong with my code?
Thanks in advance for helping.
dabayi
|
|
|
|
|
void __stdcall MyLogOn(PWLX_NOTIFICATION_INFO pInfo)
{
if((pInfo!=NULL)&&(pInfo->Domain != NULL))
{
size_t iSize;
char cDomain[200];
iSize = wcstombs(cDomain, pInfo->Domain,200);}
}
"I Think this Will Help"
[Vote One Here,.....]
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|