|
What are you getting at?
You want it so noone can delete the file, ever? Or just when you program is running?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
Open it with Exclusive access and leave it open for the duration of your application if you want. But, this is considered VERY BAD practice.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How about folders and how opening file with exclusive excess
|
|
|
|
|
You can't lock a folder.
You've never specified what language your using, so I'm going to assume VB6. Open statement[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
There is a form named "Form1" and a function for creating its object. the form name is passed to the function and creates an object
public function CreateObj(p_sformName as string) as object
dim obj as object
' create the object of a form. The form's name is passed from the calling place
set obj = new p_sformname
end sub
Is it possible
Thank you in advance
Panal prasad
|
|
|
|
|
panalprasad wrote:
set obj = new p_sformname
the syntax is incorrect. as you wrote it, you try to new an object which type is p_sformName.
replace it with obj = new String(p_sformname)
this will create a new string which content is identical to the parameter passed to the CreateObj() function.
now, if you want to create an object with another type than String, you must use a constructor that gets a String as parameter ; if it doesn't exist, you'll have to create it certainly...
but i cannot help you more as your post is a bit too vague for me to know what you're looking for exactly
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
The obj variable is needed for seting the form object. and the name of the form is p_sformname. so if p_sformname="Form1" then obj will assaign an object of Form1
|
|
|
|
|
By your use of the Set statement, I take it your using VB6. VB6 can't do what you want.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
In our application we are using 5 basic Dll's on which our whole project is based. These 5 Dll's always run at server & client (Forms) accesses these Dll'd via remoting . The client forms have the references of these Dlls. But they invoke the object of these Dlls Remotely. Problem is when i compile any of the 5 base Dlls then the .Net Security throws the Security Exception . To run the forms i have to recompile all the forms with newly compiled Dlls, which is a nightmare, how to solve this riddle?
Project is developed in Vb.Net 2003 FrameWork 1.1
Backend Used is Oracle 9i
lokin for a quick response.
help pls
|
|
|
|
|
Is there a way to reset the position of a child form in the parent/main form? I'm using VB6.
<italic>Work hard, Work effectively.
|
|
|
|
|
|
You mean using the move function? I don't want to use that. I want to reset the form position.
<italic>Work hard, Work effectively.
|
|
|
|
|
to reset to where ???? the initial place ?
i think you'll have to store those values first to recall them then...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Open first form position ( 0,0)
open second form (100,100)
third form (200,200)
close all form
open fourth form, it will be (300,300), but I want it to be reset, into (0,0). Got it?
<italic>Work hard, Work effectively.
|
|
|
|
|
Have you looked at the Top and Left properties of your child form?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote:
Have you looked at the Top and Left properties of your child form?
Yes, what do I have to do with it? The form position it self,when it's opened. I think the parent form must be the one, which calculate the position automatically, like the cascade. How to reset the child position remembered by the parent form?
<italic>Work hard, Work effectively.
|
|
|
|
|
The parent form doesn't remember anything about the child form, other than it exists. Windows picks the default position of the form unless you set the properties of it before you show it.
Dim newChildForm As New Form2()
... other MDI setup stuff
newChildForm.Top = whatever
newChildForm.Left = whatever
newChildForm.Show()
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm using VB6 Dave. Like I said before, when I open a form the position will be (0,0), when another from is opened, position will be (100,100), just like the cascade. When I close those two form , and open a new one, the position will be (200,200) not (0,0) (which I want it to be). I gave up, I think there's no way for that. Maybe the only solution is to manually position the form like you said.
<italic>Work hard, Work effectively.
|
|
|
|
|
So...? Nothing changes! All you do is create an instance of your child for, set its position to what you want, then show it. What's problem?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
What I want?
Form 1 open (0,0)
Form 2 open (100,100)
form 3 open (200,200)
form 2 close
form 4 open (100,100) <- this is want I want, but the application automatically sets the position to (300,300).
<italic>Work hard, Work effectively.
|
|
|
|
|
What part of "just set the Top and Left properties of the child form before you show it" don't you understand????
Dim newChildForm As New Form2
... other MDI setup stuff
newChildForm.Top = 100
newChildForm.Left = 100
newChildForm.Show()
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I understand the Top and Left properties. What I don't understand is the calculation of position, when it is (100,100), when it is (200,200), when (400,400). In other words, what is the position will I put the form. I want the form to be showed like cascade.
<italic>Work hard, Work effectively.
|
|
|
|
|
You'll have to remember the positions of all the child forms, keeping them in an array. Create an array and initialize each element to -1, -1. When you want to add a new child form, you'll have to search through the collection looking for a free "slot", which is represented by -1, 1. Calculating the child form positions isn't hard since each is a constant offset from the previous position. So, if your free "slot" is in array index 2, you just need to multiply that by the X and Y (Top and Left) offsets to get the position of the form. In your example, by 100. Put that position in the array at that index. When a form is closed, you'll have to reset that position in the array to -1, -1.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Yeah, I know I can do it. I was just hoping there's a simpler way. Thank you Dave.
<italic>Work hard, Work effectively.
|
|
|
|