|
Delete Debug/CMMITool.pch and try again. A pch file may not be used on two different versions of VC++.
John
|
|
|
|
|
delete Debug directory, and delete .clw, .opt, .NCB files.
then compile again.
libo
|
|
|
|
|
|
I am writing BHO for now, which dynamically changes the document.
I faced that thing, that if I do next (after the 'documentcomplete' event in browser)
//Code:
CComQIPtr<IHTMLElement> piSpanElement;
hr = pHtmlDocument->createElement(L"span", &piSpanElement);
BSTR innerHtml = L" <u>This is string with leading space"</u>";
//leading space is happily ignored, when I'm inserting that text:
hr = piSpanElement->put_innerHTML(innerHtml);
//Ok-ok, I beleive, it is with the good intentions
//of MSHTML, I will try to insert some text...
//I even do not put a whitespace there...
//Ok, I will try to insert some text...
//(In MSDN it is said, that InsertAdjancedText inserts plain text.
hr = piSpanElement->insertAdjacentText(L"beforeEnd",L"Some text");
//OK, text is in element, but... I needed before content, ok, mistake - I try to correct:
hr = piSpanElement->insertAdjacentText(L"afterBegin",L"!I WANNA SEE THIS TEXT IN ELEMENT before content!");
//It does return S_OK... I do not see that text, WTH!?
//I insert this element simply querying interface and
//substituting the DOM node. After that html element tortures.
May be I'm "stupido", but I cannot convert IHTMLDomNode element to the IHTMLElement. If there is any method - please tell..
then - one more...
we have "this node", reference node, and node to substitute
Substituting node is IHTMLDomNode pointer, former IHTMLDOMTextNode with text " " or any other - the result was same.
CComQIPtr<IHTMLDomNode> resultNode;
VARIANT refNode;
refNode.vt = VT_DISPATCH;
refNode.pdispVal = rNode; //reference node pointer
hr = thisNode->get_parentNode(&pNode); //parent node pointer
//OK, pNode is not null.
hr = pNode->InsertBefore(substitutingNode,refNode,&newNode);
//Why hr is EINVALIDARG???
or just simply - is there any way to insert that eaten leaded space.
Or what I do incorrectly?
|
|
|
|
|
1) You should NOT use unicode strings in place of BSTR's. Use SysAllocString() and SysFreeString(). Or better yet, use ATL::CComBSTR.
2) Use QueryInterface() to get IHTMLElement from IHTMLDOMNode. Or better yet use ATL::CComQIPtr<IHTMLElement> spIHTMLElement(piHTMLDOMNode). This calls QueryInterface() automatically.
3) You should NOT use raw VARIANT. Use VariantInit(), VariantChangeType(), and VariantClear(). Better yet, use ATL::CComVariant.
|
|
|
|
|
Problems:
QueryInterface() returns null and E_NOINTERFACE (or smth like).
So it seems to me, that the circle closed...
If somebody know, howto do that, please answer
|
|
|
|
|
Hello!
y Build an application using visual studio, but i don´t know what extra files do i need for execute de applicatión in a different machine
Sergio
|
|
|
|
|
Which version of VC++ are you using?
For most applications, they will have dependency on the C Run-time dlls.
In VC++ 2003 and earlier, those CRT dlls are dropped to system32 folder and they just need to be on the path. You can figure out the names of the dlls by using depends.exe.
In VC++ 2005, the CRT dlls are now distributed through Msms that needs to be merged into an Msi to get installed on the user's machine. You can search for VCRedist.exe on the microsoft website. Again - depends.exe should help you figure out those dlls.
gmileka
|
|
|
|
|
hi guys,
im using ReadProcessMemory to read out 4 bytes of a process. The value is a DWORD. Yesterday a friend said to that I should use a Pointer opperation to read out the memory. I read a bit about Pointer and Memory allocation but i didn´t get it working.
I tried this:
DWORD dwAddress = 0x01234567;
DWORD *dwValue = *(DWORD*)dwAddress; // got the address of dwAddress
DWORD dwValue = *(&dwAddress); // got the address ( 0x01234567 )
How can i read out the value ?
|
|
|
|
|
Is this value in the process that is doing the 'read' or is it in a different process?
If it's in the same process, then assuming that 0x0BADC0DE is the virtual address of the DWORD you want to fetch, the following code will get it:
<br />
DWORD dwAddress = 0x0BADC0DE;<br />
DWORD dwValue = * reinterpret_cast<DWORD *>( dwAddress );<br />
If you specify an invalid virtual address, you will generate an access fault at runtime. This technique is generally used only in very low-level code that does not run in a virtual memory space to access memory-mapped hardware devices. It's not something that is very useful in a Windows Application and it would generally be considered very poor programming style.
If you need to read memory in a different process, then you must use ReadProcessMemory(). Each process has it's own self-contained virtual address space. There is no way to define a simple pointer into the address space of another process.
If you are in control of the source for both processes then you could set up shared memory between the two, or possibly some other mechanism for getting the value. Can you tell us a little more about what the value represents, how often you need to read it, etc? More information might let us suggest a better method of sharing this value.
Dan
Remember kids, we're trained professionals. Don't try this at home!
|
|
|
|
|
i have an app with a login dialog box, with login button, when the button is pressed the login dialog box hides and new dialog box opens. When i click cancel in the new main dialog box, the dialog box disappears but the app is still running in the background in taskmanager. is it becuase the login dialog box is hidden and not closed or ??? how do i close the hidden dialog box if that is the problem or is it summit else?
regards
keith
void CKeithDlg::OnLogin()
{
ShowWindow(SW_HIDE);
CMainDlg Dlg;
Dlg.DoModal();
}
========================================
void CMainDlg::OnCancel()
{
CDialog::OnCancel();
}
|
|
|
|
|
CKeithDlg hides itself but doesn't close itself, so the app is running with a hidden main window. IIUC you want the app to exit after CMainDlg closes, right? At the end of CKeithDlg::OnLogin() , add EndDialog(IDOK);
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
|
void CKeithDlg::OnLogin()
{
ShowWindow(SW_HIDE);
CMainDlg Dlg;
Dlg.DoModal();
EndDialog(IDOK);
}
Manish Rastogi
|
|
|
|
|
Is it true that if GetActiveView() returns NULL then Our Application Does not Support Doc/view.or how can know
or how can check that Our Appliction Supports Doc/View
pls help me.
Fly Like An Eagle With MIGHTY POWER.
|
|
|
|
|
(1)GetActiveView() returns NULL when called for an MDI main frame window (CMDIFrameWnd).
(2)If there is no current view, returns NULL.
libo
|
|
|
|
|
I am attempting to write a front-end database app. Using relational database design I have a parent table in a CFormView in one pane of a splitter window and a child table CFormView in another pane of the same splitter window. On the OnInitialUpdate for each of the CFormView's I create and open the recordsets. I can replace a new CFormView and (subsequent recordset) into a pane based on user selection. I notice that OnInitialUpdate fires for each pane of the window regardless of whether or not the pane is being replaced. Creating some problems as I was expecting the OnInitialUpdate to only fire once.
To test this again before I posted this question, I opened up a Splitter Window example from a book (MFC Answer Book) and put some trace statements in the OnInitialUpdate event for each of the CFormViews. It appears that if a window has 3 panes, all 3 panes get the OnInitialUpdate to fire even when only one is being replaced.
Question: Is this normal behavior? Thanks.
|
|
|
|
|
Can you but a breakpoint in the view's OnInitialUpdate() method and check the stack trace at that point? That will tell you what piece of code is calling OnInitialUpdate() and why it is happening for each view.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hi David,
I did it once and my eyes kind of glazed over. So I did it again and it makes sense now.
InitialUpdateFrame was being called in the code that switched the views and this then makes each view call OnInitialUpdate.
Thanks
|
|
|
|
|
How to write the output array to a text file?
|
|
|
|
|
chaitanya22 wrote: How to write the output array...
What output array?
chaitanya22 wrote: How to write...to a text file?
What text file?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
|
Here's one way:
FILE *pFile = fopen("file.txt", "w");
for (int x = 0; x < sizeof(array) / sizeof(array[0]); x++)
fprintf("%d\n", array[x]);
fclose(pFile); Others exist, too.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
for write to file you can use CArchive But please refer to Reply David Crow
|
|
|
|
|
if you meant the values of and array in a txt file you can use the binary files to write the whole array in it but binary mode.
f=fopen(fname,"bw");
fwrite(array,1,sizeof(int)*nr_of_items,f);
fclose(f);
but if you want the values to be readable you must convert them first to chars and then write them.
char nr[10];
/*if array declared like this int array[100] or int *array*/
f=fopen(fname,"w+");
for (int i=0;i<nr_of_items;i++)
{
_itoa(*array,nr,10);
fwrite(nr,1,strlen(nr),f);
array++;
}
fclose(f);
the main="" thing="" is="" that="" you="" can="" write="" any="" kind="" of="" data="" variable="" in="" a="" binary="" file="" otherwise="" will="" have="" to="" make="" convension="" it="" text="" file.="" sometihng="" like="" this:
1="" line="" the="" nr="" entries
2="" length="" each="" entry="" if="" they="" are="" all="" equal
3="" -=""> nr_of_items line the entries
or something like this.
have fun
gabby
|
|
|
|