|
No it is also getting the same problem after displaying in message box
|
|
|
|
|
Is there any thing else you have kept after the message box? If not there has to be no problem at all.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
nothing else after messageBox
|
|
|
|
|
It has to do with how you've defined _WIN32_WINNT , most likely as 0x0500 . The OPENFILENAME structure used by CFileDialog is the smaller sized one. So, use GetOpenFileName() instead.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
i cant understand what u said
i defined _WIN32_WINNT like follwing
#define _WIN32_WINNT 0x500
|
|
|
|
|
kiranin wrote: i cant understand what u said
Which part are you not understanding?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thanks David i got solved by using GetOpenFileName().
|
|
|
|
|
Hi,
Which method of CMenu should I use to find which menu item has been selcted from TrackPopMenu that floating popup menu?
This menu is contextspecific menu activated with right button click.
Thanks
Prithaa
|
|
|
|
|
Im sorry but I dont understand what do you need
|
|
|
|
|
Hi,
Sorry if the question was not clear
I have a menu which is activated in a window with right mouse button click.When the menu appears the user selects a menu option .I want to find out which menu option has been selected from the menu.
Prithaa
|
|
|
|
|
Hello,
all menu items have an identifier, you must to use them to find which menu item has been klicked!
Is that what you mean?
regards
break;
|
|
|
|
|
If you pass the TPM_RETURNCMD flag to TrackPopupMenu() , then the return value indicates what was selected. If you don't use that flag, your window will get a WM_COMMAND message just as if the menu bar had been used.
|
|
|
|
|
Hi,
thanks
I got What has to be done
Prithaa
|
|
|
|
|
If I only know the DIO device is at port 280.
How can I access it? (read / write the pins)
NO API is available.
Please help!
Any relative information is welcome.
Thanks!
|
|
|
|
|
Assuming you're running some windows environment, you'll need a device driver for your device. You're not allowed to access the hardware from user mode.
Since you clearly state that "NO API is available", I assume you don't have a driver for your device and you've possibly made the device yourself.
If you bought the device it should be shipped with a device driver, unless it registers itself as a common device such as a COM port, in which case you can use ::CreateFile(), ::ReadFile(), ::WriteFile(), ::CloseHandle() and such to access it.
If you don't know anything else about the device besides the I/O port: give it up, there's no way to guess.
However, if you know how the device works and how to communicate with it at low level, you can develop a device driver of your own.
This way is quite hard, but if you'd like to have a go for it, start by reading Toby Opfermans article serie about device driver development here[^].
Hope this helps
--
Roger
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"No one remembers a coward!" - Jan Elfström 1998 "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above
|
|
|
|
|
The device is together with the PC on delivery.
And it works in the debug mode.
eg. type "-o 280 F1" as a command
I just dont know how to access it using cpp.
So, I think I can use ::CreateFile(), ::ReadFile(), ::WriteFile(), ::CloseHandle() to access it, right?
More question, using ::CreateFile, should I use "port280" as the file name?
Thanks very much!
|
|
|
|
|
Archyami wrote: just dont know how to access it using cpp.
So, I think I can use ::CreateFile(), ::ReadFile(), ::WriteFile(), ::CloseHandle() to access it, right?
More question, using ::CreateFile, should I use "port280" as the file name?
If you open a device with ::CreateFile(), you have to provide the device name as argument to the function, e.g. "COM1" when opening communications port 1.
You have to find out what your device is called before you can access it through these methods. Look for settings in the Device Manager.
It's not possible for anyone else to know what your device is called in your machine. Perhaps if you mentioned what kind of device it is someone could tell you how the device usually presents itself and how to communicate with it.
--
Roger
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"No one remembers a coward!" - Jan Elfström 1998 "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above
|
|
|
|
|
Hi,
I'd like to save the Z order of all windows. In fact, i'm working on a HideAll windows and ShowAll.
That's why i'd like to save this z-order to get the windows restaured in the same order.
thanks
|
|
|
|
|
|
ENumWindows and store the Window Handle in the array!
"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 And You
|
|
|
|
|
Hi everyone,
it's possible to set on creation a specific RGB-Value as Backgroundcolor for a CFormView.
Is it also possible to change the backgroundcolor at runtime? for example by clicking a button?
If i change the brush like this m_bgrBrush.CreateSolidBrush(RGB(255,255,255)); it crashes during the click-event
Thanks
|
|
|
|
|
You can use of a variable on m_bgrBrush.CreateSolidBrush(yourcolor);
|
|
|
|
|
If i change the brush like this m_bgrBrush.CreateSolidBrush(RGB(255,255,255)); it crashes during the click-event
You can use of a variable on m_bgrBrush.CreateSolidBrush(yourcolor);
______________________________________________________________________________________________________
That's the problem, it will not work.
If i change a variable that's used in OnCtlColor it doesn't work also
HBRUSH FEinstellungenView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CFormView::OnCtlColor(pDC, pWnd, nCtlColor);
if((nCtlColor == CTLCOLOR_STATIC) || (nCtlColor == CTLCOLOR_DLG) )
{
// Ändert
pDC->SetBkColor(MyColor); // MyColor is a DWORD that i change in the click-event MyColor = RGB(255,255,255)
return (HBRUSH) m_bgrBrush;
}
return hbr;
}
Thanks
|
|
|
|
|
You get an error because you created CBrush prevoius CreateSolidBrush .You can declare a variable for color like:COLORREF color; color=RGB(0,0,100);
|
|
|
|
|
BOOL FEinstellungenView::OnEraseBkgnd(CDC* pDC)
{
CRect rcClient;
GetClientRect( &rcClient );
pDC->FillRect(rcClient, &CBrush(*MyColor)); // On the click i change the MyColor Value
return TRUE;
}
Thats the easiest way i think
I found it after a long Google Research
Thanks nevertheless
|
|
|
|