|
Implement the following C routine permission(inode,mask) – this routine checks whether a specified access mode is allowed for the file associated with an inode.
|
|
|
|
|
Why the return type doesn't have significance in function overloading. What might be reason in compilation designing for this issue.
Maruthi
|
|
|
|
|
I have an assembly that I built in C# and I wanted to be able to use it in an extended stored procedure. Does anyone know if this is possible? Thank you very much for your time.
|
|
|
|
|
I have a HID device (magnetic cardreader) that uses a usb port to connect to a computer running any version of windows. I want to be able to figure out what port the device is on and read information from it. I know I need to use the Win32 API, but I haven't been able to find any useful information on how to do this. Can any one help?
Thanks in advance.
|
|
|
|
|
I would start by looking at the work Camilo Toro has done. He has wrapped the needed portions of Win32 in a C# class. You'll be able to do what you want without writing much code at all. His work, called USBSharp, can be found on Jan Axelson's HID Page[^]. (Jan is the author of USB Complete, a great book to wet your taste buds.) For more details, look at the rest of Jan's site, the MS DDK, and MSDN of course.
Hope this helps,
Chris
|
|
|
|
|
Thanks for the link. I could have used that a few years ago when I was trying to have 2 independent usb mice...
John
|
|
|
|
|
I create dialog to load bitmap file and I change file a little.I create dialog to save file but I don't know code that can save bitmap image.
Could u tell me ?
|
|
|
|
|
I think you are talking about this:
Class CBitmap has the method Save. It's overloaded in five constructors.For instance one of them get the parameters --- pBitmap::Save( System::String__gc , System::Drawing::Imaging::ImageFormat__gc)
where in the string you put a name for saving the file ( actually you put whole path ), and in the second one you specify the requiered format that you want for this saved image.
Yes it's so simple to save your new bitmap as Gif, Tiff, JPeg, Icon and so on.
For instance you can use this function in this way:
{....
System::String * mark = S"\\";
//We open an openFileDialog in our form, we suppose that are
//filtered for only show BMP files.
System::Windows::Forms::OpenFileDialog * openFileDialog1 = new System::Windows::Forms::OpenFileDialog();
openFileDialog1->ShowDialog();
//We get the selected file path
String* strResult = openFileDialog1->FileName;
System::Drawing::Bitmap * pBitmap;
//and open it in our Bitmap
pBitmap = new System::Drawing::Bitmap( strResult);
//We search the last '\' in the path for change the name of the file and
// the extension
int Index = strResult->LastIndexOf (mark);
strResult = strResult->Substring(0,Index);
strResult = strResult->Concat(strResult,S"\\ITS_OK.jpg" );
//finally you can save it with your new desired format (or the same one)
pBitmap->Save(strResult, System::Drawing::Imaging::ImageFormat::Jpeg );
}
if your question is in another way, please reply me.
Best Regards!
|
|
|
|
|
Hi
Im try to get the icq api to work in c# but i trapped into a big problem.
The dll-function:
ICQAPICall_GetOnlineListDetails
BOOL WINAPI ICQAPICall_GetOnlineListDetails(int &iCount, BPSICQAPI_User **ppUsers);
In (Arguments): None
Out (Returns): iCount, ppUsers
iCount - the number of Users to follow
ppUsers - a pointer to the users’ array.
Description: The data returned is in the order of the online list, top to bottom. The users array is initialized with the user’s ICQ# (m_iUIN field) and the Window Handle (m_hFloatWindow) if the user is “floating”. The users array should be freed by calling ICQAPIUtil_FreeUsers to free each user structure and the array itself.
The iCount Parameter i get correctly with passing "out iCount" to the function (it will return the exact count), but the array gets size 1 and consists garbage. I used this:
[MarshalAs(UnmanagedType.LPArray)]
BSICQAPI_User[] ppUsers //its a array of structs.
It doesnt matter if i do ref or not in the function header.
Does somone know how i can get the right parameter for BPSICQAPI_User **ppUsers ?
THX
sorry for my bad english
|
|
|
|
|
Oh damn wrong forum....can someone move to c#´?
|
|
|
|
|
Hey all, is anyone out there attempting to wrap the winXP p2p sdk in some type of managed dll so that it can be more easily used in a .Net project? I'm working on it (slowly) but would love to give it up if someone else has done this already.
|
|
|
|
|
I’m going to create a collection having records of derived CObjects. I’m will store a lot (about 10000) of records in it and will very often make searches to find one ore more records (I will allow duplicates). Filling the collection will be made only once and I will never delete any record.
Need suggestion of witch structure I should use.
Now I’m using CArray, which I know is not the best at this problem.
Do you prefer for eg. the stl array before CArray and why?
Thanks - APe
APe
|
|
|
|
|
Hey all,
I want to begin learning ATL/WTL and wanted to get a good compiler, what will I need from here ( http://www.borland.com/products/downloads/download_cbuilder.html ) or other places?
Thanks for your time,
C.
|
|
|
|
|
In addition I guess I am looking for libraries to include, is this possilble?
Thanks again,
C.
|
|
|
|
|
You need Visual C++ for ATL/WTL, not the borland tools, for GUI programming etc Borland C++ uses VCL.
Signature under construction.
|
|
|
|
|
Hello,
I am having a little problem....everytime I try to change the default application icon in the properties window for an MC++ .NET form, I get an error message saying that GetObjectA() is not a member function of System::Resources.....this error (oddly enough) occurs in the InitializeComponent() function...something I have never modified (per the warning message above it). Has anyone else seen this problem? If you need more info, I can re-create it and send the exact error message.
-T
|
|
|
|
|
How can I send data stored in a DataTable to a function in written in unmanaged code?
Say I have a DataTable named PersonsTable (in managed code) with the following columns: LastName, FirstName, Age.
I need to send the data to the following function written in unmanaged code:
bool AddPersonToList(const char* LName, const char* FName, double Age);
How do I convert the data stored in the table to the types the function expects?
System::Data::DataRow* __value Row;
for (int i=0 ; i<PersonsTable->Rows->Count ; i++) {
Row = PersonsTable ->Rows->Item[i];
AddPersonToList(Row->Item["FirstName"], Row->Item["LastName"], Row->Item["Age"]); // doesn't work of course
}
Do I need to convert the data into System::String, and then into char*?
How do I do that?
|
|
|
|
|
How do I set the project level icon? After the project has been built I still have the default icon. I know in C# you set it in the project properties but I do not have that option in MC++ (unless I'm just blind).
|
|
|
|
|
|
Sorry. When you look in explorer at the .exe file you only see the default icon... it looks like an icon for a console app. I want to use the icon I used in the winform. My problem is, after installing the app the default icon (the console one) shows up in the start menu. I just need to change that icon in the project. In C# I can change this in the project properties pages under General|Application Icon. Sorry about not being more clear. I'm more of a C# person or I sould say, that I have only written console apps in C++ and not really any WinForm apps. Thanks for the help.
|
|
|
|
|
No problem. In order to replace the default icon with another:
- Locate and delete the project's app.ico file
- Copy your desired icon file to the same folder
- Rename your icon file to app.ico
- Build the project and you will see your desired icon as in Explorer.
Cheers,
Tom Archer
Never be afraid to try something new. Remember that a lone amateur built the Ark. A large group of professionals built the Titanic.
* Inside C# -Second Edition
* Visual C++.NET Bible
* Extending MFC Applications with the .NET Framework
|
|
|
|
|
Great thanks for the help. Out of all the C++ books I have I could not find that anwser.
|
|
|
|
|
You're very welcome. I think the reason you don't see this covered is that it doesn't fit neatly into most any chapter. However, I'm thinking that if I revise the VC++.NET Bible that I'll add it to Chapter 1 as that's kind of a "Introductory, Let's write your first app" type of chapter.
Cheers,
Tom Archer
Never be afraid to try something new. Remember that a lone amateur built the Ark. A large group of professionals built the Titanic.
* Inside C# -Second Edition
* Visual C++.NET Bible
* Extending MFC Applications with the .NET Framework
|
|
|
|
|
I have following code:
DataTable __gc *dt = xyz(); // xyz returns a pointer to a DataTable obj
DataRow __gc *dr = dt->NewRow();
dr->Item [S"txtCode"] = S"Test";
int nValue = 171; // OK
dr->Item [S"intValue"] = nValue; // GENERATES ERROR DURING COMPILATION
I have following error from the compiler:
ZWS.cpp(317) : error C2664: 'void System::Data::DataRow::set_Item(int,System::Object __gc *)' : cannot convert parameter 2 from 'int' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
I tried with DOUBLE values and similar problems occurr. Am I missing something here.. Why cast 'int' to 'int'?
I cuoldn't put DataRow working for types diferent from String.
I couldn't find help on WEB.
Alexandre R Oliveira
a.r.o.f@uol.com.br
|
|
|
|
|