Search Results - CodeGuru Forums
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: Tron

Page 1 of 20 1 2 3 4

Search: Search took 0.02 seconds.

  1. Re: First picture repeating in next rows in crystal reports problem what wrong code

    If you want only one image to appear, this should work.



    foreach (DataRow dr in dt.Rows)
    {
    dr["Image"] = imgbyte;
    imgbype = null;
    }
  2. Replies
    8
    Views
    571

    Re: Json data call error

    Check out http://www.tomasvera.com/programming/using-javascriptserializer-to-parse-json-objects/

    The issue must be in your JavaScriptSerializer.
  3. Replies
    8
    Views
    571

    Re: Json data call error

    if ((dict != null) and (dict.data != null))
    {
    foreach (var club in dict.data)
    {
    .....
    }
    }
    else
    {
    ...
  4. Replies
    8
    Views
    571

    Re: Json data call error

    Looks like either "dict" or "dict.data" variable is null.

    Test the value before running your for loop.

    if ((dict != null) and (dict.data != null))
  5. Replies
    1
    Views
    317

    Re: Creating a loop around a checkedbox

    Something like this will read until there is no more data to read.

    If you are looking at toggling on and off the actual read process you'll probably need to fire off a worker thread that checks...
  6. Replies
    0
    Views
    426

    DataContract and WebMessageFormat.Json

    I have endpoint that is returning a list of objects. Within that object is a string data member that happens to hold a string that is already in JSON format. WCF is serializing my object. Because...
  7. Re: Converting C to C# - question about typedef voids

    This thread may help explain structures and PInvoke().

    http://forums.codeguru.com/showthread.php?541025-RESOLVED-Wrapper-from-C-to-C&highlight=Pinvoke

    Can you post a function prototype from one...
  8. Replies
    2
    Views
    452

    Re: how make a button to open an image?

    Check out OpenFileDialog class and PictureBox control:




    OpenFileDialog ofd = new OpenFileDialog();
    ofd.InitialDirectory = ".";
    ofd.Title = "Select Document Image";
    ofd.DefaultExt = "tif";...
  9. Replies
    1
    Views
    387

    Re: Can't add DataRow to DataTable

    Please share the code that updates the columns within the row with data.
  10. Replies
    8
    Views
    2,359

    Re: Wrapper from C++ to C#

    Depending on the members of NET_DVR_VICOLOR, NET_DVR_VILOST_V30 and NET_DVR_HIDEALARM_V30 this line of the structure may be the most tricky.



    public NET_DVR_SHELTER[] struShelter = new...
  11. Replies
    8
    Views
    2,359

    Re: Wrapper from C++ to C#

    I think you may want to change this:


    [DllImport("TruVNetSDK.dll")]
    public static extern bool NET_DVR_GetDVRConfig(int lUserID, uint dwCommand, int lChannel, IntPtr lpOutBuffer, uint...
  12. Replies
    8
    Views
    2,359

    Re: Wrapper from C++ to C#

    Actually in your case you most likely need the following line instead of Marshal.Copy().



    Marshal.StructureToPtr(myStruct, pStruct, false)
  13. Replies
    8
    Views
    2,359

    Re: Wrapper from C++ to C#

    The first method works because you are receiving the structure from the API so a pointer will do the trick.

    To send structures to the API you'll have to do more.

    Something like this:



    ...
  14. Replies
    8
    Views
    2,359

    Re: Wrapper from C++ to C#

    You need to change your marshalling a bit.



    public static extern int NET_DVR_Login_V30(string sDVRIP, int wDVRPort, string sUserName, string sPassword, out LPNET_DVR_DEVICEINFO_V30...
  15. Re: Marshal C struct containing pointer to other C struct

    [DllImport("thirdpartydll.dll", CharSet = CharSet.Auto)]
    public static extern IntPtr LoadImg([MarshalAs(UnmanagedType.LPStr)] string FileName);

    [DllImport("thirdpartydll.dll",...
  16. Re: Marshal C struct containing pointer to other C struct

    I first tried these P/Invokes



    [DllImport("thirdpartydll.dll", CharSet = CharSet.Auto)]
    public static extern IntPtr LoadImg([MarshalAs(UnmanagedType.LPStr)] string FileName);
    ...
  17. [RESOLVED] Marshal C struct containing pointer to other C struct

    I have a DLL written in C that I must use in my C# application.

    The C declarations for the two functions in question are as follows:



    IMGSTRUCT *LoadImg(const char *filename)
    int...
  18. Re: EnumFontFamiliesEx callback only being called once

    Thank you so much! It works now!!!
  19. [RESOLVED] EnumFontFamiliesEx callback only being called once

    I found this code posted form 2010. It is supposed to enum all the fonts on the system including those registered dynamically using the gdi32.dll call AddFontResource().

    My understanding is that...
  20. Replies
    2
    Views
    1,983

    Re: DataColumn AllowDBnull help.

    Something like this will work as well and you will have zero (or whatever default value you choose) for your int value when the DB field is NULL.



    SqlDataReader rdr;
    ...
    int myInt =...
  21. Replies
    8
    Views
    514

    Re: NullReferenceException!

    Wrap that code in something like this:

    if (((dataGridView1 != null) && (dataGridView1.Rows.Count > 0))
  22. Re: Datagridview rowenter ALWAYS enter first row before entering selected row

    Is the method getting called more often that you would expect? Perhaps you need to turn off the row_enter event until later in your program?

    Like this for example:


    ...
  23. Replies
    2
    Views
    1,057

    Re: ODBCDataReader Crash Issue

    I would think the issue is with the data in the db field.

    Verify the data does not contain any strange characters or otherwise invalid data.
  24. Replies
    3
    Views
    2,653

    Re: Reading SQL OUTPUT Parameter Value

    I seem to recall something about having to close the reader before some values are returned from the stored procedure.

    I could not locate my code for this however.
  25. Replies
    3
    Views
    1,139

    Re: How to Stop OleDbDataReader Getting NULL(s)

    string myField = reader.IsDBNull(0) ? String.Empty : reader.GetString(0);
Results 1 to 25 of 491
Page 1 of 20 1 2 3 4


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center