|
thanks Christian ..
but i am still suffering
error null reference exception was unhandled
|
|
|
|
|
What line gives you the error ? Did you change your code completely to get rid of all the stuff I said was retarded and use delegates ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
F1.textbox1.text = label1.Text;
the exception fires on that line
i`ll try to delegate that ,but for now i need to solve the problem
|
|
|
|
|
Well, it would help if you knew what you were doing. I assume you have no idea what object is null ? Do you have any idea how to use the debugger ? Hit F9 with the focus on this line to set a breakpoint, hit F5 to debug and when the code stops on this line, you can hover over each object. Either F1 is null ( which seems unlikely as you cast it and don't use 'as' ), label1 is null ( unlikely as it's a local object ) or textbox1 is null. Once you work out which is null, you can work out why. Do you set the Owner of the form when you create it ? That may be the problem.
Mr.Kode wrote: but for now i need to solve the problem
Why ? This is surely not code that someone is going to use in real life ? It's a disaster, as I said.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
thanks Christian
i found where the error is
i forget that f1 have mdiparent to another form
but i want to know why i can`t set mdiparent and owner at the same time?
|
|
|
|
|
Because the owner exists entirely to create a relationship in terms of how the form is shown, and it's invalid if it's got an MDIparent instead.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
where you wrote this code?? under form1 or under form2?
what you really want do?please describe in details...
|
|
|
|
|
dude i think ur trying to move a string(lable1.text) from form1 to form2,it's easy.
for example u want have a button,when clicked u want to show second form.
form2 f2=new form2();
ok,now goto ur form2.cs code view,in the first lines u c something like this:
public form2()
{
initializecomponent();
}
now change the arguments that form2 needs,in the code above,u c that second form doesn need anything for being instanced,change it like this:
public form2(string labltext)
{
...
}
now when u want to make an instance of the second form,pass the string in that way:
form2 f2=new form2(label1.text)
in second form u can access the string throw variable labltext.
have fun
|
|
|
|
|
in my project, i need Serial No like 1, 2, 3, in sequence in date wise
for Example today is 28/10/2009......so the serial no should be like 1.2.3
and when the date changes it must start again 1.2.3
any idea ?
thanks for help
|
|
|
|
|
You don't mention what your data store is. ASsuming a SQL DB, the resetting numbers mean you can't use an identity column, you probably just have to write code to work out the next value for the current date.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
thanks for reply
i am using SQL DB
|
|
|
|
|
Sir i am trying like this....
getting the todays date and then number of records and then adding +1 to the number of records......
if date is changed (means next day) then again start from 1 and then +1 ....
is this right ?
thanks for help
|
|
|
|
|
It's your business rule, but I think you described it correctly, yes.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
thanks sir i got.........
thank you very much.......
|
|
|
|
|
In the following code, the size or the array is fixed to 16384 and I made changes to it to get errors. Can someone clearify why it is fixed?
byte[16384]???
private void Start()
{
Stop();
try
{
WaveLib.WaveFormat fmt = new WaveLib.WaveFormat(44100, 16, 2);
m_Player = new WaveLib.WaveOutPlayer(-1, fmt, 16384, 3,
new WaveLib.BufferFillEventHandler(Filler));
m_Recorder = new WaveLib.WaveInRecorder(-1, fmt, 16384, 3,
new WaveLib.BufferDoneEventHandler(DataArrived));
}
catch
{
Stop();
throw;
}
}
private void Voice_In()
{
byte[] br;
r.Bind(new IPEndPoint(IPAddress.Any, int.Parse(this.textBox2.Text)));
while (true)
{
br = new byte[16384];
r.Receive(br);
m_Fifo.Write(br, 0, br.Length);
}
}
|
|
|
|
|
What is WaveLib ? It seems odd that you'd need to use a certain value all the time, perhaps it just must be a power of two ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
As Christian Graus says, without knowing what WaveLib is, we really can't help.
This is just a hunch, but the magic number 16384 is repeated in you code,
have you tried something like this
const int Size = 16384;
private void Start()
{
Stop();
try
{
WaveLib.WaveFormat fmt = new WaveLib.WaveFormat(44100, 16, 2);
m_Player = new WaveLib.WaveOutPlayer(-1, fmt, Size , 3,
new WaveLib.BufferFillEventHandler(Filler));
m_Recorder = new WaveLib.WaveInRecorder(-1, fmt, Size , 3,
new WaveLib.BufferDoneEventHandler(DataArrived));
}
catch
{
Stop();
throw;
}
}
private void Voice_In()
{
byte[] br;
r.Bind(new IPEndPoint(IPAddress.Any, int.Parse(this.textBox2.Text)));
while (true)
{
br = new byte[Size];
r.Receive(br);
m_Fifo.Write(br, 0, br.Length);
}
}
Assuming this works you can then try changing the value of size to suit.
CCC solved so far: 2 (including a Hard One!)
|
|
|
|
|
hi
i build C# program on Windows-Mobile that connect to WebService through cradle
and work with ActiveSync.
the customer want me to change the program that the connection will be through IP cradle.
is it require me any code change ?
how to do it ?
thank's in advance
|
|
|
|
|
I have created some custom control (winform c# .net) that has a "switch" inside it.
Inside it, i've made a propety that "wraps" the switch & allow to toggle it.
Component works fine at run-time, but it sorta nags me it doesn't re-paint the control at runtime when i set the property via property editor.
If i rebuild project, it updates allright, but I wondered if there is any way to make it update as soon as i update the property while still in design-time.
Would appreciate any help on matter.
regards.
|
|
|
|
|
|
Thank you for the fast reply
From a quick look it seems like what i needed. I'll take closer look into the section called "To handle component changes" - as this is what i need in my case.
|
|
|
|
|
Normally calling Invalidate(); inside the property's setter if the value is changing is all that's needed.
Dave
"My code works, but I don't understand why!" - DaveyM69 (Me) BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
I'll try that as well. Thank you for your help.
|
|
|
|
|
I know how to pass strings, numbers, and the like back and forth to the embedded WebBrowser in a Windows Form, using InvokeScript and ObjectForScripting, but how does one pass images back and forth into the embedded WebBrowser?
I get empty images on functions that pass images to the HTML document's JavaScript. All the examples I can find show basic number and string passing, but nothing on passing images.
Any information is deeply appreciated.
|
|
|
|
|
You are more likely to get answers if you post this in the Web Development Forum.
If you decide to do that, you should delete this one, to avoid getting moaned at.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|