|
#include "stdafx.h"
#include "Pdf_Example.h"
#include "Pdf_ExampleDoc.h"
#include "Pdf_ExampleView.h"
#include <shellapi.h>
...
...
...
void CPdf_ExampleView::OnBnClickedButton1()
{
CString str;
str = "www.google.com";
ShellExecute(NULL, "open" ,str, NULL, NULL, SW_SHOW);
}
thats all....
if i click a button that should be open....
shall i put instead of str, D:\\Paul.pdf?
paulraj
|
|
|
|
|
Just for tracking the error. Please try like this and let me know the result...
#undef _INC_SHELLAPI<br />
#include <shellapi.h><br />
...<br />
...<br />
...<br />
void CPdf_ExampleView::OnBnClickedButton1()<br />
{<br />
CString str;<br />
str = "www.google.com";<br />
ShellExecute(NULL, "open" ,str, NULL, NULL, SW_SHOW);<br />
<br />
}
|
|
|
|
|
i got the output for MFC.
how to open in this for windows mobile6?
can help anybody?
paulraj
|
|
|
|
|
But what was the problem?
|
|
|
|
|
Probably the programmer?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Everything looks fine, except you should probably use SW_NORMAL , but this will not be the cause of your problems. What's happening? Are you still getting a compiler error?
Steve
|
|
|
|
|
I don't see anything wrong with your code. Is rebuilding the whole thing of any help?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
hi... i got it.......
thanks to all....
paulraj
|
|
|
|
|
You're welcome. Glad you got it done.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
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.
|
|
|
|