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.03 seconds.

  1. 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...
  2. Replies
    2
    Views
    332

    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";...
  3. Replies
    1
    Views
    270

    Re: Can't add DataRow to DataTable

    Please share the code that updates the columns within the row with data.
  4. Replies
    8
    Views
    1,593

    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...
  5. Replies
    8
    Views
    1,593

    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...
  6. Replies
    8
    Views
    1,593

    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)
  7. Replies
    8
    Views
    1,593

    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:



    ...
  8. Replies
    8
    Views
    1,593

    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...
  9. 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",...
  10. 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);
    ...
  11. [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...
  12. Re: EnumFontFamiliesEx callback only being called once

    Thank you so much! It works now!!!
  13. [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...
  14. Replies
    2
    Views
    1,093

    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 =...
  15. Replies
    8
    Views
    453

    Re: NullReferenceException!

    Wrap that code in something like this:

    if (((dataGridView1 != null) && (dataGridView1.Rows.Count > 0))
  16. 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:


    ...
  17. Replies
    2
    Views
    802

    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.
  18. Replies
    3
    Views
    2,055

    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.
  19. Replies
    3
    Views
    1,072

    Re: How to Stop OleDbDataReader Getting NULL(s)

    string myField = reader.IsDBNull(0) ? String.Empty : reader.GetString(0);
  20. Re: Accessing 32 bit registry node when the application is running on 64 bit machine

    Worst comes to worst you can copy the settings where you need them to be.

    REG COPY "HKLM\SOFTWARE\Wow6432Node\MyCo\MyApp" "HKLM\SOFTWARE\MyCo\MyApp" /s
  21. Re: I'm trying to make a multiple choice adventure game

    Check out the OnKeyDown() event.
  22. Re: How to add a record if the result of a SQL query is empty

    Change the SQL Statement:



    Select * from v2007


    Select
    coalesce (Name, "none"),
    coalesce (SomeTextField, "none"),
  23. Replies
    1
    Views
    648

    Re: C# fires up Reporting Service?

    Look at these classes:

    ReportingService2005 rs = new ReportingService2005();
    ReportExecutionService rptExeSrv = new ReportExecutionService();

    And specifically:

    results =...
  24. Re: how to kill the application from the processes

    Try

    Application.Exit();
  25. Replies
    1
    Views
    2,557

    Re: RDL report group not displaying all rows

    I did fix this issue.

    I removed the grouping from the report and added it to the stored procedure that feeds the report.

    Now all my rows display as expected.
Results 1 to 25 of 485
Page 1 of 20 1 2 3 4


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center