Click here to Skip to main content
15,887,485 members
Home / Discussions / C#
   

C#

 
AnswerRe: Arraylist problem!!! Pin
Calla21-Sep-09 22:21
Calla21-Sep-09 22:21 
GeneralRe: Arraylist problem!!! Pin
bounik21-Sep-09 22:36
bounik21-Sep-09 22:36 
GeneralRe: Arraylist problem!!! Pin
Calla21-Sep-09 22:41
Calla21-Sep-09 22:41 
AnswerRe: Arraylist problem!!! Pin
OriginalGriff21-Sep-09 22:33
mveOriginalGriff21-Sep-09 22:33 
GeneralRe: Arraylist problem!!! Pin
bounik21-Sep-09 22:46
bounik21-Sep-09 22:46 
GeneralRe: Arraylist problem!!! Pin
Amit Patel198521-Sep-09 23:23
Amit Patel198521-Sep-09 23:23 
QuestionExport and save dataset to excel Pin
kdwarak21-Sep-09 17:41
kdwarak21-Sep-09 17:41 
AnswerRe: Export and save dataset to excel Pin
Programm3r21-Sep-09 20:24
Programm3r21-Sep-09 20:24 
GeneralRe: Export and save dataset to excel Pin
kdwarak22-Sep-09 1:16
kdwarak22-Sep-09 1:16 
GeneralRe: Export and save dataset to excel Pin
Programm3r22-Sep-09 1:26
Programm3r22-Sep-09 1:26 
AnswerRe: Export and save dataset to excel Pin
Amit Patel198521-Sep-09 23:35
Amit Patel198521-Sep-09 23:35 
QuestionIs it possible to reconnect an event without raising it? Pin
CBenac21-Sep-09 13:19
CBenac21-Sep-09 13:19 
AnswerRe: Is it possible to reconnect an event without raising it? Pin
Gideon Engelberth21-Sep-09 15:54
Gideon Engelberth21-Sep-09 15:54 
GeneralRe: Is it possible to reconnect an event without raising it? Pin
CBenac22-Sep-09 8:30
CBenac22-Sep-09 8:30 
QuestionHow to start a NamedPipeClientStream and a NamedPipeServerStream together Pin
AndyASPVB21-Sep-09 13:19
AndyASPVB21-Sep-09 13:19 
AnswerRe: How to start a NamedPipeClientStream and a NamedPipeServerStream together Pin
Michael Eber22-Sep-09 19:15
Michael Eber22-Sep-09 19:15 
QuestionSilverlight replace elements app Pin
User 602357121-Sep-09 11:14
User 602357121-Sep-09 11:14 
AnswerRe: Silverlight replace elements app Pin
Henry Minute21-Sep-09 11:35
Henry Minute21-Sep-09 11:35 
QuestionProblem with delegate for C++ DLL callback function Pin
Matthew Page21-Sep-09 11:10
Matthew Page21-Sep-09 11:10 
First, let me say that I am not a C# programmer. Complete newb here... Don't hate me because I'm beautiful...

I am trying to create a drop-dead simple application that will set a function callback address in the C++ COM dll to point to a C# function in the demo application. (This is for a sample application to demonstrate our API to potential users.) I have it working for both C++ and Visual Basic, but thus far, C# success is eluding me.

Here is what I have done...
Created a simple form with three text boxes that will be filled with XYZ values when everything works.
Within the namespace of my app (TestCSharpApp... so I lack imagination... sue me...) I have created a delegate function like this.

public delegate void coordCallbackFunction(double x, double y, double z, int buttonNumber );

In my public partial class Form1 : Form class, I have the function I want to call.
public void coordHandler(double x, double y, double z, int buttonNumber)
{
   xCoord.Text = x.ToString();
   yCoord.Text = y.ToString();
   zCoord.Text = z.ToString();
}


Finally, In the form load function I have this code.

MyCOMInterfaceLib.MyCOMClassClass myApi = new MyCOMInterfaceLib.MyCOMClassClass();
myApi.coordCallback += new coordCallbackFunction(this.coordHandler);


I realize that myApi will go away right after setting up the callback, but I am just trying to get it to compile. I'll worry about details later.

When I compile the program I get this error...

Error 1 Cannot implicitly convert type 'TestCSharpApp.coordCallbackFunction' to 'MyCOMInterfaceLib._IMyCOMClassEvents_coordCallbackEventHandler' C:\Temp\TestCSharpApp\Form1.cs 38

I have included the MyComInterfaceLib in my list of references. I can call functions from the COM dll and that works fine. The problem is setting the callback function using delegates.

It may not mean much, but the callback functions work fine in VB.Net, so I don't think the problem is in the COM dll.

Thank you for any help.
AnswerRe: Problem with delegate for C++ DLL callback function Pin
Matthew Page21-Sep-09 11:54
Matthew Page21-Sep-09 11:54 
QuestionAdding custom properties to a DataGridViewRow Pin
theallmightycpd21-Sep-09 9:33
theallmightycpd21-Sep-09 9:33 
AnswerRe: Adding custom properties to a DataGridViewRow Pin
Henry Minute21-Sep-09 11:41
Henry Minute21-Sep-09 11:41 
GeneralRe: Adding custom properties to a DataGridViewRow Pin
theallmightycpd22-Sep-09 3:39
theallmightycpd22-Sep-09 3:39 
GeneralRe: Adding custom properties to a DataGridViewRow Pin
Henry Minute22-Sep-09 4:08
Henry Minute22-Sep-09 4:08 
QuestionUsing StringBuilder inside another class? Pin
helfri6221-Sep-09 9:27
professionalhelfri6221-Sep-09 9:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.