|
There is a series of introductory articles for C++/CLI here on CodeProject. I imagine they cover delegates. Maybe you should check that out.
|
|
|
|
|
Hi,
I want to display online data in child windows of MDI application of VC++.Online data means the continuous messages which is receiving from other PC's. I want to know whether it is possible to display online and if it is possible how i can display. Or If any one knows any of activeX control for this.. please help me..
Thanks.
|
|
|
|
|
Your question is not clear. Are you doing this in C++/CLI? If not, this is not the correct forum.
|
|
|
|
|
I am getting the following message box whenever I try to debug the code.
<b>“The following module was built either with optimization enabled or without debug information:”
“To debug this module, change its project build configuration to Debug mode.
To suppress this message, disable the ‘Warn if no user code on launch’ debugger option”</b>
I have built the entire code in Debug mode and no where I have enabled the optimization setting.
I am using Microsoft Visual Studio 2008.
I am using the C# .NET for the very first time please help me out in this.
|
|
|
|
|
Are you sure that you have done a debug build? Do you have multiple projects in your solution? If yes, how you added the reference?
|
|
|
|
|
I have solved that issue .........
I just put my dll in GAC by usin Visual studio 2008 command prompt
|
|
|
|
|
deadlyabbas wrote: I just put my dll in GAC
Is that really what you wanted?
The GAC is not a dumping ground for fixing debugging error messages...
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: The GAC is not a dumping ground for fixing debugging error messages
Says you! Next you'll be suggesting that people read the documentation.
|
|
|
|
|
Thnx 4 looking into my problem...........
Sorry 4 d pain i gave .......
Well it ended happily
|
|
|
|
|
Thank goodness for lingo2word.com, otherwise I wouldn't be able to
read his/her reply to you...
Wow...
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I just figured he was replying to you anyway. Probably having trouble figuring out the whole tree structure concept.
|
|
|
|
|
Hi all,
I know, the question sounds simple, but I do not get it at the moment.
Drawing a rectangle into a picturebox is no problem. But as soon as I loaded
an image (here: a bitmap) into it, the image covers my rectangle and it is not to be
seen anymore.
I tried so much things now, getting a the Graphics-Handle of the image itself seemed to
be most logic for me, like:
Graphics ^g = e->Graphics->FromImage(this->pictureBox1);
g->DrawRectangle(gcnew Pen(Color::Black,3),*m_AreaRoi[i].AreaRect);
Failed!
Another try with this:
<pre>e->Graphics->DrawRectangle(gcnew Pen(Color::Black,3),*m_AreaRoi[i].AreaRect);
inside the OnPaint()-Function also failed.
The Project in this case is a Forms Control Library with a picturebox in it, as additional information.
I just want to draw a "region of interest"-rectangle onto the image loaded in the picturebox, it can't
be that difficult...
Please help me!
Thanks
|
|
|
|
|
Are you calling Invalidate() after finished drawing rectangle? If not, call this->pictureBox1->Invalidate() which will force the picture box control to redraw.
|
|
|
|
|
Great, it worked! Thank you!
Graphics ^g = this->pictureBox1->CreateGraphics();
g->DrawRectangle(gcnew Pen(Color::Black,3),*m_AreaRoi[i].AreaRect);
this->pictureBox1->Invalidate();
That's the way it does right.
Instead of Invalidate I used pictureBox->Refresh() and the rectangle always just twinkled a short time and
has gone away.
I don't understand this behaviour, why does Refresh() after calling the functioning code above also "delete" the rectangle?
So what are the Differences between Invalidate and Refresh?
Thanks a lot!
|
|
|
|
|
I am not sure why Refresh didn't worked for you. When you call Invalidate() , it just invalidates the client area. It will not repaint immediately. It will be repainted when the control receives a WM_PAINT message. So Invalidate() is not synchronous.
Refresh just calls other overload Invalidate(true) and Control.Update to force paint on the control. This is synchronous and you can see the effect immediately.
I tried your sample and Refresh worked just fine on my machine.
|
|
|
|
|
I'm trying to learn c++ and I just spent some time trying to use GetWindowText(). I was getting a linker error for unresolved token LNK2028, LNK2019. I finally added "C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Lib\User32.lib" path to Project->Properties->Linker->Input and it worked. But I have two questions for anyone who may know so that I may understand a little better. And maybe someone else can use this later, too.
.NET 2008 C++, WinXP Home
1) Why did I have to that? I kept telling myself the dll was already referenced and I had the "windows.h" #include going on. Everything looked correct (as far as my understanding goes (not far)).
The code is in a normal CLR project, .NET Form button_click (so it must be using User32.dll already, right?). If you check the Linker->Input Additional Dependencies it shows User32.lib in "Inherited Values" along with all of the other Windows libraries. So I assumed I didn't have to add it.
2) It may have worked but did I do it 'right'? I ran a search on my drive for user32.lib (I expected it in C:\WINDOWS somewhere but it was in the path listed above. Should I move it? There are others in "C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib" and the like.
Thanks.
|
|
|
|
|
thenutz72 wrote: Why did I have to that? I kept telling myself the dll was already referenced and I had the "windows.h" #include going on.
windows.h has nothing to do with the linker. It's the import library
you were missing that the linker needed.
thenutz72 wrote: The code is in a normal CLR project, .NET Form button_click (so it must be using User32.dll already, right?).
No. The .NET framework may use user32.dll internally but that has nothing to do with your project.
thenutz72 wrote: It may have worked but did I do it 'right'?
Not necessarily. If you're using native code from a managed class' code,
the you would use platform invoke: Using Explicit PInvoke in C++ (DllImport Attribute)[^]
You shouldn't be mixing paths to different SDKs. If you're using the
Visual Studio IDE for your project, then use its directories settings
to configure paths to the ONE SDK you want to use. Then you don't need
paths in all your project configurations unless you need to override something.
Learning C++/CLI is a pretty big undertaking for a beginner in C++...
Are you sure you don't want to get familiar with the C++ language before adding
the complexity of the managed world? All your questions are fundamentals you should know
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
I am working on AD RMS so can u plz tell me that how to get the machine certificate and
how to get the User License and How to get RAC(Rights Account Certificate)
PLease tell me that what is needed the first.
|
|
|
|
|
|
Hi All,
I am Savitri Here. I new to VC.Net.I am using visual studio 2005.In this i am doing one small program. I started the project like CLR->Windows Application. In that initially Form1 was created.In that i added one more Windows Form called Loginform. I am accessing functions and variables from loginform to Form1 by adding #include "LoginForm.h" in form1.h. But i want access functions of Form1 into LoginForm class,in this i am facing problem and i was not able to include "Form1.h" in LoginForm. Why it is giving problem i am not understanding? Please give me some solution or hints from that i will solve the problem. Please tell me any good books for vc.net and i want some samples of vc.Net.Please help me out.
Thanks in advance to all.
Regards,
Savitri P
|
|
|
|
|
Hi Savitri,
savitri wrote: Why it is giving problem i am not understanding?
If you do that, you will get circular reference. This is the reason for all those errors. You need to forward declare Form1 inside LoginForm and include form1.h in LoginForm.cpp and use the methods from Form1 .
ref class Form1;
public ref class Loginform : public System::Windows::Forms::Form
{
}
#include "form1.h"
void Loginform::SomeMethod()
{
} savitri wrote: Please tell me any good books for vc.net and i want some samples of vc.Net
1 - C++/CLI in action[^]. (This is my favorite)
2 - Visual C++/CLI and the .NET 3.5 Platform[^]
|
|
|
|
|
Hi,
Thanks for suggestions.But still i have one doubt. That is shall i create object in constructor or what? or without that how can i use methods of form1 in loginform. Help me please.
Thanks in advance.
Regards,
Savitri P
|
|
|
|
|
Pass the Form1 object via LoginForm 's constructor.
|
|
|
|
|
Hi Navaneeth,
Thanks for your reply.I have one more doubt hot we can inherit the classes in vc.net programming. Like in C# i have one class called xyz this is normal class not window form. and one more class called save this is windows form. they wrote like this. partial class save: public xyz{ //code here}. Like this how can i write in vc.net or else is der another way to access one class into other class. Please help me out.
Thanks in advance.
Regards,
Savitri P
|
|
|
|