|
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
|
|
|
|
|
|
I have a problem and don't know what to do.
I've written some unmanaged code and made managed wrappers for classes. Project loads in VS 2003 on my computer (first it was created by VS .NET), but on other computers VS doesn't open it. So I created new project and inserted all code there. It compiled ok, but new assembly doesn't load
with error message "procedure imported by some.dll could not be loaded".
Do someone had same troubles and how to fix this?
Thanks
|
|
|
|
|
I need some suggestions on starting an MDI project using managed C++. Note that there will be at least three different document types(and different menus.)
thanks
|
|
|
|
|
Use MFC. You may check possibility of having managed Form/UserControl hosting MFC MDI app.
Just possibility.
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
R U in Vegas?
The only way of discovering the limits of the possible is to venture a little past them into the impossible.--Arthur C. Clark Toasty0.com
|
|
|
|
|
|
|
Didnt know about it. Thanks. I will check it out
|
|
|
|
|
All,
I am converting a server TCP based software from C++ to Managed C++ and .NET. I want to use C++ as less as possible and use mainly __gc classes and data. I have some problems though. The server communicates with commands encapsulated in structs. For example:
struct SomeStruct
{
int i;
int j;
long int p;
};
So my question is how to convert the managed char array which I receive from the Socket or NetworkStream class to this struct. I want to declare my struct as managed -- __gc struct.
So if we summarize I need to cast managed char array to managed struct or at least copy the contents of the char array to a newly allocated managed struct.
In straight C++ this was pretty easy - we use cast and treat the char buffer like a struct or we use memcpy and copy the contents of the char array to the struct. However I did not found any way to do this fast in managed C.
Can anyone help me with this?
Nick
Visuall
|
|
|
|