|
Does TaskKeyHook.lib exist in the Debug folder?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
No that whas the poblem,
But it whas in the realese folder so it works fine now.
But tht I whant to do is to set this funktion on the init dialog funk.
|
|
|
|
|
hian i creted a small program to deal with it
if you like give me your email i will send you both dll and program
I Think It will Work
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Thank,
but it works fine now.
Thank anyway.
|
|
|
|
|
look man just use the windows keyboard hook and when you detect that ctrl+alt+del was hit just return 1; /error and the keyboard will have no //effect
else
return 0; //success
gabby
|
|
|
|
|
Thank you. The cause of the assertion was exactly due to the problem u said.
I want to draw some lines to the screen ,when uses dbl clicks,but I dont have a valid DC then...
Could u give me any suggestion on this one...
|
|
|
|
|
You need to store the data for your lines some other way.
Perhaps in an array of some data class representing the drawing to be performed.
Then, when the user does something, like move the mouse, add some data to your array for the new lines, and then call Invalidate() for your window.
The OnDraw will be called because of the painting to be done, and then you can go through your list of objects and draw the lines.
Basically, you should internally represent all drawing to be done with some data classes and then transform that data to drawing function calls in the OnDraw method.
If you do nto have htis data, and user draws soemthing, then when another window covers yours, and you get a paint message (OnDraw is claled) you will probably lose all the drawing you already did.
|
|
|
|
|
|
I have inserted a dialog to my Dll and generate a class named as CTestDlg by the classview. I alse write a dllexport function:TestDlg
void __declspec(dllexport) __stdcall TestDlg()
{
CTestDlg dlg;
dlg.DoModal();
}
I have checked this dll in an application,but the dialog is not shown,why?
|
|
|
|
|
Try this (from msdn) :
You must add the AFX_MANAGE_STATE macro at the begining of all the exported functions in regular DLLs that dynamically link to MFC to set the current module state to the one for the DLL. This is done by adding the following line of code to the beginning of functions exported from the DLL:
AFX_MANAGE_STATE(AfxGetStaticModuleState( ))
rrrado
|
|
|
|
|
search this forum, somedays ago
there was a similar question.
Its because the ressources (the DLG template)
is loaded from the MainApp ressources and not
from the DLL ressources.
|
|
|
|
|
Hi Guys,
Would like to what is wrong with the following...
[1]Iam drawing to a screen the contents of a page(say, 1st page) & some rectangles as well.(Mfc application-using deviceContext)
Now,I want to load a different page(say, 2nd page) with no figures.
How will I clear everything from screen for drawing the 2nd page,so that the 2nd page doesnt overlap on the contents of the first page...
[2]
// In the MFC generated OnDraw
// m_drawer is a pointer to my defined class to which Iam passing the DC for drawing.
void CMfcTestView::OnDraw(CDC* pDC)
{
CMfcTestDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
m_drawer->AttachDC(pDC);
}
// Have another function to draw a line to screen on the button down action.
void CMfcTestView::OnLButtonDown(UINT nFlags, CPoint point)
{
CView::OnLButtonDown(nFlags, point);
m_drawer->DrawLine();
}
void DrawLine()
{
CPen newPen(PS_SOLID,2,RGB(color[0],color[1],color[2]));
CPen *pOldPen = m_deviceContext->SelectObject(&newPen);
//Drawing Line
// This call gives me a assertion failure in wingdi.cpp
m_deviceContext->MoveTo(offset,initialyPos);
}
There is no assertion failure when I call "m_drawer->DrawLine()" from OnDraw().
What could be the reason of this.....
Thanks..
|
|
|
|
|
I think the DC you receive in OnDraw is the result of a lower level BeginPaint call.
The DC is released once the 'painting cycle' has completed - after your OnDraw returns, the DC is no longer valid.
You might be retaining it too long.
|
|
|
|
|
Thanks,That might be the reason.Will check that.
Could u put some light on the first part of my question...
Thanks.
|
|
|
|
|
Get the extents of your device context.
See CDC::GetWindowExt in MSDN
Create a 'solid' brush the color of the background.
See CBrush::CreateBrushIndirect in MSDN
Then fill a rectangle the size of your DC to 'erase' the background
See CDC::FillRect in MSDN or try CDC::FillSolidRect - then you do not need the brush.
|
|
|
|
|
I'm using WebBrowser control in my application in modeless dialog,
so it can download and display web page in background.
But sometimes WebBrowser set focus to this dialog and brings it to the top
when it finished downloading the page, so it will interrupt user while typing to another window.
How to prevent this ?
Thank you !
rrrado
|
|
|
|
|
I would like to make an app to secure the pc (running windows xp) with a password.
Does anybody know how to replace, or bypass with any way, the log in screen of windows XP?
Thanks in Advance,
sirtimid
|
|
|
|
|
You want to write an application that secures Windows XP by bypassing it's login security!?!
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fuity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Message Closed
modified 7-Jun-22 3:31am.
|
|
|
|
|
I have seen this in windows 2000. A big company have developed that application. It is a log in security application.
they had replace the log in dialog with a similar one that they made it!!
|
|
|
|
|
ask gina, maybe she can answer your question.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
This[^] should help
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I want to fetch data from a databse and populate a DHTML view at run time.Also, if theres is a change in value of any of the objects in database, the change should be immediately reflected in the view.How can i achieve that.
|
|
|
|
|
Not asking alot then
You have two options:
1. As you say, use DHTML to update the information in the page. This can be labourious work and imo ties the VC application too tightly to the HTML page.
2. Grab the data from the db and generate an XML string from the data, pass this XML string to a JScript function on the web page that will parse the XML data and make changes to the display accordingly.
To call a JScript function on a web page from VC use the following:
MSHTML::IHTMLDocument2Ptr spDoc(m_ctlWeb1.GetDocument());
if (spDoc)
{
IDispatchPtr spDisp(spDoc->GetScript());
if (spDisp)
{
OLECHAR FAR* szMember = L"Populate";
DISPID dispid;
HRESULT hr = spDisp->GetIDsOfNames(IID_NULL, &szMember, 1, LOCALE_SYSTEM_DEFAULT, &dispid);
if (SUCCEEDED(hr))
{
COleVariant vtResult;
static BYTE params[] = VTS_BSTR;
COleDispatchDriver dispDriver(spDisp);
dispDriver.InvokeHelper(dispid, DISPATCH_METHOD, VT_VARIANT, (void*)&vtResult, params, strXML);
BOOL bSuccess = vtResult.boolVal;
}
}
}
So the above will call the Populate JScript function in the current page that takes 1 parameter (sent as a string)
Then in your HTML page have a function, e.g.
var oXmlDoc = new ActiveXObject("MSXML2.DOMDocument.4.0");
function Populate(strXML)
{
bSuccess = false;
if (oXmlDoc)
{
oXmlDoc.async = false;
oXmlDoc.resolveExternals = false;
if (oXmlDoc.loadXML(strXML))
{
var oNode = oXmlDoc.selectSingleNode("/update/field");
if (oNode)
{
var elField = document.getElementById("idField");
if (elField) elField.innerText = oNode.innerText;
bSuccess = true;
}
}
}
return bSuccess;
}
This way you are free to change the way the HTML looks and feels as much as you like. It's not the job of the VC app to render the information but the HTML page. You could even have several HTML pages that render the information in different ways - as long as the XML is common to all.
Hope this helps,
Andy
|
|
|
|
|
My program calls many functions and interates in many loops. To debug the program, i've placed TRACE calls all over the place, but it seems, when the program runs, not all the TRACE outputs are displayed, they are truncated. I guess there isnt enought place/memory for the debug window, how can i redirect it to a text file?
Thx.
|
|
|
|