|
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
|
|
|
|
|
Does anyone know how to get a pointer to a managed class in the Document (MFC architecture).
The whole project is in C++ except the class to which I want to get a pointer.
Everything compile fine but when I do a #include "MyManagedClass.h" in the Document it doesn't work.
Thanks
ad
|
|
|
|
|
I know that I have Data in the clipboard with the DataFormat::MetafilePict.
But I can't get it. My code is more or less the next:
/////////////////////////////////////////////////////////////
if ( iData->GetDataPresent( DataFormats::MetafilePict) )
{
System::Object * obj;
System::Drawing::Imaging::Metafile * pMetafile;
obj = Clipboard::GetDataObject()>GetData(System::Windows::Forms::DataFormats::MetafilePict ); pMetafile = dynamic_cast< System::Drawing::Imaging::Metafile * > (obj);
}
/////////////////////////////////////////////////////////
Obviusly in the Debug, I enter inside the first if condition, so the code executes but the System::Object obj can't keep the data of clipboard and keeps a undefined value after the asignation.
It seems a contradiction, isn't it ?
Can anybody say me anything about get MetafilePict Data from Clipboard ?
Advanced Thanks, everybody.;)
|
|
|
|
|
I'm building a DLL with Visual C++ .NET that needs to be portable back to Win98. However, the DLL simply fails to load (using depends.exe) even when all required (MSVC 7.1) DLLs are provided in the search path.
Win98 will successfully load a barebones DLL if we disable Managed Extensions, but the full project does not link without Managed Extensions due to nafxcw/msvcrt conflicts.
Is it even possible to run Managed Extensions code on Win98 given the appropriate DLLs? And/or does anyone have any pointers to solving link errors (see below) when Managed Extensions are removed?
Thanks...
-----------
nafxcw.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in MSVCRT.lib(MSVCR71.dll)
nafxcw.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z) already defined in MSVCRT.lib(MSVCR71.dll)
nafxcw.lib(afxmem.obj) : warning LNK4006: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in MSVCRT.lib(MSVCR71.dll); second definition ignored
nafxcw.lib(afxmem.obj) : warning LNK4006: "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z) already defined in MSVCRT.lib(MSVCR71.dll); second definition ignored
nafxcw.lib(apphelp.obj) : error LNK2001: unresolved external symbol __mbctype
nafxcw.lib(filelist.obj) : error LNK2019: unresolved external symbol __mbctype referenced in function "void __stdcall _AfxAbbreviateName(char *,int,int)" (?_AfxAbbreviateName@@YGXPADHH@Z)
nafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv
nafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argc
|
|
|
|
|
Defining _AFXDLL seems to have helped. Not quite sure why.
|
|
|
|
|
Is it considered part of the OS? Or is it treated on par with someting like the Java JIT compiler?
|
|
|
|