Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. Article Writing
  4. Idea

Idea

Scheduled Pinned Locked Moved Article Writing
csharpc++tutorial
6 Posts 4 Posters 10 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    Oleksandr Kucherenko
    wrote on last edited by
    #1

    Hi... Can somebody write a convertor from C++ headers to C#... I mean convertion of fucntion declaration: example: in c++ in header structs and functions look like: typedef struct tagCREATESTRUCTA { LPVOID lpCreateParams; HINSTANCE hInstance; HMENU hMenu; HWND hwndParent; int cy; int cx; int y; int x; LONG style; LPCSTR lpszName; LPCSTR lpszClass; DWORD dwExStyle; } CREATESTRUCTA, *LPCREATESTRUCTA; WINGDIAPI int WINAPI GetDIBits( IN HDC, IN HBITMAP, IN UINT, IN UINT, OUT LPVOID, IN OUT LPBITMAPINFO, IN UINT); in c# [StructLayout(LayoutKind.Sequential)] public struct CREATESTRUCT { IntPtr lpCreateParams; IntPtr hInstance; IntPtr hMenu; IntPtr hwndParent; int cy; int cx; int y; int x; Int32 style; string lpszName; string lpszClass; UInt32 dwExStyle; } [DllImport("gdi32")] public static extern int GetDIBits(IntPtr hDC, IntPtr hbm, int StartScan, int ScanLines, int lpBits, BITMAPINFOHEADER bmi, int usage); Languages is simmilar enough and conversion can be done by simple words replace and strings movements Good Luck Alex Kucherenko

    S 1 Reply Last reply
    0
    • O Oleksandr Kucherenko

      Hi... Can somebody write a convertor from C++ headers to C#... I mean convertion of fucntion declaration: example: in c++ in header structs and functions look like: typedef struct tagCREATESTRUCTA { LPVOID lpCreateParams; HINSTANCE hInstance; HMENU hMenu; HWND hwndParent; int cy; int cx; int y; int x; LONG style; LPCSTR lpszName; LPCSTR lpszClass; DWORD dwExStyle; } CREATESTRUCTA, *LPCREATESTRUCTA; WINGDIAPI int WINAPI GetDIBits( IN HDC, IN HBITMAP, IN UINT, IN UINT, OUT LPVOID, IN OUT LPBITMAPINFO, IN UINT); in c# [StructLayout(LayoutKind.Sequential)] public struct CREATESTRUCT { IntPtr lpCreateParams; IntPtr hInstance; IntPtr hMenu; IntPtr hwndParent; int cy; int cx; int y; int x; Int32 style; string lpszName; string lpszClass; UInt32 dwExStyle; } [DllImport("gdi32")] public static extern int GetDIBits(IntPtr hDC, IntPtr hbm, int StartScan, int ScanLines, int lpBits, BITMAPINFOHEADER bmi, int usage); Languages is simmilar enough and conversion can be done by simple words replace and strings movements Good Luck Alex Kucherenko

      S Offline
      S Offline
      Stephane Rodriguez
      wrote on last edited by
      #2

      All WIN32 structures are already converted in this file : WIN32API.txt ( vc7installdir \ Common7 \ Tools \ Bin ). It's not using the C# syntax, but that's pretty close. If you are having problems with P/Invoke, consider using MC++ mix mode.

      O A 2 Replies Last reply
      0
      • S Stephane Rodriguez

        All WIN32 structures are already converted in this file : WIN32API.txt ( vc7installdir \ Common7 \ Tools \ Bin ). It's not using the C# syntax, but that's pretty close. If you are having problems with P/Invoke, consider using MC++ mix mode.

        O Offline
        O Offline
        Oleksandr Kucherenko
        wrote on last edited by
        #3

        good, but not enough Good Luck Alex Kucherenko

        1 Reply Last reply
        0
        • S Stephane Rodriguez

          All WIN32 structures are already converted in this file : WIN32API.txt ( vc7installdir \ Common7 \ Tools \ Bin ). It's not using the C# syntax, but that's pretty close. If you are having problems with P/Invoke, consider using MC++ mix mode.

          A Offline
          A Offline
          Arun Bhalla
          wrote on last edited by
          #4

          Is there a VB->C# translator? :)

          J S 2 Replies Last reply
          0
          • A Arun Bhalla

            Is there a VB->C# translator? :)

            J Offline
            J Offline
            J Dunlap
            wrote on last edited by
            #5

            There is a C#->VB .NET Converter[^] , but I don't kow of a VB->C# converter. I'm working on one based on the SharpDevelop[^] refactory, but it won't be done for a little while. (Long term project, not short term goal.)

            "Do unto others as you would have them do unto you." - Jesus
            "An eye for an eye only makes the whole world blind." - Mahatma Gandhi

            1 Reply Last reply
            0
            • A Arun Bhalla

              Is there a VB->C# translator? :)

              S Offline
              S Offline
              Stephane Rodriguez
              wrote on last edited by
              #6

              I don't know yet if it's good or not, but a translator[^] was posted on CodeProject a few days ago.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups