|
It seems from what you say that the compilation went fine, and it failed at run-time, right?
From my personal experiments, I would avoid to use VARIANT* because the marshaler does not know how to marshall all variant subtypes.
You may need to add a [MarshalAs...] attribute to bind to a specific subtype, especially if you know that VARIANT* references a BSTR for instance.
if you start putting in too manay features, it no longer remains useful for beginners
quote in a CP article comment, shiraz baig
|
|
|
|
|
How do I use MarshalAs in Cleint app?
I looks like it's an attribute in interface declaration.
Also. How do you pass an array of longs backfrom MFC server to C# client without using VARIANT*?
And! How do you pass an array of strings from C# cleint to MFC server?
|
|
|
|
|
you need not an interface declaration to put a MarshalAs attribute. Get used to it. You can put attributes ANYWHERE in your code.
you usually pass an array of long as a SafeArray .
You've got doc and sample code here [^]and here[^].
sometimes it helps to look at the IL generated code
a MS guy on develop.com "answering" .NET issues
|
|
|
|
|
Can anyone tell me how to go about setting up and using an MS-SQL connection (ADO) in C#?
Thanks,
Derek
|
|
|
|
|
Maybe this help you:
http://www.codeproject.com/aspnet/adodotnet.asp[^]
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
I create an app in C# and put my controls on right side. I intend to dock an Outlook type toolbar on the left. So inside the development I have two forms My original form NHN.cs and my outlook bar called OLBar.cs I want to doc the OLBar.cs to the left side of NHN.cs.
1) How is this accomplished.
2) The Outlook Bar code that I download from http://www.codeproject.com/cs/miscctrl/outlookbar.asp seems to be a nice
toolbar but for the life of me I can't get that docked to the left onto my NHN.cs form.
Has anyone used this Outlook toolbar that might be able to offer some help OR does anyone know another way to add an outlook toolbar on a form?
Many Thanks,
Derek
Derek@NeedHelpNow.com
|
|
|
|
|
You basically need to use the DockStyle to position elements on a container type object.
You could create a panel to host your forms. Assuming Form1 is the one you want on the right side, you could do something like this:
panelRight = new Panel();
panelRight.Dock = DockStyle.Fill;
form1 = new Form1();
form1.Parent = panelRight;
panelLeft = new Panel();
panelLeft.Dock = DockStyle.Left;
splitter1 = new Splitter();
this.Controls.AddRange(new System.Windows.Forms.Control[]
{panelRight, splitter1, panelLeft});
The order of adding things to this.Controls above is important.
panelLeft could be the parent of your Outlookbar control.
Gaulles
http://www.gaulles.com
|
|
|
|
|
Derek Smigelski wrote:
Has anyone used this Outlook toolbar that might be able to offer some
I have used it.
I use a panel (which I can change) that fills all the client area of my main window (panel.Dock = DockStyle.Fill).
Then I create a Splitter, assignig its parent as the main form, and set its Dock property to DockStyle.Left.
Finally I create the outlook bar, I assign its parent as the main form, and set its Dock property again to DockSytle.Left.
And there, you have a resizable Outlook bar on the left.
-- LuisR
──────────────
Luis Alonso Ramos
Chihuahua, Mexico
www.luisalonsoramos.com
"Do not worry about your difficulties in mathematics, I assure you that mine are greater." -- Albert Einstein
|
|
|
|
|
When the control calles this method on itself, and its scrollbars are showing, does this only paint the visible bit, or the non-visible bit as well?
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
You're going to hate this answer, but it paints whatever the control wants to paint.
Part of the Paint event tells it what part needs to be redrawn, but if the control ignores that it will attempt to redraw everything. The paint event is smart enough to set the clipping area so only the part that was supposed to be redrawn actually gets refreshed in the control.
James
Sig code stolen from David Wulff
|
|
|
|
|
if i have a class like
class{
String *str;
int a ;
}
i want to right its object into file.after that i want to send it to different computer through network and again want to read it again if i have the same class there may i read it into that class object.
is it possible ?
can any body tell the syntex of reading and writing an object into file?
r00d0034@yahoo.com
|
|
|
|
|
|
A bundle of thanks.
i need a little more help how to write data using FileStream into a file or read theobject from a file to the FileStream object only then it is possible to serialize or Deserialize it?
HOW to creat FileStream object that coud write into a file ?
can you explain any of its constructor?
i want to write a hastable object into a file that contain class objects,and class objects further contain hashtable and other class objects.
may i write that hashtable into a file and retrive again?
i study the api but could not understand what methods to use.
r00d0034@yahoo.com
|
|
|
|
|
|
thanks again.
one more question.this line of code
bf.Serialize(stream, data);
alwas write data at the end of file or not ?
i mean where it write in the file.
this line of code
object obj = bf.Deserialize(stream);
alwas read data from the begining of file or not ?
i mean where it read from the file.
r00d0034@yahoo.com
|
|
|
|
|
im not sure, i presume it reads from where ever the current position, set in stream.Seek to the end of the file, but i cant swear to it.
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
Is it possible to call upon video for windows VFW in C#? Is there any existing code for compressing an AVI in C#? Thanks for any help or links you can provide.
|
|
|
|
|
Anything you do with WIN32 and C/C++ is possible in C# thanks to interop.
When you know the method signature, you just need to declare it in your code with a [DllImport("dllname")] attribute like in ::SendMessage :
[DllImport("user32.dll", CharSet=CharSet.Auto)]
public static extern IntPtr SendMessage(IntPtr hWnd, int msg, int wParam, IntPtr lParam);
Even more interesting is that in your case there are COM components. And the VS.NET IDE automatically imports their type-library, wrap interfaces and makes them look like any namespace to you. That's what you get for instance when you need integration with Internet Explorer, MS Office, ...
Now about DirectShow itself, this SDK has both COM Components and simple low-level APIs. Just help yourself. Below is 2 CP articles about it :
DirectShow media player[^]
DirectShow.NET[^]
You've got an introductory article about DirectShow in MSDN Mag - july 2002[^].
if you start putting in too manay features, it no longer remains useful for beginners
quote in a CP article comment, shiraz baig
|
|
|
|
|
|
|
Nnamdi Onyeyiri wrote:
oh, and im not gonna ask if there is something specific i have to do to my collectionbase derived class, to make the windows forms designer use the collection properly
You just need to implemenet an indexer We had plenty disscussions about that during the last week. Have a look at the CollectionEditor class for more details, I'm still trying to figure out how to add multiple types, it sure did look easy
Cheers
PS: Where have u been?
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
public class EBGroupCollection : CollectionBase
public EBGroup this[int index]
{
get
{
return (EBGroup)this.List[index];
}
set
{
this.List[index] = value;
}
}
public EBGroupCollection()
{
}
public void Add(EBGroup value)
{
this.List.Add(value);
}
}
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
I just don't get those strange indexers.
Nnamdi Onyeyiri wrote:
EBGroup this[int index]
It looks like the good old C++'s operator[]
Ñ There is only one MP Ð
|
|
|
|
|
Yes , the quote button is gone, they are the same
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|