IntPtr using in VC++7.1 RRS feed

  • Question

  • hi,


    I have converting the project c# to vc++ in .net2003. I have a problem with using IntPtr for reading the dib image.


    I want to know that how to use the IntPtr in VC++.


    Please give the example.


    thanking you

    Saturday, June 16, 2007 11:26 AM

All replies

  • Hi,

    The IntPtr type is designed to be an integer whose size is platform-specific. That is, an instance of this type is expected to be 32-bits on 32-bit hardware and operating systems, and 64-bits on 64-bit hardware and operating systems.IntPtr objects can also be used to hold handles. For example, instances of IntPtr are used extensively in the System.IO.FileStream class to hold file handles.

    But if you clarify what function you are using to read the DIB Image. It will be useful for members here to provide clues!





    Monday, June 18, 2007 8:34 AM
  • hi,


    Thanks for your reply.


    Actually we are using 32-bit on 32-bit hardware operating System.


    We are developing Finger print project. The Finger image has read in dib format.


    Actully we have example in c# to read the image using IntPtr. But we want to convert the project c# to VC++.


    please give a clue







    Monday, June 18, 2007 12:08 PM
  • Can you post that C# code ?
    Monday, June 18, 2007 12:21 PM
  • hi,

    Thanks for your reply.


    The following structure where using in C#


    public struct CaptureData
                /public int numFinger;
                            /// Pointer to the DIB image. DIB is a array of bytes representing bitmap which consists of following parts: header (BITMAPINFOHEADER), palette and bits.
                /// </summary>
       public IntPtr data;


    In vc++7.1 using


    struct CaptureData
      int numFinger;   // number of the finger
      int *dib;       // pointer to the buffer containing device independent bitmap (DIB),







    Monday, June 18, 2007 1:32 PM
  • Hi,


    Anybody knows that how to use the IntPtr in VC++7.1.


    Otherwise how to read the bitmap image as dib format in vc++6.0. Can you give the sample code?




    Monday, June 25, 2007 5:33 AM
  • A few years ago I searched for samples such as that; all I know is what I learned from the results of searching. I forget the details and such. I wrote an article for CodeGuru that shows use of LoadImage.
    Monday, June 25, 2007 6:30 AM
  • Hi,


    I have problem with creating the bitmap image.


    Actually I got the image from powershot camera. The Powershot dll return the image as unmanaged memory pointer data. The DLL return the following format,


    void *pVFData


    In that *pVFData where the image is stored. I want to write the data to the memorystream. So i have convert the block unmanaged memory to managed memory. In .net Marshal::copy method where using.


    I want to know how to use the Marshal::Copy method in VC++6.0.


    Anybody knows that please help me.


    Wednesday, August 1, 2007 12:52 PM