Click here to Skip to main content
15,902,299 members
Home / Discussions / C#
   

C#

 
GeneralRe: About ShutDown in XP Pin
Heath Stewart15-Apr-04 4:59
protectorHeath Stewart15-Apr-04 4:59 
GeneralRe: About ShutDown in XP Pin
lajiyo18-Apr-04 15:19
lajiyo18-Apr-04 15:19 
GeneralRe: About ShutDown in XP Pin
Heath Stewart19-Apr-04 2:17
protectorHeath Stewart19-Apr-04 2:17 
GeneralRe: About ShutDown in XP Pin
lajiyo20-Apr-04 0:37
lajiyo20-Apr-04 0:37 
GeneralRe: About ShutDown in XP Pin
Heath Stewart20-Apr-04 3:55
protectorHeath Stewart20-Apr-04 3:55 
GeneralRe: About ShutDown in XP Pin
lajiyo21-Apr-04 5:14
lajiyo21-Apr-04 5:14 
GeneralRe: About ShutDown in XP Pin
Heath Stewart21-Apr-04 6:46
protectorHeath Stewart21-Apr-04 6:46 
GeneralAccessing C++ classes from within C# .NET Pin
Vini Deep14-Apr-04 22:53
Vini Deep14-Apr-04 22:53 
Hi,

I have an unmanaged C++ DLL which exports certain classes. I want to access these classes from the C# client. I was able to do so by modifying the DLL source to export class creation and destruction functions. Is this the only option for the problem? If I don't have the source code for the DLL, but just the .dll file, how can i access the exported methods from the dll, in C# client?

Also, I have read somewhere about writing a Wrapper class for the DLL, in C#. Is it possible to write the wrapper in C#? Is there any link which will help me in this?

In my c# client , for DllImport, i have given the callingConvention as 'CallingConvention.ThisCall'. One of my exported function has a callBackFunction as argument. I declared a delegate to take care of this. But when executed, the application gives an error of "different calling convention used". If I change the CallingConvention to 'StdCall' or 'cdecl', there is no error, but then the call back function is not called.

[DllImport("ediImgReader - Debug.dll", EntryPoint ="?mapImage@Cedi9660Reader@@QAE_NGP6A_NIPAE_N@Z@Z",CallingConvention=CallingConvention.ThisCall )]

private static extern System.Int32 mapImage(IntPtr inst,System.UInt16 SectorSize, ReadSectorDelegate CallbackFunctionAddress);

public delegate System.Int32 ReadSectorDelegate(System.UInt32 SectorToBeRead,System.Byte SetToSectorDataIsLiteral, System.Int32 IsLiteral);

public static System.Int32 ReadSector(System.UInt32 SectorToBeRead,System.Byte SetToSectorDataIsLiteral, System.Int32 IsLiteral)
{
MessageBox.Show("Inside Delegate");
return 1;
}

public static System.Int32 mapImage(System.UInt16 SectorSize, ReadSectorDelegate CallbackFunctionAddress)
{
mapImage(Instance.inst,SectorSize,CallbackFunctionAddress);
return 1;
}

Kindly help.

Thanks..


Vini
GeneralRe: Accessing C++ classes from within C# .NET Pin
lajiyo14-Apr-04 23:10
lajiyo14-Apr-04 23:10 
GeneralRe: Accessing C++ classes from within C# .NET Pin
Vini Deep14-Apr-04 23:24
Vini Deep14-Apr-04 23:24 
GeneralRe: Accessing C++ classes from within C# .NET Pin
Andy Wieberneit15-Apr-04 3:27
Andy Wieberneit15-Apr-04 3:27 
Generaldatagrid hide rowheader Pin
robmays14-Apr-04 22:43
robmays14-Apr-04 22:43 
GeneralRe: datagrid hide rowheader Pin
Heath Stewart15-Apr-04 4:20
protectorHeath Stewart15-Apr-04 4:20 
GeneralRe: datagrid hide rowheader Pin
robmays15-Apr-04 4:59
robmays15-Apr-04 4:59 
GeneralRe: datagrid hide rowheader Pin
Heath Stewart15-Apr-04 5:04
protectorHeath Stewart15-Apr-04 5:04 
GeneralRe: datagrid hide rowheader Pin
robmays15-Apr-04 7:37
robmays15-Apr-04 7:37 
QuestionHow to set the string for cell(rowNumber, colNumber) Pin
DucLinh14-Apr-04 21:50
DucLinh14-Apr-04 21:50 
AnswerRe: How to set the string for cell(rowNumber, colNumber) Pin
Heath Stewart15-Apr-04 4:17
protectorHeath Stewart15-Apr-04 4:17 
GeneralDLL integration Pin
student666914-Apr-04 21:35
student666914-Apr-04 21:35 
GeneralRe: DLL integration Pin
lajiyo14-Apr-04 22:56
lajiyo14-Apr-04 22:56 
GeneralRe: DLL integration Pin
Andy Wieberneit15-Apr-04 3:39
Andy Wieberneit15-Apr-04 3:39 
GeneralRe: DLL integration Pin
Heath Stewart15-Apr-04 4:16
protectorHeath Stewart15-Apr-04 4:16 
QuestionHow to customize PrintPreviewDialog in C# Pin
sachinkalse14-Apr-04 20:45
sachinkalse14-Apr-04 20:45 
AnswerRe: How to customize PrintPreviewDialog in C# Pin
Heath Stewart15-Apr-04 4:13
protectorHeath Stewart15-Apr-04 4:13 
GeneralRe: How to customize PrintPreviewDialog in C# Pin
sachinkalse26-Apr-04 20:45
sachinkalse26-Apr-04 20:45 

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.