Search Result

Collapse
16 results in 0.0014 seconds.
Keywords
Members
Tags
interop
  •  

  • How to convert/marshall C Function and DLL Structure type to C#

    Hi,

    Can someone please help me convert my C structure/function into C#? I really need this badly...
    I believe I can call the DLL properly if I have able to correctly convert the function and marshal properly my structure.

    Here is my struct and the function that uses it:
    Code:
    typedef struct UIclient_info {
    	char name[50];
    	int age;
    	SECONDUSER *stParent;
    } FIRSTUSER;
    ...
    See more | Go to post

  • C# use of Unmanaged C Library, run time error when reading file

    Hi,

    I have an unmanaged C library that has calculation functions.
    The function has to open a binary file to get data reference.
    Then returns a "ReadError" or the result in a User defined structure

    Code:
    MyStruct Calculate(int itemid, int input1, int input2, double input3)
    {
    //initialize variable
    MyStruct *resultAns;
    double item1_result = 0;
    double item2_result
    ...
    See more | Go to post

  • apaka
    started a topic How to pin a pointer to managed object in C#?
    in .NET

    How to pin a pointer to managed object in C#?

    Unmanaged code calls my functions. In first function I sould pass back pointer to my managet object. Sometimes later some of my othrer functions got called with that same pointer as one of parameters . I sould dereference it use it to perform some calculations and then if it is not neaded dispose of it.
    To cut the story short I need to pin that object so that GC won't move it til I dispose of it. How to do that in C# ?
    ...
    See more | Go to post

  • Is it possible to create shapes in a Word document using C#?

    I'm attempting to create shapes on a Microsoft Office Word document to model the layout of tables in a room. I've found a nice article (http://support.microsoft.com/kb/316384) that demonstrates how to create tables and text, but it doesn't mention anything about shapes. Is this possible or am I just dreaming?
    See more | Go to post

  • apaka
    started a topic Thumbnail shell extension .NET

    Thumbnail shell extension .NET

    Does anybody know a working sample how to write thumbnail shell extension that works on XP, or give me a clue how to implement IExtractImage2 interface and requied structs? Thanks in advance.
    See more | Go to post

  • How to make a website that is able to export an excel file?

    Hello, I have the following problem:
    I created a website project and I want in that website to be make a button, which will export some data in an excel file. This is the code that I have:
    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Excel = Microsoft.Office.Interop.Excel;
    ...
    See more | Go to post

  • dvanmil
    started a topic MarshalAs COPYDATASTRUCT and SendMessage
    in .NET

    MarshalAs COPYDATASTRUCT and SendMessage

    I am having problems with Window Messages. I want to send the handle of a VB.NET winform to a VB6 application. The code I have used seems to work ok, since the message arrives at the VB6 app. However, I have a problem that sometimes I get an error stating that it is not possilbe to read or write to the memory and that memory might be corrupt.
    I have no idea what is causing this problem as I think I release the memory at the end of my procedure....
    See more | Go to post

  • How do I generate an excel file for download without writing to disk?

    I succesfuly generated an excel file and populated it with a table from an MySQL query (if anyone is interested in the code, just ask) but I'm having problems putting it for download. I can save the file to disk and the call it with response.WriteF ile(), but I can't seem to find a way to have the excel file saved to memory (RAM, not the HDD) and call it for download from there.

    I'm using VS 2005, C#, Excel Interop 11.0, and I have...
    See more | Go to post

  • Winforms-Flash Interop: White background error with exclamation point

    HI Everyone! Hope someone can help me.

    I am loading a flash movie using the AxShockwaveFlas hObjects Reference.
    Then after sometime a white background will just show (no more movie) with circle that have Exclamation Point image in the middle.
    I have been using this method since flash player version 9.0. So I assume the latest flash version has something to do with it.

    Does anyone have any suggestion or...
    See more | Go to post

  • arjun404346
    started a topic sending pointer from C++ to C#

    sending pointer from C++ to C#

    Hello all,
    I have to send a pointer from C++ to C#. How can I do this?
    Error message I am getting on the C# program is
    "Pointers and fixed size buffers may only be used in an unsafe context"
    Please help.
    See more | Go to post

  • Attempted to read or write protected memory = memory leak?

    Hello,
    i have a question on my mind.

    Iam developing application which uses twain layer to scan images. So far everything worked fine, but today while testing i got Attempted to read or write protected memory error.

    Basicly what i do:
    - set capabilities via imported dll calls of twain.dll
    - call acquire call via imported dll calls of twain.dll

    i get back IntPtr on the data from scanner,...
    See more | Go to post
    Last edited by MightyPolo; May 18 '10, 07:17 AM. Reason: bad facts

  • microface
    started a topic 3rd party dll interface to c++/cli .net 2.x
    in C

    3rd party dll interface to c++/cli .net 2.x

    Yes I have googled, and found lots of supposed answers to this problem of using P/Invoke but everything I found, and everything I tried either caused exceptions, or simply failed to fill in the struct.
    So here is my problem
    Code:
    typedef struct tagEdsDirectoryItemInfo
    {
        EdsUInt32   size;
        EdsBool     isFolder;
        EdsUInt32   groupID;
        EdsUInt32   option;
        EdsChar     szFileName[ EDS_MAX_NAME
    ...
    See more | Go to post

  • awilliams
    started a topic Interop problem

    Interop problem

    I am trying to implement an interface into a database API.
    The API was originally designed for C, but has been used perfectly successfully in many programming languages (C++,Delphi/pascal even Cobol and VB)

    The API is like this:
    One declares a structure (actually a utility generates the declarations), which in C would be something like this

    Code:
    struct Customer
    {
      short l;
      short typenr;
    ...
    See more | Go to post
    Last edited by tlhintoq; Feb 11 '10, 04:21 PM. Reason: [CODE] ...Your code goes between code tags [/CODE]

  • Happy2006
    started a topic Convert array<Byte>^ data to const byte* data
    in .NET

    Convert array<Byte>^ data to const byte* data

    Hello

    I am trying to call a function in C from C# though c ++

    so basically C# -> C++ - >C

    In C#, I have byte[] bytes - which reads the information from the file. I am passing the byte array and the size to C++ .

    In C++ I get the byte array and the size but I am not able to convert to the specific data types.

    Code:
    void Image::OpenMemFile(array<Byte>^ data, unsigned
    ...
    See more | Go to post

  • Create an instance of a class inside a c++ dll in a c# project

    Hi everybody i really need your help im completely lost :S this is what i need:

    I have a c++ dll that uses MFC.
    I need to create an instance of a class inside that dll in a c# project
    I need to end with another dll to add it as a reference to other projects.

    I have found many "solutions" but i just get confused :S
    Pinvoke (just call functions but cant create an instance...)
    create...
    See more | Go to post
Working...