?
Solved

Help with: object contains non-primitive or non-blittable data

Posted on 2010-11-09
3
Medium Priority
?
973 Views
Last Modified: 2012-05-10
Hello can anyone help me with the following error? I have attached a screen shot.
Also see the declaration statements of the pertinent functions.
GL-Functions.docx
Current-Error.bmp
0
Comment
Question by:sn1fflez
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 34128085
You can only marshal pinned delegates that have blittable types.  The following reference MSDN article talks about blittable and non-blittable types.

Blittable and Non-Blittable Types
http://msdn.microsoft.com/en-us/library/75dwhxf7(v=VS.100).aspx

Why are you using the delegates, instead of passing the arguments to the p/invoke declarations directly?
0
 

Accepted Solution

by:
sn1fflez earned 0 total points
ID: 34166917
I was able to solve my problem with the following code:
 Dim x_dim As Single = WorkC(1) * 0.5
        Dim y_dim As Single = WorkC(2) * 0.5
        Dim z_dim As Single = WorkC(3) * 0.5

        Dim vertices() As Single = { _
        x_dim, y_dim, z_dim, -x_dim, y_dim, z_dim, -x_dim, y_dim, -z_dim, x_dim, y_dim, -z_dim, _
        x_dim, y_dim, z_dim, x_dim, y_dim, -z_dim, x_dim, -y_dim, -z_dim, x_dim, -y_dim, z_dim, _
        x_dim, y_dim, z_dim, x_dim, -y_dim, z_dim, -x_dim, -y_dim, z_dim, -x_dim, y_dim, z_dim, _
        -x_dim, y_dim, z_dim, -x_dim, -y_dim, z_dim, -x_dim, -y_dim, -z_dim, -x_dim, y_dim, -z_dim, _
        -x_dim, -y_dim, -z_dim, x_dim, -y_dim, -z_dim, x_dim, y_dim, -z_dim, -x_dim, y_dim, -z_dim, _
        x_dim, -y_dim, -z_dim, -x_dim, -y_dim, -z_dim, -x_dim, -y_dim, z_dim, x_dim, -y_dim, z_dim}

        Dim indices() As Byte = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, _
                                 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}

        Gl.glEnableClientState(Gl.GL_VERTEX_ARRAY)
        Gl.glVertexPointer(3, Gl.GL_FLOAT, 0, vertices)
        Gl.glDrawElements(Gl.GL_QUADS, 24, Gl.GL_UNSIGNED_BYTE, indices)
        Gl.glDisableClientState(Gl.GL_VERTEX_ARRAY)

Open in new window

0
 

Author Closing Comment

by:sn1fflez
ID: 34195041
I solved the problem
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month14 days, 12 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question