Click here to Skip to main content
16,005,491 members
Home / Discussions / C#
   

C#

 
QuestionHelp providers Pin
CandyMe5-Dec-05 14:47
CandyMe5-Dec-05 14:47 
QuestionUrgent Help needed for reflection Pin
subbucs5-Dec-05 14:26
subbucs5-Dec-05 14:26 
QuestionWhat's up with this new Loader Lock exception? Pin
dxben5-Dec-05 12:10
dxben5-Dec-05 12:10 
AnswerRe: What's up with this new Loader Lock exception? Pin
leppie5-Dec-05 12:23
leppie5-Dec-05 12:23 
GeneralRe: What's up with this new Loader Lock exception? Pin
dxben5-Dec-05 14:38
dxben5-Dec-05 14:38 
QuestionCalling a Win32 api in C# - urgent! Pin
spellman5-Dec-05 10:59
spellman5-Dec-05 10:59 
AnswerRe: Calling a Win32 api in C# - urgent! Pin
Christian Graus5-Dec-05 13:07
protectorChristian Graus5-Dec-05 13:07 
AnswerRe: Calling a Win32 api in C# - urgent! Pin
Judah Gabriel Himango5-Dec-05 13:51
sponsorJudah Gabriel Himango5-Dec-05 13:51 
Cindy,

First, have a peek at PInvoke.net[^]. It's a great website that can help you out with lots of examples of calling native code from managed code, which is what you're trying to do.

Secondly, the unsafe keyword just lets you use pointers. It doesn't allow you to write C++ types in C# code.

So go look at PInvoke.net, as you'll find examples of how to marshal things like unsigned character pointers properly. If I were to guess (and this is only a guess), try something like
[System.Runtime.InteropServices.StructLayout(LayoutKind.Sequential)]
struct HDR
{
   int hdr_size; // keep in mind, a C++ long is a 32 bit integer, which C# calls int. C#'s long is a 64 bit integer
   string hdr_data; // Not really sure what's the best way here: some people use ushort*, others use string or even StringBuilder. Depends on what you're doing with hdr_data, and whether it needs to be returned to managed code.
}


Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Bought a House!
Judah Himango


QuestionCodeDomSerializer and Custom Control Pin
Dmitry G. Vorochek5-Dec-05 10:07
Dmitry G. Vorochek5-Dec-05 10:07 
AnswerRe: CodeDomSerializer and Custom Control Pin
Dmitry G. Vorochek9-Jan-06 5:37
Dmitry G. Vorochek9-Jan-06 5:37 
QuestionPressing the X Button Pin
TheMajorRager5-Dec-05 9:10
TheMajorRager5-Dec-05 9:10 
AnswerRe: Pressing the X Button Pin
Dan Neely5-Dec-05 9:14
Dan Neely5-Dec-05 9:14 
GeneralRe: Pressing the X Button Pin
TheMajorRager5-Dec-05 10:12
TheMajorRager5-Dec-05 10:12 
GeneralRe: Pressing the X Button Pin
J4amieC5-Dec-05 21:56
J4amieC5-Dec-05 21:56 
GeneralRe: Pressing the X Button Pin
TheMajorRager6-Dec-05 6:26
TheMajorRager6-Dec-05 6:26 
QuestionEasy forms question Pin
melanieab5-Dec-05 8:40
melanieab5-Dec-05 8:40 
AnswerRe: Easy forms question Pin
Dan Neely5-Dec-05 9:11
Dan Neely5-Dec-05 9:11 
AnswerRe: Easy forms question Pin
Alvaro Mendez5-Dec-05 9:41
Alvaro Mendez5-Dec-05 9:41 
QuestionListview column resizing problem Pin
Dan Neely5-Dec-05 8:27
Dan Neely5-Dec-05 8:27 
QuestionIs it possible to remove existing graphics from an image? Pin
Gulfraz Khan5-Dec-05 6:30
Gulfraz Khan5-Dec-05 6:30 
AnswerRe: Is it possible to remove existing graphics from an image? Pin
mav.northwind5-Dec-05 7:12
mav.northwind5-Dec-05 7:12 
AnswerRe: Is it possible to remove existing graphics from an image? Pin
Robert Rohde5-Dec-05 7:13
Robert Rohde5-Dec-05 7:13 
AnswerRe: Is it possible to remove existing graphics from an image? Pin
dnewmon5-Dec-05 7:22
dnewmon5-Dec-05 7:22 
GeneralRe: Is it possible to remove existing graphics from an image? Pin
Gulfraz Khan7-Dec-05 2:28
Gulfraz Khan7-Dec-05 2:28 
QuestionDateTime Range Pin
lior654#hotmail.com5-Dec-05 4:36
lior654#hotmail.com5-Dec-05 4:36 

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.