|
thanx for solution
prashant jain malviya national institute of technology
|
|
|
|
|
Hi
What would be the best way of comparing two dates, so i am left with the difference in days
between the two dates
thanks
si
|
|
|
|
|
|
See Here[^]maybe it is some helpful to you
whitesky
|
|
|
|
|
I'm developing a piece of equipment that requires me to send data via USB. I open a text file and click another button to send it.
I found CFileDialog crashes with an access violation after about the third 'visit' to my desktop. This happens whether I open a file or not.
I thought it might be something in MFC, so I created a simple SDK app and used the following:
OPENFILENAME ofn; <br />
char szFile[1000];<br />
<br />
szFile[0] = '\0'; <br />
ZeroMemory(&ofn, sizeof(OPENFILENAME));<br />
ofn.lStructSize = sizeof(ofn);<br />
GetOpenFileName(&ofn);
This is the ONLY code I added to the bare app. And this crashes too. Only when visiting the desktop and only on the third or fourth 'visit'. I haven't tried it on other machines / OS. I'm running XP Pro SP2.
RA
|
|
|
|
|
You may have to initialize other members of the OPENFILENAME structure.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
I have tried all that! It makes no apparent difference what I initialise and what I don't. It also happens for both CFileDialog and GetOpenFileName.
RA
|
|
|
|
|
your problem is GetOpenFileName or you get a error when use this function
whitesky
|
|
|
|
|
The application crashes. I get a message box: "Unhandled exception in BareSDKTest.exe (SHELL32.DLL): 0xC0000005: Access Violation". When not debugging, the app just ends.
Interestingly, it seems to happen as the little box with the information about the file under the mouse pointer pops up.
It only happens when I access the desktop, only on the third or fourth occasion and only when the mouse goes to select a file. It also happens if I use the tab/cursor keys.
It doesn't happen with other directories. The file type under the mouse makes no difference either.
RA
|
|
|
|
|
|
Thanks! That's really useful. I also have Acrobat 7.0 and have experienced exactly the symptoms described.
At least it's not me!
RA
|
|
|
|
|
im not sure your problem is this but can you run this code ,please and send me that it work or you get previous error
<br />
OPENFILENAME m_ofn;<br />
static char lpFile[260];<br />
LPCSTR szFilter="";<br />
memset(&m_ofn, 0, sizeof(m_ofn));<br />
m_ofn.lStructSize = sizeof(OPENFILENAME);<br />
m_ofn.hwndOwner = m_hWnd;<br />
m_ofn.hInstance = AfxGetApp()->m_hInstance;<br />
m_ofn.lpstrFilter = szFilter;<br />
m_ofn.lpstrCustomFilter = NULL;<br />
m_ofn.nMaxCustFilter = 0;<br />
m_ofn.nFilterIndex = 0;<br />
m_ofn.lpstrFile = lpFile;<br />
<br />
m_ofn.nMaxFile = sizeof(lpFile);<br />
m_ofn.lpstrFileTitle = 0;<br />
m_ofn.nMaxFileTitle = 0;<br />
m_ofn.lpstrInitialDir = NULL;<br />
<br />
m_ofn.lpstrTitle = "Open a File";<br />
m_ofn.nFileOffset = 0;<br />
m_ofn.nFileExtension = 0;<br />
m_ofn.lpstrDefExt = NULL;<br />
m_ofn.lCustData = 0;<br />
m_ofn.lpfnHook = NULL;<br />
m_ofn.lpTemplateName = NULL;<br />
<br />
m_ofn.Flags = OFN_EXPLORER|OFN_HIDEREADONLY;<br />
GetOpenFileName(&m_ofn);<br />
whitesky
|
|
|
|
|
Thank you for your help. I had to slightly alter the code you sent:
char szFilter[256];<br />
OPENFILENAME m_ofn;<br />
<br />
char file[256];<br />
char* lpFile;<br />
.<br />
.<br />
.<br />
case ID_FILE_WHITESKYOPEN:<br />
lpFile = file;<br />
*lpFile = '\0';<br />
ZeroMemory(&m_ofn, sizeof(OPENFILENAME));<br />
<br />
m_ofn.lStructSize = sizeof(ofn);<br />
m_ofn.hInstance = hInst;<br />
m_ofn.lpstrFilter = szFilter;<br />
m_ofn.lpstrCustomFilter = NULL;<br />
m_ofn.nMaxCustFilter = 0;<br />
m_ofn.nFilterIndex = 0;<br />
m_ofn.lpstrFile = lpFile;<br />
<br />
m_ofn.nMaxFile = sizeof(lpFile);<br />
m_ofn.lpstrFileTitle = 0;<br />
m_ofn.nMaxFileTitle = 0;<br />
m_ofn.lpstrInitialDir = NULL;<br />
<br />
m_ofn.lpstrTitle = "Open a File";<br />
m_ofn.nFileOffset = 0;<br />
m_ofn.nFileExtension = 0;<br />
m_ofn.lpstrDefExt = NULL;<br />
m_ofn.lCustData = 0;<br />
m_ofn.lpfnHook = NULL;<br />
m_ofn.lpTemplateName = NULL;<br />
<br />
m_ofn.Flags = OFN_EXPLORER|OFN_HIDEREADONLY;<br />
<br />
GetOpenFileName(&m_ofn);<br />
break;<br />
But I am afraid it still does the same thing. It seems from the other replies I have received to my posting that this is not unique to me and somehow seems to relate to Adobe Acrobat 7.0.
I have not yet tried removing Acrobat 7.0 from my computer to prove the point.
Thank you again for your interest and help.
RA
|
|
|
|
|
Another post here suggested this company's software as a replacement for reading PDF files...
http://www.foxitsoftware.com
I've seen better runs in my shorts! - Patches O'Houlihan
|
|
|
|
|
|
http://x02.xanga.com/8aba2b046373560365677/m40459493.jpg[^]
Just like that. That is writen by C++. And i want to display the web image when i click the name in the list.
Is there any source code for displaying a web image into window application?????
web image is like that "http://x02.abc.com/peter.jpg"
-- modified at 4:02 Thursday 15th June, 2006
|
|
|
|
|
In your dialog you can put a Microsoft Web Browser ActiveX control, then use the Navigate2 member function to display the image. You can even display Web sites, not only images.
Alternatively, you can try to download the image using CHttpConnection MFC class, and then display it in a picture control.
|
|
|
|
|
Is there any example?? I am only a beginner of C++.
|
|
|
|
|
mimimimilaw wrote: Is there any source code for displaying a web image into window application?????
You may use the IHTMLDocument or IHTMLDocument2 Interface for this.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
It seem too difficult to me....Is there easier way?
|
|
|
|
|
I guess you want that read links in one page and if this link is image then you download it,right?
whitesky
|
|
|
|
|
|
|
Hi,
I need to provide the user the ability to view and modify arrays that can have any dimensions. Which control or interface would you suggest to use for this to be nice ?
Thanks !
|
|
|
|
|
Tnarol wrote: Which control or interface would you suggest to use for this to be nice
CListCtrl
nave
|
|
|
|