|
In the quickwatch see the base type of currencyManager.List.
That will definitely help.
|
|
|
|
|
Hello,
I am trying to use an old C++ library that generates nurbs curves with my C# program. The library is the nurbs++ one available online. I have come to the point where I think I need to write a wrapper to use the functions from the library in my C# program but I have one big problem. The nurbs++ library is all completely in templates, and I am unsure of how to write the wrapper with template functions. The MSDN guide to write wrappers is all in regular functions not templates, and I have also not been able to find any examples of how to wrap a C++ template class or funciton online anywhere. If anyone can help I could really use it. Please either point me in the right direction or give me a wrapped template function example.
Thanks a lot,
Michael Brown
|
|
|
|
|
If you need to keep the "templateness" of things, you are forced to use version 2.0 of the .NET Framework. BUT! Things are still not necessarily going to be easy then, since generics and templates are different creatures.
A simple solution (if it can work for you) is to create a non-template MC++ wrapper around a specialized template class. (For example, if you have a template class CCalc<T>, then create an MC++ wrapper called CCalcInt.) The other .NET languages can then easily use the non-templatized wrapper class.
John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.
-- modified at 13:35 Thursday 8th September, 2005
|
|
|
|
|
Why does C# NOT support default parameters when VB.NET and C++ do?
|
|
|
|
|
Because MS has decided they were a bad idea. Instead you should write overloaded method calls with the minimum params, all of them, and any intermediate combination that you feel is neccesary.
|
|
|
|
|
I have a form which i use to initiate my windows application in Application.Run()
and i need a way to access a function within that form.
I need to do this because i have another active form which has to update the form created in the Application.Run(), and ive managed to show/hide the main form but not to access its functions.
// Example. In form B which has its owner set to the main form
ActiveForm.Owner.Visible = false;
This affects the main form but i cant seem to find where the public functions are or to edit anything beyond basic frame parameters.
Does anyone know how i can do this?
|
|
|
|
|
You have to cast the return value of ActiveForm.Owner to the specific type.
if (ActiveForm.Owner is MainForm)
((MainForm) ActiveForm.Owner).Function(..);
www.troschuetz.de
|
|
|
|
|
I tried your way before and i also tried (ActiveForm.Owner as MainForm).function
but neither of them gives me access to functions.. why?
It seems like the form created in Application.Run() have much more privacy and restrictions to it than other forms created.
|
|
|
|
|
Which access modifier has the function? Did you declare it public or internal?
www.troschuetz.de
|
|
|
|
|
the function is public and the form class is declared like this:
public class MainForm : System.Windows.Forms.Form
|
|
|
|
|
I'm a bit at a loss than, cause in this case the given code should work.
What compiler error do you get for your code snippet (ActiveForm.Owner as MainForm).Function() ??
www.troschuetz.de
|
|
|
|
|
I am writing a windows service which will manage image capturing devices, when client connects to the service, at some point the service need to expose a device dialog to the client. According to MSDN docs, classes within the Windows Forms namespace are not supported for use within a Windows service. So How can I do that?
Thanks!
Hang
|
|
|
|
|
You can't. You cannot send a dialog reference from a web service. You're going to have to capture the image from your insert device here using some other method. That method depends on your device. Then serialize and send the image it captured. You can't send a dialog like that.
In short, Web Services deal strictly with data. They cannot provide any kind of user interface to a client what-so-ever.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 12:49 Thursday 8th September, 2005
|
|
|
|
|
I have an array of objects of a class having 10 fields. The first 5 fields should behave like composite keys of a sql table. So only objects conforming to the constraint can be added.
I dont want to use it.
I just need a simple logic to implement this in an ArrayList.
|
|
|
|
|
Hi,
I have a very strange problem which i hope someone can help shed light on.
I have a Windows Forms application which provides data-entry UI. Data
inputted is then stored into a DataSet which will be persisted into a XML
file using the WriteXML method.
The Dataset which contains a Filename data column (type = string); A user
selects a file using the OpenFileDialog component. The file name is
displayed in a textbox until the user clicks on the Save button.
PROBLEM:
If the file is selected using the OpenFileDialog.ShowDialog() method, the
file name is added to the dataset, but it is not written to the XML file.
However, if the filename is manually typed into the textbox, saving to XML
file succeeds.
This is a very strange problem, any help will be very much appreciated!
Thanks.
|
|
|
|
|
I can guarantee that the problem is in your code and not the OpenFileDialog. It looks liek you're putting the filename into the TextBox, but your not updating the dataset with the new name.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I'm trying to read the input of my IR Controller by raw input. I managed to get lParam (pointer) and some other variables out of it, and now I want to extract it to useable data.
I'm now able to make a difference between WM_INPUT of some other type, but there are like 10 keys on the remote using WM_INPUT. lParam seems the only parameter containing the info I need...
Thanks in advance.
|
|
|
|
|
It sounds like you'll need to use some of the P/Invoke techniques. Look in the System.Runtime.InteropServices.Marshal class for some methods that you might need for handling the memory. Also, you will probably need to create a struct (marked with StructLayout(LayoutKind.Sequential)) that exactly matches the structure which your lParam is pointing to.
Read up on the P/Invoke stuff (Platform Invoke), and you'll probably fill in the important gaps in your understanding.
John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.
|
|
|
|
|
MSDN is your best friend in this case. According to MSDN, lparam is a "Handle to the RAWINPUT structure that contains the raw input from the device". Dig deeper here is the article on the structure: MSDN: RAWINPUT structure[^]
Alex Korchemniy
|
|
|
|
|
Found a nice sample code: http://blogs.simplifi.com/brucet/downloads/remotecontrolsample.zip
It may help some others as well.
|
|
|
|
|
Hi,
I have a System.Drawing.Bitmap of a screen capture that I want to convert to a byte array. Any ideas on how to do this? I expected the bitmap object to have some sort of ToArray method, but it hasn't.
I'm rather stumped.
TIA
Dr Herbie
Remember, half the people out there have below average IQs.
|
|
|
|
|
You can save the image to a System.IO.MemoryStream , which does have the elusive ToArray method.
Charlie
if(!curlies){ return; }
|
|
|
|
|
This should do the trick
public static byte[] GenerateImageBytes(Bitmap bm)
{
byte[] bytes = null;
System.IO.MemoryStream ms = new System.IO.MemoryStream();
bm.Save(ms, ImageFormat.Gif);
bytes = ms.ToArray();
ms.Close();
return bytes;
}
Thomas
|
|
|
|
|
Or, with slightly more pleasant syntax, with better resource management:
public static byte[] GenerateImageBytes(Bitmap bm)
{
using(MemoryStream ms = new MemoryStream())
{
bm.Save(ms, ImageFormat.Gif);
return ms.ToArray();
}
}
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Cops & Robbers
Judah Himango
|
|
|
|
|
Yes, this looks greate
But, will the MemoryStream be closed (ms.Close())?
|
|
|
|