|
It'll still be supported through a compatibility wrapper, but nothing new will be added to it.
|
|
|
|
|
Thanks!!
Hopefully, by then managed C++ will have been standardized and brought in tune with ISO C++.
|
|
|
|
|
|
Hello everybody!
I'm a beginner developer in .Net and I need to know if I can convert Bitmaps to Metafiles in anyway. ( The Save method of the Image Class does´nt work beetwen vectorial images and pixelized images ).
Advanced Thanks!
|
|
|
|
|
Hello everybody!
I'm a beginner developer in .Net and I need to know if I can convert Bitmaps to Metafiles in anyway. ( The Save method of the Image Class does´nt work beetwen vectorial images and pixelized images ).
Advanced Thanks!
|
|
|
|
|
You could, but it takes a lot more than just a simple save. The reason for this is that whereas a bitmap is a map of individual pixels, a metafile is a series of drawing instructions. These drawing instructions can be executed to create a bitmap, but it's very hard to convert a bitmap into drawing instructions.
|
|
|
|
|
Thanks for reply. I think I'm going to try it, surely it´s going to be a hard work, but sure there is a right solution in .NET.
|
|
|
|
|
Hi All
i have defined a __value type class.How can i declare and create it in UnmanagedC++ class using new operator on the C runtime heap?
For example
public __value MyClasss
{
public:
int a;
}
//my unmanaged classs
class MyUnmanagedCPP
{
void SomeMethod()
{
MyClasss *pMyClass = new MyClasss();// here i'm getting error C3828
}
}
|
|
|
|
|
This is explained in depth in my book, Extending MFC Applications with the .NET Framework, but the main issue is that managed objects are dynamically allocated on the CLR heap (not the C++ free store). In your particular situation, you're probably getting C3828 because you're writing an MFC applications and running it in Debug mode where the new operator is being #define'd as a placement new operator. You need to do the following where 1) the new operator is being undefined and 2) __nogc is forcing a GC heap allocation instead of a C++ heap allocation:
void Cdeletethis3Dlg::OnBnClickedOk()
{
#pragma push_macro("new")
#undef new
MyClasss *pMyClass = __nogc new MyClasss();
#pragma pop_macro("new")
}
Cheers,
Tom Archer
* Inside C# -Second Edition
* Visual C++.NET Bible
* Extending MFC Applications with the .NET Framework
|
|
|
|
|
Hi everybody!
I am looking for a parser to read vCalendar and vCard streams.
Any Suggestions?
Thanks for help in advance!
|
|
|
|
|
I am having a trouble of getting image from the hard disk.
|
|
|
|
|
System::Drawing::Image.FromFile (static method)
The graveyards are filled with indispensible men.
|
|
|
|
|
If you are using managed C++ here is an article which may help you...
http://www.thecodeproject.com/managedcpp/mcppwinforms02.asp
|
|
|
|
|
He said under c. I assume that means Win32 API only and this is the wrong forum...
John
|
|
|
|
|
I am having trouble with a Forms application I'm writing. I have 3 forms: a main form, Form1, and two modal dialogs, Forms 2 and 3, that are called from the main form. The two dialogs are intended to change certain "control parameters" that are used by the main form to run a control algorithms. So I need the two dialogs to be able to set certain variables that are used by the rest of hte program. Also, when I open one of hte dialogs, the controls on that from should reflect the current state of those variables. I cannot figure out how to do this.
I thought I could declare global variables that could be accessed by all three forms. That way, when I open a dialog, its controls would be set based on the current values of those globals. Then, when I close the dialog and apply the changes, those changes would be saved back to the global variables. I tried this, and I can't seem to define variables that are accessible to all the dialogs.
Am I going about this all wrong? Can anyone help guide me in the right direction? ANy help would be greatly appreciated.
Andrew Krajnik
|
|
|
|
|
I cant remember if windows forms has the OnInitDialog(), if so override that and for the closing of the dialog you can override OnClose().
when you overwrite onclose make sure you call DestroyWindow() from the parent class.
|
|
|
|
|
Hello All,
I trying to call an unmanged code function from managed code and the unmanaged code function requires a type of WCHAR. How can I convert a __GC String to type of WCHAR so it be passed to the function. If I type out the value, such as const WCHAR *pdn = L"Some value"; It works; however I need the "Some value" to be passed in as a variable. By the way this unmanged code is in unicode, if that helps. Thanks, DC
|
|
|
|
|
|
Thanks,
When I try this I get the following:
cannot convert parameter 1 from 'const wchar_t __pin *volatile ' to 'WCHAR *' Conversion loses qualifiers: Here is the code
Unmanaged Code
UserStatus* WaitForChanges(WCHAR* dn)
{
UserStatus* status = new UserStatus();
MonitorLDAPChanges(pdn);
return status;
}
Managed Code
const __wchar_t __pin * str = PtrToStringChars(dn);
WaitForChanges(str);
|
|
|
|
|
I got it I forgot to put the 'const' in the method.
|
|
|
|
|
DR Clevenger wrote:
I got it I forgot to put the 'const' in the method
Yep
Here's the thing.
The __pin keyword is used to indicate that the value should not be moved in memory. This is done because a .NET String is subject to being moved about by the GC and when you convert that data into a WCHAR* for purposes of using that pointer over any length of time, you need to ensure that the data is not moved. The WCHAR* is also defined as const because String objects are immutable.
Anyway, you probably know this, but I wanted to give you a complete answer on what is going on here just in case.
Cheers,
Tom Archer
* Inside C# -Second Edition
* Visual C++.NET Bible
* Extending MFC Applications with the .NET Framework
|
|
|
|
|
Thanks for your help and the information.
|
|
|
|
|
If I have a bit of code like this:
String *s;
int x = 5; y = 10;
Now I want s = "x = (value of x), y = (value of y)"
How do you do that? I hope I explained correctly. I want to be able to change the value of x or y without changing more code.
|
|
|
|
|
int x = 5;
int y = 10;
String* s = String::Format(
S"x = {0}, y = {1}", __box(x), __box(y));
|
|
|
|
|
Hi everybody,
i'll try to explain my problem as short as possible:
->My C++ Dll (Native) should be able to call a C# DLL.
Therefore i implemented a managed C++ dll as a bridge( to
avoid COM).
So, the C++(nat) calls the c++(.net) dll, which calls the c# dll.
When the program is started on a local drive, everything
works perfectly, but once it is copied to a network drive
and run form there, loading the "bridge" - dll fails.
In detail : The C++ 6.0 dll uses LoadLibrary to load
the managed C++ dll and immedeately exits with Error 1114 "
Dll initialization failed" - but ONLY started from a network drive.
( calling other dll's works ). I already tried to make a static
link, same error... only on a network drive...
I don't even have to call a function for getting the error..
I'm trying to find the mistake for a long time... but i think
i'm at the end of my wisdom...
Has anybody some kind of an idea, why
calling my C++.Net dll only works on a local drive???
Problem with the dll- entry-point?
Looking forward to some help! Thanks in advance!
Michael
|
|
|
|