Click here to Skip to main content
16,011,611 members
Home / Discussions / C#
   

C#

 
AnswerRe: Crystal Report Requirements Pin
egenis8-Jun-08 20:47
egenis8-Jun-08 20:47 
QuestionHow to Insert more than one row in a single click using stored procedure Pin
NK75-Jun-08 22:57
NK75-Jun-08 22:57 
AnswerRe: How to Insert more than one row in a single click using stored procedure Pin
Simon P Stevens6-Jun-08 0:13
Simon P Stevens6-Jun-08 0:13 
AnswerRe: How to Insert more than one row in a single click using stored procedure Pin
Ashfield6-Jun-08 3:22
Ashfield6-Jun-08 3:22 
GeneralRe: How to Insert more than one row in a single click using stored procedure Pin
Giorgi Dalakishvili6-Jun-08 5:01
mentorGiorgi Dalakishvili6-Jun-08 5:01 
QuestionHow to know which version of Oracle client is used by the .Net? Pin
nicolus5-Jun-08 22:44
nicolus5-Jun-08 22:44 
QuestionHow to add multiple sort fields on crystal reports in my application Pin
combo_ci5-Jun-08 22:25
combo_ci5-Jun-08 22:25 
QuestionCalling native C++ from .net - code suggestion for my code Pin
steve_rm5-Jun-08 22:07
steve_rm5-Jun-08 22:07 
Hello,

VS 2008

I am calling native C++ dll from C#.Net 3.5. The program works ok, and I am very new at doing this. I am just wondering if there a better method to use. I will have to make many call backs in my project from native C++. So I am looking for a efficient method to handle the call back to make it easier to maintain and add more call backs. And to call these from .net. Is there a way to have a middle layer to bridge between .Net and C++? Just guessing here.

My code is below, this is just a simple that return a int from a call back.

Many thanks,


//mobile.hpp =================== <br />
typedef void (__stdcall *ptrToAge)(int); <br />
MOBILEDLL_API char* GetName(char* name); <br />
<br />
//mobile.cpp ====================== <br />
void GetMyAge(ptrToAge cb) <br />
{ <br />
    cb(28); <br />
} <br />
<br />
// C#.Net ==================================== <br />
 private delegate void TestCallbackDelegate(); <br />
        [DllImport("MobileDLL.dll")] <br />
        static extern void TestCallback(TestCallbackDelegate callbackTest); <br />
<br />
        void OnGetMyAge(int age) <br />
        { <br />
            this.label1.Text = age.ToString(); <br />
        } <br />
<br />
        //calling the callback <br />
     GetMyAge((GetMyAgeDelegate) OnGetMyAge);<br />

QuestionC# io question Pin
poqeqw5-Jun-08 21:42
poqeqw5-Jun-08 21:42 
AnswerRe: C# io question Pin
Simon P Stevens6-Jun-08 0:31
Simon P Stevens6-Jun-08 0:31 
QuestionScheduled download Pin
Rijz5-Jun-08 21:10
Rijz5-Jun-08 21:10 
AnswerRe: Scheduled download Pin
Vikram A Punathambekar5-Jun-08 22:47
Vikram A Punathambekar5-Jun-08 22:47 
GeneralRe: Scheduled download Pin
RaviBattula5-Jun-08 23:48
professionalRaviBattula5-Jun-08 23:48 
QuestionXQuery Pin
George_George5-Jun-08 21:02
George_George5-Jun-08 21:02 
AnswerRe: XQuery Pin
N a v a n e e t h5-Jun-08 21:18
N a v a n e e t h5-Jun-08 21:18 
GeneralRe: XQuery Pin
George_George5-Jun-08 21:22
George_George5-Jun-08 21:22 
GeneralRe: XQuery Pin
N a v a n e e t h5-Jun-08 22:14
N a v a n e e t h5-Jun-08 22:14 
GeneralRe: XQuery Pin
George_George5-Jun-08 22:30
George_George5-Jun-08 22:30 
Questioninfragistics Ultragrid Pin
Member 31169975-Jun-08 20:30
Member 31169975-Jun-08 20:30 
AnswerRe: infragistics Ultragrid Pin
Pete O'Hanlon5-Jun-08 22:07
mvePete O'Hanlon5-Jun-08 22:07 
GeneralRe: infragistics Ultragrid Pin
Colin Angus Mackay5-Jun-08 22:48
Colin Angus Mackay5-Jun-08 22:48 
GeneralRe: infragistics Ultragrid Pin
Pete O'Hanlon6-Jun-08 1:12
mvePete O'Hanlon6-Jun-08 1:12 
QuestionCannot insert duplicate key row in object Pin
Ballita5-Jun-08 18:54
Ballita5-Jun-08 18:54 
AnswerRe: Cannot insert duplicate key row in object Pin
dealon5-Jun-08 20:25
dealon5-Jun-08 20:25 
AnswerRe: Cannot insert duplicate key row in object - DUPLICATE POST Pin
Ashfield5-Jun-08 21:09
Ashfield5-Jun-08 21:09 

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.