Idea
-
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 -
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 KucherenkoAll 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.
-
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.
good, but not enough Good Luck Alex Kucherenko
-
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.
Is there a VB->C# translator? :)
-
Is there a VB->C# translator? :)
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 -
Is there a VB->C# translator? :)
I don't know yet if it's good or not, but a translator[^] was posted on CodeProject a few days ago.