|
Hi,
you can't marshal a VARIANT, it isn't even supported by the CLR.
The only thing you could do is prototype it as an IntPtr (and ignore it, as you don't have any other method that can digest it).
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
|
|
|
|
|
I think you should marshal VARIANT type as System.IntPtr and next use Marshal.GetObjectForNativeVariant to convert it to valid CLR object.
[EDIT]
You could also write your own custom marshaler to provide for automatic marshaling from native to managed objects and back.See this MS sample.
Life is a stage and we are all actors!
modified on Thursday, September 24, 2009 7:10 AM
|
|
|
|
|
I use the following code to operate my treeview asynchronously.
IAsyncResult result = sourceTree.BeginInvoke(l_CreateTreeNodes, new object[] { sourcenode.Nodes[stables],destinationnode.Nodes[dtables],mSourceInfo.TableNames,mDestinationInfo.TableNames});
While(!result.IsCompleted){}
But asynchronous operation is not completed and 'result.IsCompleted" property is always 'false'.
So, the operation isn't existed from while loop.
I don't know why 'IsCompleted' property is always false.
|
|
|
|
|
If you need blocking calls, why to use BeginInvoke ? Use Invoke instead. It is synchronous and waits until the message is processed.
|
|
|
|
|
Not that it matters, but why {} rather than ; ?
|
|
|
|
|
Hi, I am running this code:
<br />
string fullFilename = "\\\\server\\share\\DL_JP_462153474_461535959_attest.JPG.pdf";<br />
byte[] bytes = File.ReadAllBytes(fullFilename);
and get this exception:
FileNotFoundException
"Could not find file '\\\\server\\share\\DL_JP_462153474_461535959_attest.JPG.pdf'."
The only problem is that the file does actually exist! Also, it works on files with shorter filenames in the same folder. For example:
\\\\server\\share\\DL_JP_448856461_461530268_462153469.pdf
Does anyone know what this is all about?
|
|
|
|
|
It's *highly unlikely* that System.IO.File is wrong, but more likey that the path provided is incorrect in some way.
try replacing this:
string fullFilename = "\\\\server\\share\\DL_JP_462153474_461535959_attest.JPG.pdf";
with this
string fullFilename = @"\\server\share\DL_JP_462153474_461535959_attest.JPG.pdf";
If you use the string with the @ symbol rather than your escaped version, you can copy the contents of the string you set fullFilename and perform some manual checks( such as pasting the path\\server\share\DL_JP_462153474_461535959_attest.JPG.pdf into explorer).
CCC solved so far: 2 (including a Hard One!)
|
|
|
|
|
So that is what the @ is for
Thank you for your answer, but I have to admit that I screwed up, and the file actually doesn't exist
I am working with some testdata, and someone placed an error there (possibly on purpose?)
That is a lot of hours wasted...
the difference_:
DL_JP_462153474_461535959_attest.JPG.pdf
DL_JP_462143474_461535959_attest.JPG.pdf
|
|
|
|
|
Thomas ST wrote: That is a lot of hours wasted...
We've all done this sort of thing!
CCC solved so far: 2 (including a Hard One!)
|
|
|
|
|
Good day
I am trying to serialize/deserialize a class (for the first time), and the serialization works fine, but as soon as I try to deserialize it, it gives me the exception:
System.Reflection.TargetInvocationException was unhandled
Message="Exception has been thrown by the target of an invocation."
Source="mscorlib"
InnerException: System.Runtime.Serialization.SerializationException
Message="Member '' was not found."
Source="mscorlib"
at Trainer.BoostedClassifier..ctor(SerializationInfo info, StreamingContext context)
The class I'm serializing contains a List<int> type, could this be the source of the error?
I would appreciate any ideas to what this exception might be hinting at. (let me know if more info is needed)
tvb
|
|
|
|
|
Sorry, I forgot to mention why my heading is called serializing an inherited class;
My class I am serializing also contains a list of my own object type (List<Object>), but the objects themselves are inherited instantiations.
In other words, I'm serializing:
MainClass <-- being serialized. Which contains,
List<Object> <-- where an the objects are of type,
InhertiedObj : Object
If that makes any sense?
I would post the code, but it is unfortunately very long.
tvb
|
|
|
|
|
Hi
Is it possible to create a word document without using third party libraries and the interop object in c
# programatically??
modified on Thursday, September 24, 2009 5:02 AM
|
|
|
|
|
|
Hi,
I have a form that gets data from DB,
i created an event when the form deactivate the current form gets this.Hide() and a new form is open.
my problem if how i can reopen the first window?
if i write-
FirstWindow frmFirst = new FirstWindow();
frmFirst.Show();
a new form is open, but not the first form (the one that i turn to Hide()).
How can i solve this????
|
|
|
|
|
You will have to either
1) Keep a reference to the original form and pass it to the new form when you create it, and before you hid the original.
or
2) hook into an event from the second form to the original form which causes the original to re-display itself.
The second is better practice as it doesn't require form2 to know anything outside itself - it just throws an "I'm done" event.
Niether is too complex, the second is a few extra lines of code.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
answer:
main Form
this.Hide();
MiniForm frmMini = new MiniForm( sender);
frmMini.Show();
frmMini.TopMost = true;
SubForm:
private void MainForm_Deactivate(object sender, EventArgs e)
{
this.Hide();
MiniForm frmMini = new MiniForm( sender);
frmMini.Show();
frmMini.TopMost = true;
}
private void MiniForm_Click(object sender, EventArgs e)
{
this.Close();
frmMain.Show();
}
|
|
|
|
|
I have a grid and some textboxes
Grid have data from database and i added a EDIT button with fields.
The thing i want is---->
Whenever i click on edit button the data associated with it will get display in textbox.
I hope u all got what i want.
Thanks in advance.
|
|
|
|
|
So whats the problem?
In the button click event, get the info from the selected cell of the grid, and put it in the text box.
Which bit are you having difficulty with? What have you tried?
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Nothing clicking in my mind, what code to write in it?
|
|
|
|
|
lalit14 wrote: Nothing clicking in my mind, what code to write in it?
Write a button click event handler, hooked to your button.
In the handler, write the code to:
1) Find the selected cell in your grid.
2) Get the text from the cell.
3) Put the text into your TextBox.
At least two of these are simple, one-line-of-code-at-the-most bits of software.
What have you tried?
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Thanks dude
its working....!!
|
|
|
|
|
You are welcome! Glad to hear it.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
OriginalGriff is Correct, if you want to edit the gridview in ASP.net, you must enable the appropriate properties that will show you the edit,Delete and update per row and if you click on Edit,you do not need to write a code to do that, ASP.NET already will do it for you. The Values will be Presented in a Textbox , and in edit more for you to edit and the Update and Cancel Button will be available options for you.
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
hi
i have two forms
i want after 3 seconds the first form is hiden and the second one is appeared
sorry for that silly question but the first form has user control that playing a movie
i trying to use the usually code to hide the first one
but
it is not disappeared and the second is appeared
thanks very much
Mohamed
|
|
|
|
|
Hard to tell without seeing the code. Could you post relevant code here?
|
|
|
|