|
|
Hi,
I have done report genaration project in vc++.
I have show some data on the window from database and save that data into file. I just found out that it only crashes when the files are on the desktop.That is when i try to open the file on desktop using CFileOpendialog, my application going to closed.
But that file placed on any other drives like(c:,d:,..), nothing to worry, it will execute successfully...
|
|
|
|
|
Can you show me the code?
Is the buffer to which you recieve the file path, long enough to hold a maximum of 255 characters?
nave
|
|
|
|
|
Even the Desktop [folder] is in C drive.
C:\Documents and Settings\User\Desktop
There may be some other problem.
|
|
|
|
|
Are you correctly handling the spaces in the file name?
Judy
|
|
|
|
|
Hello Judy,
what is the right way to handle the spaces in the file name and file path?
regards
termal
|
|
|
|
|
Without seeing your code, I can't tell. It all depends on what you do with the name after you get it. Some of the APIs that take a file name (no, I don't remember which ones off the top of my head, and there isn't a list I'm aware of) need to have "" around a name that has spaces in it. Run with the debugger and see where it crashes.
Judy
|
|
|
|
|
JudyL_FL wrote: Some of the APIs that take a file name...
But what do those have to do with CFileDialog ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Nothing. I missed that the probelm was in that function and not after he calls it in the original post.
OP: Have you tried using the debugger? The CFileDialog class does handle the desktop correctly - I've used it to do that and it's fine. Using the debugger will pinpoint where the problem is. You've probably made some mistake in the setup prior to calling the function, and seeing where in the class the crash occurs will provice lots of clues about where the problem is.
You need to post some code and use the debugger.
Judy
|
|
|
|
|
Without seeing how you are using CFileDialog , help is going to be hard to come by. Have you tried using GetOpenFileName() to see if the problem is specific to MFC? What is the value of _WIN32_WINNT ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I am using a CListCtrl and SetExtendedStyle(LVS_EX_GRIDLINES) to create a grid control.
How do i increase the row height.
Thanks in Advance.
|
|
|
|
|
Sammyuk wrote: How do i increase the row height.
Either you need to increase the font
or
Owner draw the list control( In this case you will recieve a WM_MEASUSREITEM message with in which you can set the item height )
nave
|
|
|
|
|
MEASUREITEMSTRUCT which is associated with WM_MEASUREITEM can be used only for ListBox, ComboBox and Menu. But i want to increase the height of CListCtrl.
Sammyuk
|
|
|
|
|
Read the msdn carefully
http://msdn2.microsoft.com/en-us/library/ms673318.aspx[^]
it says "The WM_MEASUREITEM message is sent to the owner window of a combo box, list box, list view control, or menu item when the control or menu is created"
Also I have implemented it in one one of my project.:->
nave
|
|
|
|
|
Hello Naveen,
please can you be more specific about owner draw, do you know a sample how to use owner draw?
i like to learn more about this?
regards
termal
|
|
|
|
|
some controls such as combo box, list box, list view control,menu , button etc supports owner draw style. If we set this syle to the control, windows will not paint this controls. Intead it sends a WM_DRAWITEM message to the parent window of that control. we can handle this message( if your using MFC, you have to overide the DrawItem() virtual function) and draw the control in the fashion you like.
nave
|
|
|
|
|
hi friends,
can we use a form view in tab control(in a dialog based application)
if so suggest me how to create it
Thanks
|
|
|
|
|
hi friends,
can we use a form view in tab control(in a dialog based application)
if so suggest me how to create it
Thanks
|
|
|
|
|
Is it possible to use the same socket to read and write from the network ?
I usually use a socket for writing data and a socket for receiving.
Thanks
|
|
|
|
|
Yes, for example a UDP socket listens on a port and sends replies back to the other peer.
|
|
|
|
|
ilgale wrote: I usually use a socket for writing data and a socket for receiving.
Why?
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
How to set 1024x768 display resolution using C++ on MS-DOS?
|
|
|
|
|
"ChangeDisplaySettings" API can be used to change the settings of the default display device to the specified graphics mode.
Thanks & Rgds,
Sri..
|
|
|
|
|
What you have suggested can be sone using VC++. We are working in C graphics on Dos operating system.
|
|
|
|
|
And what compiler do you use?
nave
|
|
|
|