|
Hi all, I'm currently performing the following sequence of actions:
- My prog creates a directory
- It opens an OLE link to an external program, which creates files in that directory
- the OLE link releases the dispatch driver
- The external program may quit
- My prog deletes the files from the directory
At this point, my prog tries to delete the directory, but it fails with the error message that another process is still using the directory.
Any ideas, please?
Cheers,
Steve.
Asynes yw brassa ages kwilkynyow.
|
|
|
|
|
Hi all.
I am using MFC, and I want to display a bitmap on a button. I created the resource and it appeared in the bitmap resources as IDB_BITMAP1. Now I added a button named m_opaque and added the followin code to the OnPaint function:
void HelloDlg::OnPaint()<br />
{<br />
if (IsIconic())<br />
{<br />
CPaintDC dc(this);
<br />
SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);<br />
<br />
int cxIcon = GetSystemMetrics(SM_CXICON);<br />
int cyIcon = GetSystemMetrics(SM_CYICON);<br />
CRect rect;<br />
GetClientRect(&rect);<br />
int x = (rect.Width() - cxIcon + 1) / 2;<br />
int y = (rect.Height() - cyIcon + 1) / 2;<br />
<br />
dc.DrawIcon(x, y, m_hIcon);<br />
m_opaque.ModifyStyle(0, WS_CHILD|WS_VISIBLE|BS_BITMAP);<br />
m_opaque.SetBitmap( ::LoadBitmap(NULL, MAKEINTRESOURCE(IDB_BITMAP1)) );<br />
}<br />
else<br />
{<br />
CDialog::OnPaint();<br />
}<br />
}<br />
The code compiles but the image doesnt appear. what is the reason?
-- modified at 11:27 Tuesday 11th July, 2006
|
|
|
|
|
safigh wrote: if (IsIconic())
You are painting only when the window is minimized!
Also setting the bitmap is not a "painting" function. That should be done during initialization not painting.
Last modified: Tuesday, July 11, 2006 10:26:23 AM --
|
|
|
|
|
Adding these two line to the init dialog also doesnt show the picture????
m_opaque.ModifyStyle(0, WS_CHILD|WS_VISIBLE|BS_BITMAP);
m_opaque.SetBitmap( ::LoadBitmap(NULL, MAKEINTRESOURCE(IDB_BITMAP1)) );
|
|
|
|
|
You are painting in the OnPaint message of the dialog when the dialog is minimized.
If you want to draw the bitmap on a button that is child control of the dialog, you are not painting at the right place.
To draw a bitmap on a button, you can use the CBitmapButton class.
Louis
* google is your friend *
|
|
|
|
|
See here.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi all. could any one tell me how i can add webbrowser controle to my visual c++ 6 MFC project? I already have project made byMFC AppWizard which has a few conroles such as buttons an textbox/editbox and i want to add to it a webbrowser controle.Thanks
|
|
|
|
|
Examples exist on MSDN and likely here on CodeProject as well. Did you search at all?
http://www.codeproject.com/cpp/htmleditvc6.asp[^]
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
man i am using MFC with dialog and just want to display a webpage in part of a form. But that example never talkes bout url!!
All i want to dispaly a site such www.cnn.com inside the form just like visual basic webbrowser controle.
|
|
|
|
|
method007 wrote: But that example never talkes bout url!!
Then do a freakin search and find one that does, there are hundereds of them including on the MSDN site!
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
If u do not want to help some one do not try to flame. i am new to visual c++ world so if u do not want to help just do not reply!! very simple. do not think every one is in same level!!
|
|
|
|
|
method007 wrote: do not think every one is in same level!!
Same level? Can't you read? The Sample/Example code you ask for is free for the "reading" on MSDN like I told you three times now. Telling you where you can find what you asked for is not a "flame". If you really want to be flamed just let me know.
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
Have you considered the WebBrowser Control (shdocvw.dll)?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I just want to load a URL inside my application just like visual basic 6 and i do not know how. I am looking for easy way . could u tell me how to use
shdocvw.dll ?Thanks
|
|
|
|
|
method007 wrote: could u tell me how to use
shdocvw.dll ?
Project --> Add To Project --> Components and Controls.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
could u tell me what is the controle path for it ? furthermore , how to load the url using this method?
|
|
|
|
|
method007 wrote: furthermore , how to load the url using this method?
Use either the Navigate() or Navigate2() method.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
but how to know the path of controle and what should i do with navaigate? it seems like this is lunching a rocket to space processs!!!
|
|
|
|
|
method007 wrote: but how to know the path of controle...
Most, but not all, reside in the \Windows\System32 folder. However, there's rarely a need to know such information. Once a control has been registered with the OS, its path is mostly irrelevant.
method007 wrote: ...what should i do with navaigate?
Pass it a URL.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
david i still did not get my answers . What should i do here as u see in the pic and also how to specify the url that i want to load ? could tell me step by step as this is my first attemp to work this method.Thanks
[IMG]http://i5.photobucket.com/albums/y180/method007/component.jpg[/IMG]
|
|
|
|
|
method007 wrote: What should i do here...
Double-click Registered ActiveX Controls.
BTW, <IMG> tags are not supported.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Once you added the component ( as david wrote ), you can use the IHTMLDocument2 interface to access the HTML document, and directly write HTML code ( text ) to the document.
if you want to navigate to an existing document ( on disk or from the web ) you need to Navigate from the IWebBrowser2 interface.
do a little explorating on CodeProject, you will find pretty much what you want.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I have been confused with the following way of programming. please help me.
In my project I have a frame window and as its part 3 classes. A treeview , a window and a HTML control. Through the window I can select some directories. As soon as the selection is made the tree view must display all the HTML files in that directory. When clicking on the HTML file name in hte tree control it must be displayed in the HTML control. To carry I have used splitter windows. Now the problem comes. I dont know How to organise the classes and where to write the event handler!
As an example how can I pass the button click event in the window to the tree control. Or a click event in the tree control to the HTML control. Though these 3 are seperate classes and their objects are not related each other, it makes me confused! (I would like to write the event handler for each class in that class itself and I dont want to mess up the frame window with lots of code....)
could you please help me? Thanks in advance..
Lloyd.
|
|
|
|
|
Study the MVC pattern (Model-View-Controler)
See this[^] for a starter
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
When the document changes, it sends notification to the view(s) via UpdateAllViews() . The view(s), in turn, can call GetDocument() to get the latest data to render.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|