I am using the Little C Compiler (LCC) installation (I have previous experience writing AWK scripts). I can't use the internet very much during working hours, so constant reference to MSDN is not an option.
Can anybody walk me through the process to read/write files using the Windows API / C?
I have always used fopen(), fread(), fwrite(), fclose().
I am doing this from memory so it may not compile.
unsigned char RWString[500];
unsigned int Number;
File* FilePtr = fopen("FileName.xxx", w);
//the w = write but could be r = read, b= binary
Number = 10; //number of bytes you want to read
fread(FilePtr, RWString, Number);
fwrite(FilePtr, RWString, Number);
fclose(FilePtr);
pear
Thursday, July 9, 2009
Wha is the difference between the packages and classes in Java API and C API ? is it same?
Well C and Java are entirely different languages though java inherits its syntax from C.
C is a function oriented language where program revolves around functions.
Java is an object oriented language and revolves around objects + messages.
So there are no classes and packages in C language because a class represents an object and a package is a set of related objects where we put related classes into a package. So C don't have anything like classes and packages.
Hope it clears your basic concept.
regards
saif ullah
C is a function oriented language where program revolves around functions.
Java is an object oriented language and revolves around objects + messages.
So there are no classes and packages in C language because a class represents an object and a package is a set of related objects where we put related classes into a package. So C don't have anything like classes and packages.
Hope it clears your basic concept.
regards
saif ullah
All methods and states found in C# API?
All Classes,interfaces and etc.And their methods and states(variables)
All methods and states found in C# API?
Not sure what you're asking, but the documentation for .NET that comes with Visual Studio has all that. It is also available online: http://msdn2.microsoft.com/en-us/library...
All methods and states found in C# API?
Not sure what you're asking, but the documentation for .NET that comes with Visual Studio has all that. It is also available online: http://msdn2.microsoft.com/en-us/library...
How call windows api from c#?
please explain :
using windows api within c#
-------THANKS--------
How call windows api from c#?
There are two types of windows api.
1- Managed
2- Unmanaged
If your trying to access C++ code from C# then you need to lookup Interops. At work I had to do this, it is quite messy. What you have to is create an Interop class using the .NET interopability feature which is called P/Invoke.
What you are doing exactly is creating a wrapper to be used in C#. I believe you have the header files (.h) and you need to Call each function within that header file to C#. It is called interoping. In C# it is called DLLImport.
It is quite an extensive subject.
Every define you need to transform it to C#
Every struct you need to transform it to C#
Every macro you need to define it in C#
Every method you need dllimport it in C#
Every callback you need to delegate it in C#
ALL datatypes should be converted to the C# equivalent (C++/CLI)
Inorder to use DLLImport you have to use Unmanaged DLL's, managed dlls can be simply added as reference to the project so you dont need to interop it.
Please take a look at these links, they will help you tremendously.
http://quickstart.developerfusion.co.uk/...
http://mono-project.com/Interop_with_Nat...
http://msdn2.microsoft.com/en-us/library...
http://www.pinvoke.net/
Take a time to read it and understand how to do it. If you need help, I could help you since It is quite a stressing subject hehe.
Good Luck!
Reply:You will need to use DLLImport in order to register these methods and then they are used like any other method.
using windows api within c#
-------THANKS--------
How call windows api from c#?
There are two types of windows api.
1- Managed
2- Unmanaged
If your trying to access C++ code from C# then you need to lookup Interops. At work I had to do this, it is quite messy. What you have to is create an Interop class using the .NET interopability feature which is called P/Invoke.
What you are doing exactly is creating a wrapper to be used in C#. I believe you have the header files (.h) and you need to Call each function within that header file to C#. It is called interoping. In C# it is called DLLImport.
It is quite an extensive subject.
Every define you need to transform it to C#
Every struct you need to transform it to C#
Every macro you need to define it in C#
Every method you need dllimport it in C#
Every callback you need to delegate it in C#
ALL datatypes should be converted to the C# equivalent (C++/CLI)
Inorder to use DLLImport you have to use Unmanaged DLL's, managed dlls can be simply added as reference to the project so you dont need to interop it.
Please take a look at these links, they will help you tremendously.
http://quickstart.developerfusion.co.uk/...
http://mono-project.com/Interop_with_Nat...
http://msdn2.microsoft.com/en-us/library...
http://www.pinvoke.net/
Take a time to read it and understand how to do it. If you need help, I could help you since It is quite a stressing subject hehe.
Good Luck!
Reply:You will need to use DLLImport in order to register these methods and then they are used like any other method.
How to make an API in C?
I have some c files..and each c file perfoms a specific function...So i want to make API's for each function....
In the end i should have few API's each performing different operation.......
So can anybody tell me the way or steps ..how to do this?
How to make an API in C?
It helps if you understand what an API is. http://en.wikipedia.org/wiki/API
An API is not a function. It is the interface that a source code can use to work with a library. If your c files form a coherent library, compile them as a library file and give out the headers to appropriate functions. Obviously, design your library appropriately, so that you can expose a meaningful interface.
Reply:Yes, csanon has it right.
I'd just add/emphasize that your API is usually just
the function prototypes that you specify in a header (.h)
file (and any user defined types, structs, enums, etc,
that are required for use in calling the functions).
nobile
In the end i should have few API's each performing different operation.......
So can anybody tell me the way or steps ..how to do this?
How to make an API in C?
It helps if you understand what an API is. http://en.wikipedia.org/wiki/API
An API is not a function. It is the interface that a source code can use to work with a library. If your c files form a coherent library, compile them as a library file and give out the headers to appropriate functions. Obviously, design your library appropriately, so that you can expose a meaningful interface.
Reply:Yes, csanon has it right.
I'd just add/emphasize that your API is usually just
the function prototypes that you specify in a header (.h)
file (and any user defined types, structs, enums, etc,
that are required for use in calling the functions).
nobile
Sunday, May 10, 2009
IsIPAddressInRange like API in C/C++/php?
are you aware of any api in c,c++ or php which can varify whether a given IP address falls under a given range
How i can add animated gif to the window with gdi , c++ & Win32 API ?
HI - thanks for visiting.
do you know , how i can add animated gif to the window with gdi , c++ %26amp; Win32 API ( without MFC ).
How i can add animated gif to the window with gdi , c++ %26amp; Win32 API ?
Use Borland C++ Builder...you can do it in a few minutes.
do you know , how i can add animated gif to the window with gdi , c++ %26amp; Win32 API ( without MFC ).
How i can add animated gif to the window with gdi , c++ %26amp; Win32 API ?
Use Borland C++ Builder...you can do it in a few minutes.
Subscribe to:
Posts (Atom)