Click here to Skip to main content
15,896,915 members
Home / Discussions / C#
   

C#

 
GeneralRe: Help with TypeLoadException (marshaling unmanaged code) Pin
TomWolfstein30-Jun-07 6:05
TomWolfstein30-Jun-07 6:05 
GeneralRe: Help with TypeLoadException (marshaling unmanaged code) Pin
Luc Pattyn30-Jun-07 6:57
sitebuilderLuc Pattyn30-Jun-07 6:57 
GeneralRe: Help with TypeLoadException (marshaling unmanaged code) Pin
TomWolfstein30-Jun-07 8:51
TomWolfstein30-Jun-07 8:51 
GeneralRe: Help with TypeLoadException (marshaling unmanaged code) Pin
Luc Pattyn30-Jun-07 14:27
sitebuilderLuc Pattyn30-Jun-07 14:27 
GeneralRe: Help with TypeLoadException (marshaling unmanaged code) Pin
TomWolfstein1-Jul-07 7:16
TomWolfstein1-Jul-07 7:16 
GeneralRe: Help with TypeLoadException (marshaling unmanaged code) Pin
Luc Pattyn1-Jul-07 8:34
sitebuilderLuc Pattyn1-Jul-07 8:34 
GeneralRe: Help with TypeLoadException (marshaling unmanaged code) Pin
TomWolfstein4-Jul-07 21:57
TomWolfstein4-Jul-07 21:57 
GeneralRe: Help with TypeLoadException (marshaling unmanaged code) Pin
Luc Pattyn5-Jul-07 0:17
sitebuilderLuc Pattyn5-Jul-07 0:17 
Hi Tom,

1.
yes I would like to have the C code in a compilable and runnable form. Please email it
using the email button below. Have some questions:
1.1. Which tool do you use to build it ? (I hope Visual Studio 6)
1.2. Does it use "normal" sizes (1B byte, 2B short, 3B int, ...) ?
1.3. Where did you get the source exactly ?
1.4. Did you change anything ? If so did you comment that in the source ?
1.5. Did you add code to print out:
- struct sizes ?
- and field offsets ? Are they what you expected ?
- field values ?

2.
I entered your C# code in a C# project, but I am missing a lot:
several vcl_### types such as vc1_eMBType; I hope most of them are int enums.
I think you best also send me the source of C# class that is supposed to call the C stuff.

3.
to access vc1DEC_sState.sPosition one must get all its members marshalled (almost) correctly;
as long as something is wrong in say vc1_sPicture, it will continue to give that kind
of run-time errors.
And that's exactly why I tend to build a marshalling job from bottom to top,
so you get something working and this gives you the energy to continue...

4.
Are you sure you need the unsafe keyword ? what is it supposed to bring you ?

5.
some of your fields are public, most of them not. Why is this ?
If you dont need to access most of the fields in C#, you can replace them by something simpler
having the same size (such as vc1_sMB in vc1DEC_sState !?!?


Greetings





GeneralRe: Help with TypeLoadException (marshaling unmanaged code) Pin
Luc Pattyn1-Jul-07 9:14
sitebuilderLuc Pattyn1-Jul-07 9:14 
Questionvalidating a formula Pin
Bojja Lakshmi30-Jun-07 2:50
Bojja Lakshmi30-Jun-07 2:50 
AnswerRe: validating a formula Pin
User 665830-Jun-07 3:32
User 665830-Jun-07 3:32 
QuestionDataGrid with checkbox Pin
-spy-30-Jun-07 2:40
-spy-30-Jun-07 2:40 
AnswerRe: DataGrid with checkbox Pin
DanB198330-Jun-07 8:24
DanB198330-Jun-07 8:24 
QuestionInvalid Argument exception? Pin
$uresh $hanmugam30-Jun-07 1:58
$uresh $hanmugam30-Jun-07 1:58 
AnswerRe: Invalid Argument exception? [modified] Pin
Luc Pattyn30-Jun-07 3:07
sitebuilderLuc Pattyn30-Jun-07 3:07 
Questionreading file error Pin
tauras8130-Jun-07 1:41
tauras8130-Jun-07 1:41 
AnswerRe: reading file error Pin
Luc Pattyn30-Jun-07 1:58
sitebuilderLuc Pattyn30-Jun-07 1:58 
Questionarray of type label Pin
Glen Harvy29-Jun-07 23:47
Glen Harvy29-Jun-07 23:47 
AnswerRe: array of type label Pin
Sathesh Sakthivel29-Jun-07 23:53
Sathesh Sakthivel29-Jun-07 23:53 
GeneralRe: array of type label Pin
Glen Harvy30-Jun-07 0:09
Glen Harvy30-Jun-07 0:09 
AnswerRe: array of type label Pin
Luc Pattyn29-Jun-07 23:57
sitebuilderLuc Pattyn29-Jun-07 23:57 
GeneralRe: array of type label Pin
Glen Harvy30-Jun-07 0:11
Glen Harvy30-Jun-07 0:11 
GeneralRe: no Replace !! Pin
Luc Pattyn30-Jun-07 1:14
sitebuilderLuc Pattyn30-Jun-07 1:14 
AnswerRe: array of type label Pin
Guffa30-Jun-07 0:08
Guffa30-Jun-07 0:08 
Questionconsole application creation Pin
DKalepu29-Jun-07 22:52
DKalepu29-Jun-07 22:52 

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.