|
prithaa wrote: What should IO do?
Explain a bit further what it is you are trying to accomplish (by placing controls on top of others in this fashion). You may have a legitimate need, or simply a misunderstanding of how things work.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello,
Thanks for your replies.
I have an edit box on a child window whose OnKeyUp() function calls a list box to be seen on the window.Sometimes this listbox has to appear on another editbox where the edit box is half seen.
But when the listbox appears on the editbox where the editbox is in the background and the listbox is in the foreground ,the listbox's border(lower) gets cuts and is
not visible.The area where the list box meets edit box.
My problem is that the listbox should appear on the editbox (wholelly or partly) and the mouse cursor when placed on the list box should appear on the list box not on the edit box (if edit box is below the list box)
In my case the mouse cursor when placed on the list box doesn't have the normal arrow sign but has a cursor as if placed on the edit box.
Regards,
Prithaa
|
|
|
|
|
Hi all,
I need some help regarding MSMQ using VC++. i am new to this concept.
let say i am running a application on LOcal Pc and i want to save some information from this application into a database which is running on a remote machine.
can you please tell how MSMQ can be used in this scenerio.if you can provide a example for this that will be a great help to me.
Thanks
abhi
|
|
|
|
|
Can anyone help me?
I tried to open the web page using shell execute in maximized mode. the command as given below:
CString webURL = "www.yahoo.com"
HINSTANCE hInstance = (HINSTANCE)ShellExecute(this->m_hWnd, _T("open"), webURL, NULL, NULL, SW_MAXIMIZE);
or
HINSTANCE hInstance = (HINSTANCE)ShellExecute(this->m_hWnd, _T("open"), webURL, NULL, NULL, SW_SHOWMAXIMIZED);
it opens the page. but it display as normal not in maximized state. first time it opens maximized. in the internet explorer, if restored and call the same command in the exe, it brings the window in the front. It displays in the normal
|
|
|
|
|
sujtha wrote: HINSTANCE hInstance = (HINSTANCE)ShellExecute(this->m_hWnd, _T("open"), webURL, NULL, NULL, SW_SHOWMAXIMIZED);
sound absurbd but try NULL instead of this->m_hWnd.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|
|
i tried null also. same problem....
|
|
|
|
|
may be you should try like this
CString webURL = _T("www.yahoo.com");
HINSTANCE hInstance = (HINSTANCE)ShellExecute(0, _T("open"), _T("C:\\Program Files\\Internet Explorer\\iexplore.exe "), webURL, NULL, SW_SHOWMAXIMIZED);
|
|
|
|
|
From past experience, IE seems to want to do its own thing (e.g., use size/position from last use), rather than what you instruct it to do. I've not researched into this hardly at all, but it just seems to be this way more often than not.
You might try calling ShowWindow(hWnd, SW_SHOWMAXIMIZED) once IE is fully opened.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I'm just a beginner in visual C++/MFC. Can somebody give me an idea on how can I possibly stitch/join image files to view the whole picture while moving the scrollbar. These images are pre-stitch using photoshop and guided by the *.pmg file created. An idea is to add image file to the side and remove from the other side while scrolling. I'm experiencing problems on loading the next image because this is subject to repaint and causes a noticeable delay on scrolling. Example of this is a 9x9 image files picture.
Is it possible to do this without any delay on repaint?
I hope to hear from you guys.
This would be a big help for me.
|
|
|
|
|
Hi,
to make it without repainting will be impossible, but the delay is directly dependant on how your programm works.
I had a lot of delayment in my last project because I was creating/copying objects allover I needed something from the document. That mades have a delay of some 2 or 3 secs between doubleclicking to open a new window and having the window on the screen.
Solution? Working with pointers and accessing just the parameters I need in each concrete moment, but leaving the object in the doc.
In your project there can be different possibilities. Or you are charging images that are bigger than your container, then the computer has to edit the image to fit to size... or you are bringing the objects as me insteads of reading from a fixed place... or any other possibility.
If you post a bit of your code, relating your problem will be easier to look into.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
Just wondering, how do you check if a USB Stick is inserted? Can you recommend some reading or maybe you can post the code. Thanks!
|
|
|
|
|
Look into the
RegisterDeviceNotification API call
You can set the filter level based on the type of device
Typically u can set a filter for type GUID_CLASS_USB_DEVICE
Now any Window class has an OnDeviceChange handler that provides a notification mechanism and inside u can check for the type ( typically GUID type) to see if its a Mass Storage Device class
Engineering is the effort !
|
|
|
|
|
|
Iain Clarke wrote: Have you tried looking on a well know site full of programming articles? Perhaps in the system section?
That's about as useful as suggesting to look in the phone book under "tire repair" when you get a flat tire on your car. It would be more comprehensive, and a lot less tiring, to call the first name in the As and ask them what to do.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Method 1:
CMyDialog mMyDialog;
mMyDialog.Create(CMyDialog::IDD, this);
Method 2:
CMyDialog* mptrMyDialog;
mptrMyDialog = new CMyDialog;
mptrMyDialog -> Create(CMyDialog::IDD, this);
In method 2, I have to call delete mptrMyDialog before closing, but in method 1, mMyDialog will be destroyed when its parent is closed, correct?
So why is method 2 generally the preferred way? Method 1 seems to me like the simpler way because you don't have to worry about deallocating.
|
|
|
|
|
acerunner316 wrote: So why is method 2 generally the preferred way?
It all depends on the individual (and where they may have copied their code from).
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
acerunner316 wrote: in method 1, mMyDialog will be destroyed when its parent is closed, correct?
The windows object (HWND) will be destroyed when the parent is destroyed.
The CMyDialog object is destroyed when it goes out of scope. If it goes out of
scope while its wrapped HWND is valid, the Windows object (HWND) will be destroyed
as well.
I suppose which method you use (in addition to DavidCrow's reply) depends on the
desired scope of the object and/or whether you want it on the stack or the heap.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
acerunner316 wrote: In method 2, I have to call delete mptrMyDialog before closing
wrong. after !!!
otherwise, you delete a dialog still being displayed !
|
|
|
|
|
acerunner316 wrote: So why is method 2 generally the preferred way?
I never heared this before ... the 2 methods are exactly the same for me.
The only difference that I can see is that using pointers you can pass the pointer from function to function, or, in a class, you can store the dialog pointer on a member variable of that class.
Russell
|
|
|
|
|
method 2 is preferred because the purpose of Create is to create a modeless dialog
so imagine you have this function somewhere
<br />
void OpenMyModelessDialog()<br />
{<br />
CMyDialog mMyDialog;<br />
mMyDialog.Create(CMyDialog::IDD, this);<br />
}<br />
as soon as the function returns the modeless dialog will be destroyed OOPS!!!
|
|
|
|
|
VC++,CClientDC and OnDraw's CDC
What is the difference of drawing a geomtric shape in the CClientDC and OnDraw's CDC?
|
|
|
|
|
OnDraw's CDC is a CPaintDC - a DC obtained through the BeginPaint() API in response to WM_PAINT.
CClientDC is obtained with GetDC.
OnDraw's DC will have a clipping region selected into it which excludes areas outside the area that
needs repainting. With a CClientDC, you'd need to do that yourself.
They draw to the same place though
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I have a C++ Program which in which I have to read a XML file contents. The code is
#include "fstream.h"
#include "string.h"
#import "msxml2.dll" named_guids raw_interfaces_only
using namespace MSXML2;
using namespace std;
void main()
{
IXMLDOMDocumentPtr m_pXmlDoc;
IXMLDOMNodePtr m_pProductNode;
HRESULT hr = m_pXmlDoc.CreateInstance(MSXML2::CLSID_DOMDocument);
_variant_t vtFileName("my_xml.xml");
VARIANT_BOOL vtRetVal;
m_pXmlDoc->load(vtFileName,&vtRetVal);
}
The CreateInstance() call fails and m_pXmlDoc is NULL.
Why am I not getting the instance? What is wrong in this piece of code?
|
|
|
|
|
koumodaki wrote: The CreateInstance() call fails...
And the value of hr would be what?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
On my PC hr = -2147221008 while debugging......guess its some junk value
|
|
|
|