|
|
Hi,
I'm facing a problem in deleting a file using 'remove'.Let me explain the scenario.
The dialog based application has four dialogs in the following manner:In the main screen, if a button is clicked, the second dialog opens; from the second dialog third dialog gets opened, and so on.
The application deals with a file (say 'test.dat' - has objects of a class) in the fourth dialog. The file operations are: add, modify and delete objects.
An object is deleted by creating a temporary file using the 'test.dat' omitting the object to be deleted; the 'test.dat' is deleted using 'remove' function; the temporary file is renamed as 'test.dat' using 'rename' function.
First time the 'remove' function works fine. I am able to add & delete objects so many times. But If I close the fourth dialog and open again from the third dialog, the 'remove' function fails. I am getting the error 'ERROR_SHARING_VIOLATION' in GetLastError. But I have closed 'test.dat' file and the temporary file using 'fclose' function, before try to delete the file. I have opened the file as 'fopen("test.dat", "r")'
Give me your comments.
Thanks in advance.
sarvan al
sarvan_tech@rediffmail.com
|
|
|
|
|
I can't grasp the exact idea from your description, but the error message suggests the file is still open when you try to delete it.
Try closting the file first. Make sure your destructors are called when you expect them to be etc.
|
|
|
|
|
I want to place the text on the button the controls by using SDK
Things to be done are :
- Text position within the text control.
- Text color
- Text size and
- Text Font/Weight
-- modified at 3:36 Wednesday 11th January, 2006
|
|
|
|
|
There is a button class in MFC to do just that by drawing the whole thing as a graphic.
See MSDN.
|
|
|
|
|
S_a_n wrote: - Text position within the text control.
S_a_n wrote: - Text size and
- Text Font/Weight
Create A CFont Object with required attribute and attach to the Button variable...
S_a_n wrote: Text color
for that you have to subclass the Button
"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
|
|
|
|
|
|
Hi all,
How could I disable the changing of column width in a listctrl?
In my program the changing of column width of first column should not be allowed.
Thank you.
- NS -
|
|
|
|
|
HDN_BEGINTRACK
Returns FALSE to allow tracking of the divider, or TRUE to prevent tracking.
lParam has a pointer to an NMHEADER structure that contains information about the header control and the item whose divider is to be dragged.
But if you want to do it the easiest way do this:-
m_myListCtrl.GetHeaderCtrl()->EnableWindow(FALSE);
And I hope you know what EnableWindow(FALSE) does.;)
Jesus Loves <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
I am trying to execute an .sql file to creating tables in Oracle(8i) using CreateProcess() in my program and the system is giving my error that 'sqlplus.exe has encountered a problem and needs to close.' I want to know more about it
////////////////////////////////////
//assume :
CString cmd;
LPTSTR m_szCommand;
cmd.Format("C:\\oracle\\ora81\\bin\\sqlplus.exe man1/man1@rcrmtest @D:\\MainMaster.sql");
m_szCommand = cmd;
Success = CreateProcess(NULL, LPTSTR(m_szCommand), NULL, NULL, TRUE, 0, NULL,m_szCurrentDirectory,&StartupInfo, &ProcessInfo);
/////////////////////////////
As soon as the createprocess is executed I am getting 'Success' = true; but immediately am getting the above metioned warning.
Can you figure out the problem?
|
|
|
|
|
Have you actually tried running it manuall with the same parameters? I think you'll get the same errror because the problem is with sqlplus.exe, not CreateProcess (since it returns true).
|
|
|
|
|
can u tell the vc++ code for Downloading a file from http server.Not as web page but as file bytes by bytes.
|
|
|
|
|
Vineethg wrote: Not as web page but as file bytes by bytes.
look at URLDownloadToFile Function
"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
|
|
|
|
|
I have XP look and feel in my application. But there is a problem.
All controls are working and looking fine except for the scrollbars. Unless I click them they won't change to green(The standard LAF color for XP Scrollbars). Again I resize the window again they turn to gray. Dang!
Phew
Am I leaving out something.
Love Forgives--Love Gives--Jesus is Love <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
BTW. Are you using some sort of library to make that XP look and feel? I wonder if there is one, ever been looking for it...
|
|
|
|
|
HAND wrote: ever been looking for it...
Nope.
You just have to include YourExe.Manifest into your project. XP uses Commctrl version 6.0 library. So this look and feel can be implemented in XP.
Jesus Loves <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background:#ffaaaa">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
I want to do so. I make a window. Then, in that window, I run a program, but that program (the display of it, exactly) must be only in the window I made. Is it possible ??? And if yes, how can I solve it ????
|
|
|
|
|
It can be done.
The display properteis>screen saver property page does it.
Inspecting it with spy++ tells that the screen saver (*.scr) creates its window as a (grand grand grand)child of the property page window.
So just create a window in the child process and call SetParent on it with a HWND from the parent process
|
|
|
|
|
Is it possible if I want Age of empire or Word or Excel run in my window ??? I cant SetParent them.
-- modified at 4:01 Wednesday 11th January, 2006
|
|
|
|
|
It's possible. Force the main window of that program to be a child window of your main window. I did that once with sndrec32.exe
You'll have to deal with lots of nasty surprises, though.
|
|
|
|
|
HAND wrote: You'll have to deal with lots of nasty surprises
Like...
Jesus Loves <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background:#ffaaaa">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Like the owner felt after drawing you!!;P ..
where you went yesterday?? i was unable to find a matching blue color on the screen
0x0400:
"But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
|
|
|
|
|
Run
I was busy so couldn't log in. Nice to see you.
You changed your name to Vivek from T-1000.
Jesus Loves <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background:#ffaaaa">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
yeaaa... i didn't like the name.. and moreover i didn't want to use fake names like few people do here !!!!!!;P
,
it seems you have changed the scrolling banner color??what's special??
0x0400:
"But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
|
|
|
|
|
VivekuniQ wrote: i didn't want to use fake names like few people do here
Hmmm... Throwing sh*t at me. Huh
VivekuniQ wrote: it seems you have changed the scrolling banner color??what's special??
I've crossed 300 messages. He he
Jesus Loves <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background:#ffaaaa">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|