|
When looking at the reviews on a Web public site such CodeProject, you have to realize that there are no prerequisites required for someone to post a rating. Therefore, while some of the reviews (both good and bad) are valid, there are many times when a person posting the rating might not be the best person to quantify the value of a given ariticle and in many cases, bad ratings can be directly attributed to personal issues between the rater and the article.
If you truly want to determine if an article is worth reading, I would first look at the remarks at the bottom of the article. Are there a lot of unanswered questions about bugs? Are a lot of errors being pointed out that are not being corrected in the article? In the case of Nish's articles, I think you'll find that the overwhelming majority of articles are top-notch and the few that had any problems were quickly corrected so that they're also top-notch now.
Cheers,
Tom Archer
Inside C#, Extending MFC Applications with the .NET Framework
It's better to listen to others than to speak, because I already know what I'm going to say anyway. - Jörgen Sigvardsson
|
|
|
|
|
Hello.
I'm a beginner in Managed C++. I have created a Windows Forms application. The wizard has generated a project with a app.rc resource file.
I have added to this rc file a string to the String Table and a Icon ( like in MFC ).
Now, my problem it's that I can't read the string or the icon from the resource file.
I have tryd to use the resource Manager but I'm not able to make it work.
Please, can anyone help me ?
|
|
|
|
|
hello can any body tell me how i can stop my c++ multithreaded console aplication from auto exiting once main() has been executed,i need to keep my thread working and stop the proggie exiting.or how could i make my app stay open until the thread get's out of the loop?
thanx
chris
|
|
|
|
|
Have the main wait for the threads to finish. When you created the threads you are given a handle to each thread. Just do a wait multiple for all on the thread handles.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
If you are using Managed Threads --> check IsBackground thread property: may help.
"...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
|
|
|
|
|
Hi everyone
If i type:
System::Windows::Forms::Button* btn = new System::Windows::Forms::Button();
btn->
in a generic C++ class within a C++.NET application i get no intellisense options although if i type it out, the code compiles and works.
Is this a bug?
|
|
|
|
|
I am trying to write a small program to send data to a serial port and then read it back. I need to set this up as a class. I am very new with c++ .net and was hoping someone might have some suggestions or examples. Most of the programs i have seen are more complicated than i am looking for.
|
|
|
|
|
|
Hi everybody.
Is there a way to use .NET Remoting with Visual C++ .Net?
In positive case, how to build the interfaces like they're
built in C#?
Thanks,
Moises.
|
|
|
|
|
|
|
Hello.
I'm writing a managed C++ application, and I have created a __gc class that acts as a Cache between the Database and my application.
I want that this caché can be accesed from anywhere in the application.
So I tried to do this.
In stdafx.h
extern CCache* g_pCache;
In stdafx.cpp
CCache* g_pCache = new CCache ();
and I have the following error message:
error C3145: 'g_pCache' : cannot declare a global or static managed type object or a __gc pointer
Its possible to define a variable of a managed type that its global ? How ?
Thanks.
|
|
|
|
|
|
I have a combo box on a form, KeyPreview is set to true, I use page up and
page down to perform certain tasks in the form, but when the combo box is
selected the keydown event on the form doesnt even fire when i press PageUp
or PageDown, does anybody know why?
|
|
|
|
|
Hello. A problem in the following:
1. In Visual C++ .NET 2003 we create the project: New Project, Visual C++ Projects, (.NET), Windows Forms Application (.NET). Appears Form1.
2. On Form1 we place the button, and in procedure for processing click on this button we write down a code:
Process::Start(S”wmplayer.exe”, S”D:\\My Sounds\\Sound 1.mp3”);
3. At start of the program, the player appears, however file does not sound (there is a message: the file is not found). Without use VC++ .NET, the player sounds this file normally. In VB .NET 2003 this code sounds a file also normally.
Conclusion. If in a name of a folder (where there is a sound file) or in a name of a sound file there is a blank, VC++ .NET can not find this file.
How through VC++ .NET to sound a file (.mp3), in which name there is a blank?
Beforehand many thanks for your answer. Best regards, Dr. V.A. Zharkov. Address: Orekhovy bulvar, 39-2, Moscow, 115573, Russia.
|
|
|
|
|
Hi all,
I'm new to Managed C++. I'd like to set unicode string for the form's title. I tried many ways, but they just didn't work. I even set the preprocessor _UNICODE, but I think it should be default.
private: System::Void Form1_Load(System::Object * sender, System::EventArgs * e)
{
this->Text = "中文hi"; // doesn't work, it'll show ??hi
this->Text = _T("中文hi"); // doesn't work, it'll show ??hi
}
Please help. Thanks.
|
|
|
|
|
You need to use the macro "S"
like S"something".
hope this helps.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Thanks, Anthony. I tried, but doesn't work.
|
|
|
|
|
Have you tried using the L prefix.
L"awetawegwa"
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Hi,
How do I do to convert the managed type 'System::Data::String' to the unmanaged type 'PWSTR' ?
thanks.
|
|
|
|
|
Use CStringT in ATL like the way you use it in MFC.
#include <atlstr.h>
<br />
String *strTemp;<br />
CString strConverted = strTemp;
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
|
Hello,
Can you tell me How unmanaged DLL is used in managed applications?
One programmer from our company has left project halfway and I have been assigned to same project. Unfortunately no documentation is available. I do not have experience on VC++/Managed C++. So along with reading MSDN I am doing some reverse engineering.
I could figure out that person has created Managed class library which is refrenced in other projects. Only managed keyword is "__gc classname"
In managed c++ library header file of native dll is included and in source files section lib file for same dll is placed.
Managed library is calling API's from unmanaged library. Parameters for those APIs are of type int , char, array of characters, predefined structures containing memebers with data types int , char, array of characters, pointer to array of char.
Those structure members are initialized with required values before passing them as parameters to APIs of unmanaged dll. For that variable with same stucture types are defined as that mentioned in header file for native dll.
These structure variables are not declared as managed but those are inside managed class?
And it is working just fine.
So my first doubt is are those variables treated as managed variables or value types?
And __box / __nogc is also not used then I was wondering how it is working.
Can anyone explain me how it is working?
And also looking at header file I could not figure out what type of dll it is means created using c++ or c
The function definitions are like
------------------------------------------------------------------
#include <windows.h> // in the beginning of file
#if !defined( PREANSI )
extern "C" int __stdcall MyFunction(int k)
#else
int __stdcall MyFunction(int k)
#endif
-------------------------------------------------------------------
So my second doubt is , is dll created using c/ c++ and what is type of dll?
It is not exporting any types. Because help is given for building wrapper around COM Componenents or C++
I want to know these things so that I can do further implementation with understanding.
Please help me regarding this.
Regards
Shailaja
|
|
|
|
|
First, understand that there are two types of managed C++ DLLs (assemblies, actually, which contain 0-n modules, a manifest of modules, resources, bindings, and other assembly info, and resources): mixed-mode and pure IL.
Mixed mode: Various understood types (like int , for example) are translated by the compiler to managed types (like System.Int32 ) whenver possible. Other types and functions are compiled into native code (that is, unmanaged C++) and added to the module as native blocks that are unverifiable by the CLR. DLLs are linked to the assembly using the IL instruction .module extern DLL in many cases. There is much, much more than goes on than this, and you should check out MSDN about it. This is especially good for the first step in moving legacy applications or certain components to managed applications if you have good reasons to do so (i.e., if it isn't broke - don't fix it. The .NET Show on MSDN discussed this in the Sept. 2003 interview with members of our own CP web site).
Pure IL mode: Only managed constructs are used throughout the entire project. This compiles down to IL (specifically, MSIL) like most other languages would, such as C#, VB.NET, and J#.
If you don't see __gc throughout the code, it is most likely mixed mode. The compiler, if I remember correctly, figues this out automatically based on what it can do.
As far as the preproc definitions toward the end of your question, that merely tells the compiler to use C-style decorations (rather, the lack thereof) on the function and to call it using the __stdcall calling convention.
Basically, you'd do well to read the section on MSDN about managed extensions: http://msdn.microsoft.com/library/en-us/vcmex/html/vcconMCOverview.asp[^]
It has a lot of great material that goes in depth (and presents simple concepts) about the very basic things I've touched on here.
I hope this helps.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi,
I'm beginner and I have a little problem.
How can I change in managed C++ member variables of a class
in other classes?
More detailed:
I have a class A which is invoked in the main Windows init procedure.
This class A has some member variables (arrays).
Class B is invoked somewhere in my program.
I would like to change this member variables of Class A within an procedure
of Class B.
As far as I know, this is not possible, nor, you can use global variables in managed C++.
My idea is to use an interface between these classes somehow.
Well, I hope you understand my problem and can help me.
If not, I can explain it better or give you some code parts of my Program.
Thank you
|
|
|
|