|
What was the issue? I'm having the same and I can't resolve it
|
|
|
|
|
When I click them, they become visible again.
void CMyDlg::OnPaint()
{
...
Graphics g(GetSafeHwnd());
g.DrawImage(m_pMemBmp,0,0);
}
|
|
|
|
|
U should draw the image in response to
WM_ERASEBKGND message
Come online at:-
jubinc@skype
|
|
|
|
|
I don't have any great experience with GDI+ as such, but it may help if you tick the "Clip children" style for your dialog box.
Iain.
|
|
|
|
|
|
This is absolut correct. If you wish your image be drawn as background, you draw it in the OnEraseBkgrnd() handler.
Greetings from Germany
|
|
|
|
|
can any one give me idea how to play .tga file on device context.
GDI+ is not playing. I did not want to use third party library.
|
|
|
|
|
Antonyemac wrote: GDI+ is not playing
Isn't tga an extension for a TARGA image file, is it?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
yes i mean to play targa files
|
|
|
|
|
Do you mean that you loaded a TARGA image via Image class and you see nothing on the display?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
yes I could not get any display on the device context .
I wrote following code.
Gdiplus::Graphics graphics(hdc);
Gdiplus::Image image(L"test.tga",TRUE);
graphics.DrawImage(&image,0,0,image.GetWidth(),image.GetHeight());
but when I use a bitmap/jpeg etc file it works file i.e.
following code works fine
Gdiplus::Graphics graphics(hdc);
Gdiplus::Image image(L"test1.bmp",TRUE); // just change the file
graphics.DrawImage(ℑimage,0,0,image.GetWidth(),image.GetHeight());
|
|
|
|
|
I think Image class is not able to load a TARGA via Image::Image(const WCHAR *, BOOL ) , probably you need to use the one accepting a IStream * : Image::Image(IStream *, BOOL ) . Unfortunately I have never used Image this way hence I cannot give you any help about. Try also to ask the Graphics forum.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Hello to all,
In my project we are using a FTDI driver to connect a device to computer means after installing FTDI driver when we connect our device to computer it recognize it as a USB device and start collecting data from it. But now problem is that when device is connected to communication port(COM port)1 to 9 i.e. COM1 to COM9 then our s/w start collecting data from device but when we connect device to COM10 or onwards then our s/w can not recognize device and gives error "Please check the serial port connected to your s/w" means you have selected wrong COM port number.My logic is as follows,
if ((miComDev =
CreateFile(ComPortNumber, GENERIC_READ | GENERIC_WRITE,
0,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL |
FILE_FLAG_OVERLAPPED,
NULL )) == INVALID_HANDLE_VALUE )
{
AfxMessageBox("Please check the serial port\nconnected to ECG System");
return ( FALSE ) ;
}
here ComPortNumber contains the COM port number (i.e. COM1,COM2 and like that).above logic works properly for COM1 to COM9 but when we connect our device to COM10 or above it gives above mentioned error.what to do? is there any other method to open the port COM10 and above? can anybody help me plz?
Thanks and Regards,
Anay
|
|
|
|
|
Yes, for COM ports above 9, you need to change the string. It should be: "\\\\.\\COM10".
Seehere[^] for more info.
|
|
|
|
|
yes cedric, it worked properly.thanks a lot for your valuable support.once again thanks.
Anay
|
|
|
|
|
Cedric is correct - I found this out by looking on the FTDI website *somewhere*.
His format also works for com ports lower than 10, so I use it all the time now.
I also found that FTDIs D2XX.dll library was far simpler to use for new software than pretending your device is a serial port. The ability to write it as COM9 etc is good for existing code, but is less friendly for new code.
You may also want to look at my article http://www.codeproject.com/KB/system/Drive_Detect.aspx[^] about detecting devices. The article concentrates on drives, but is equally epplicable (out of the blue) FTDI drivers...
Iain.
|
|
|
|
|
Hello Iain,
my problem is solved,thanks a lot for your valuable support and help and also for your further suggessions.once again thanks.
Thanks and Regards,
Anay
|
|
|
|
|
dear friend
how to solve the following problem:
LINK : fatal error LNK1104: cannot open file "psoCode.lib"
Error executing link.exe.
i already set psoCode.lib as active project and include this file in direcory.
also put header file in main function....
thanks
Li Zhiyuan
5/10/2006
|
|
|
|
|
Add the mentioned lib to the Source Files folder of Workspace Window .
Come online at:-
jubinc@skype
|
|
|
|
|
On VS2005 :
- Select the
Tools->Options... menu item.
On the newly apperaed window, select the Projects and Solutions->VC++ Directories node. - Select the
Library files item of the Show directories for: list box. - Add the path of the folder containing the
psoCode.lib to the directory list
(you can browse for the folder).
Enjoy your library.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
dear freind
i use vc++6, i added the psoCode.lib in option....directory...i also added the psoCode header file in my main() file header.....any other problem..please reminder me..thanks
Li Zhiyuan
5/10/2006
|
|
|
|
|
You have to add the psoCode.lib folder path to the Library files list.
Once you have done the above try to build and eventually post any error occurred.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
li zhiyuan wrote: also put header file in main function....
A missing or incorrect header file would yield a preprocessor/compiler error, not a linker error.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi ,
I developing an application that hooks the Open/Save dialog for getting the selected file path. currently am able to hook the common dialog but it's not working on office Open/Save dialog. On Searching i found that Office is using separate Open/Save dialog. Can anyone help me to identify the Office Open/Save dialog messages equivalent that of common dialog's
CDN_FILEOK
CDN_INITDONE
CDM_GETFILEPATH
CDM_GETFOLDERIDLIST
CDM_GETFOLDERPATH
CDM_GETSPEC
CDM_HIDECONTROL
CDM_SETCONTROLTEXT
CDM_SETDEFEXT
?
thanks
Nitheesh
|
|
|
|
|
void CAppplicationLanucherDlg::OnOpen()
{
// TODO: Add your control notification handler code here
CString str,fstr;
char strFilter[] = { "All Files (*.*)|*.*|" };
CFileDialog FileDlg(TRUE, ".All Files", NULL, 0, strFilter);
if( FileDlg.DoModal() == IDOK )
{
str=FileDlg.GetPathName();
HINSTANCE ht=ShellExecute(handle, "open", str, NULL, NULL, SW_SHOWNORMAL);
long i=(long)ht ;
if(i==SE_ERR_NOASSOC)
WinExec("rundll32.exe shell32.dll, OpenAs_RunDLL " +str, SW_SHOWNORMAL);
}
}
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|