|
Hello all!
I have been searching for days, and days, on what seems to be a somewhat complicated and confusing matter: Passing a C++ STL Map (with a user-defined struct type) to C# via interop services.
First off, I am fairly new to C# and the world of Windows programming so that keeps me stumped on many articles I have read. I have explored some COM concepts, as well as simply using P/Invoke, but have yet to find something that works.
Is there any way to do this in a manner that is fairly straight forward? Does anyone have any examples or tutorials I can go by?
Basically what I want to do is call a C++ method (probably through p/invoke) and that method will return to me an STL Map (or vector) with a user-defined struct as its type. I need to be able to iterate through this collection pulling out each struct field and examining it.
I am stumped...
Thanks for all your help, I really appreciate it
Maurizio
|
|
|
|
|
|
Hmm, that is a very good idea. I think I will give that a try Thanks!
|
|
|
|
|
Hello everybody. I am trying to add a button in a textbox. When the textbox is focused, then the button will appear at the end of the textbox just like when you click on the items property of a listbox, a ... button will appear. Does anybody have some idea how to do this function please??? Thanks
Asura
|
|
|
|
|
Button box have Parent property Which you Can You Set it
To TextBox So You May Write Sothing Like This
private void textBox1_Enter(object sender, System.EventArgs e)
{
button1.Parent=textBox1;
button1.Location=new Point(textBox1.Width-Button1.Width,0);
}
MCAD
|
|
|
|
|
Hi there!
I have a problem. What i want to do, is opening a remote file on the internet (a xml file) for reading in my application. The remotehost is not running any serving functions, the file is just available on the internet.
Is there anyone who knows how to do this?
Thanks in advance!
|
|
|
|
|
I wrote an article regarding this issue. The only major drawback is that this method doesn't function in all windows versions...
|
|
|
|
|
Erhm. Thanks for taking the time to reply to the topic, but that was a link to a article regarding "ExtendingFileDialogs"
|
|
|
|
|
You can use the HttpRequest class to request the file.
---
b { font-weight: normal; }
|
|
|
|
|
Yes! thanks you.
Been struggeling with this for hours!
|
|
|
|
|
If I open the openFileDialog, usually I must select the view to "Details" manually. How can I automate that ?
I want to set the view to "Details" automatically, if I open the openFileDialog.
|
|
|
|
|
Use the extended OpenFileDialog in
http://www.codeproject.com/cs/miscctrl/FileDialogExtender.asp
Live Life King Size
Alomgir Miah
|
|
|
|
|
I'm making use of a datagrid, How do you get the current value of a specific cell (row 0, col 0) after the user sorts by clicking on the columnheader? This is what I tried using the MouseUp event but I seem to be getting the value of the cell before the sort.
private void dGrdFamily_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
//if left mouse is clicked
if(e.Button == MouseButtons.Left)
{
Point pt = new Point(e.X, e.Y);
DataGrid.HitTestInfo hti = this.dGrdFamily.HitTest(pt);
if(hti.Type == DataGrid.HitTestType.ColumnHeader)
{
this.textBox2.Text = this.dGrdFamily[0,0].ToString();
}
}
}
|
|
|
|
|
If the DataSource is a DataTable you can use
private DataRow GetDataRowAt(int index)
{
DataRow dataRow = null;
CurrencyManager currencyManager = null;
currencyManager = (CurrencyManager)this.BindingContext[this.dataTable];
if ( currencyManager != null )
{
dataRow = ((DataRowView)currencyManager.List[index]).Row;
}
return dataRow;
}
Live Life King Size
Alomgir Miah
|
|
|
|
|
Hi:
Thanks for your help. I tried your suggestion but I came across the same problem. It seems like the MouseUp event that I'm using may not be the best event to use in this case. It seems like it is obtaining the row value prior to the actual sort of the datagrid values.
Do you know of any event that I can implement to notify me when a change has occurred in a cell/row value (not change in row index)??
|
|
|
|
|
Use the datagrid.Refresh() function...
|
|
|
|
|
can somebody show me how to link two table and save it as view
using sqldmo
|
|
|
|
|
hi to all,
witch reference do i have to add to see the flexgrid and hierarcical flexgrid control in my toolbox
best regards and thanks in advance
fady
|
|
|
|
|
Flexgrid last shipped with Visual Studio 6 (old school). It doesn't ship with VS.NET (same deal for heirarchical flexgrid, I think). If you want to write apps with it you have to fork out for the license for VS6, install the old VS on your dev machine with VS.NET and access the controls using interop.
I miss it too. So lightweight. So easy to code against...
Sean
|
|
|
|
|
i want to add a dll which have two function one is for reading data from the parallel port and one is for writing data to parallel port using c#.
how i will use this dll and call its function please tell me.......
|
|
|
|
|
open a new project
select class
type in your code
make sure the functions are public class
bulid ths solution
save the project
close the project
open your project
use the Using to call the dll
like
using projectdll;
create a reference type like
project.Adddate mydate=new project.adddate
you can now use the instatiated object
mydate.adding(rttr,teert);
if it returns a string
declear a string reference type
s=mydate.adding(rttr,teert);
|
|
|
|
|
|
I am starting as novice in C# express beta 2 and would like to learn how to manipulate database files ie *.dbf files.
Amending, adding and outputting as a new dbf file (in ODBC)
Can anyone supply me some code with instructions.
thanks
BS
|
|
|
|
|
Is there any way to paint on a browser control? Can't use .CreateGraphics() because it doesn't have that function, so I was just wondering if anyone knew how to do this some other way? Any invalidation or something? Please help...thanks!
|
|
|
|
|
Hi all !
I have build a remoting server as a simple application using a WinForm to show messages.
The WinForm program starts a serverprogram, that registers a RemotableObject to be run in singleCall mode. The Server has an event (taking a string var) which the WinForm registers a method to, so that a RichTextBox in the WinForm will show any text from the stringvar on the event.
The RemotableObject on its side, has a static event which the server (abovementioned) registrs a method (on itself) to, just delegating the incomming event (from the remotableObject) on to the WinForm by firing its own even, thus sending the incomming text to the Winforms registered medthod.
That is: every time anything interesting happens on the remotableObject it fires the event, which the server has registered to - and receiving the text from the remotable object the server "sends" it to the WinForm (by firing its own event, which the WinForm has registered to) thus displaying the text from the remotable object in its RichTextBox control.
If I run some program, using the remotableObjects methods, everything works fine the first couple of times, but then the WinForm program crashes with a NullPointer error (actually the debugger traces this to happen just after the Application.Run statement starting the WinForm)
If then I replace the RichTextBox display with a Console.Writeline of the exact same text (at the exact same place, as the winform displays the text in the RichTextBox) I can go on and on without any errors, getting everything displayed in the console output.
Any ideas about why the RichTextBox causes the crashing ???
TIA
|
|
|
|