|
|
I've created a Button and what i'm trying to do is when I click the button I want a message box to pop up...
void ksclass::OnBnClickedButton1()
{
::AfxMessageBox(_T("Hello Wolrd !"));
// TODO: Add your control notification handler code here
}
the ::AfxMessageBox(_T("Hello Wolrd !")); helped with the errors but when I run then click the button... nothing happens...
Thanks
Kitty5
|
|
|
|
|
If this is an ordinary C++ application, you can use:
::MessageBox( 0, "Hello, World!", "", 0);
|
|
|
|
|
why do you have :: in front of Message Box?
|
|
|
|
|
kitty5 wrote: why do you have :: in front of Message Box?
It is the global scope operator. Instructs the compiler to use the global MessageBox function.
Regards,
Nish
|
|
|
|
|
You need to #undef the MessageBox macro definition before using the .NET MessageBox class.
#undef MessageBox<br />
MessageBox::Show("hello");
Regards,
Nish
|
|
|
|
|
You'll need #undef MessageBox after #include "stdafx.h" - it's trying to use the standard MessageBox rather than the .net one.
Mark
|
|
|
|
|
Hello,
I played a bit with the vcCodeModel and it is a great tool to gather information.
However, the one functionality I couldn't find is the one that's already supplied by the ObjectBrowser: Discovering which functions calls to which, the way ObjectBrowser does.
Anyone has an idea?
|
|
|
|
|
In the good old days I believe people were using the arcane technology which came to be known as COM+ to embed other application's document in their own document.
Like a Word with document a Windows Media Player or Excel or Visio document inside, double click on it and *bang* you coud start edit it using Excel/WMP/Visio toolbar.
Apparently even OpenOffice could do that.
Now here is my question:
I'm a new generation programmer. Blissfully ignorant of such thing.
But I would like to know and embed Word, Excel or other kind of document in my application's own document!
How could I do that?
And is there an up-to-date technology (i.e.: .NET API) to do that?
|
|
|
|
|
hi..
please give me example of threading
Rahul Kulkarni
|
|
|
|
|
I have just browsed the msdn[^]...
<code>
using namespace System;
using namespace System::Threading;
ref class Work
{
public:
Work(){}
void DoWork(){}
};
int main()
{
Work^ threadWork = gcnew Work;
Thread^ newThread = gcnew Thread( gcnew ThreadStart( threadWork, &Work::DoWork ) );
newThread->Start();
}
</code>
|
|
|
|
|
I seem to have a problem using the DataGrid/DataGridView within a MFC dialog (using the CWinFormsControl< > template).
I create a DataSet from a Xml file and then set it to the DataSource. I also set the DataMember to the appropriate table name, but nothing is displayed in the grid view. I tried other various approaches, but nothing seems to work.
I have no problem setting this up in WinForms - it just won't display in MFC. I know the data's there because I can actually step right into it from the DataGrid object - it just won't display - the ColumnCount is still 0.
What's the problem? Has anyone else experienced this? If so, has anyone found a way around this?
I just don't understand why this won't work.
|
|
|
|
|
Hi there!
Newbie question: I want to develop an app using managed C++ and Windows Forms, is it possible to use some of the nice C# controls I see on this page in my app?
|
|
|
|
|
If this question is about "is it easy to use them", the answer is yes. As most C# controls are compiled into assemblies(DLLs), you should be able to use them in your C++ applications with no or little problems.
If your question is about copyright, consult with the author or CP staff about terms and conditions.
- It's easier to make than to correct a mistake.
|
|
|
|
|
Hi..
actually what the thing is i have a project in console application working properly.
Now i want to make it windows application. I have copied all the file of the console
application to new Window application. now main is in call_main.cc file. I want to call the main
and replace the console.writeline() by messagebox::show. Can i do this.
Else give me suggetion to make console application to windows application simply.
Thanks in Advanced
Rahul Kulkarni
Rahul Kulkarni
|
|
|
|
|
RahulRKulkarni wrote: I want to call the main
and replace the console.writeline() by messagebox::show. Can i do this.
Yes.
RahulRKulkarni wrote: Else give me suggetion to make console application to windows application simply.
There is no one-size-fits-all solution.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I have a Unmanaged Dll.
signature of the function is :
Err_code f1(char** return_name);
what marshal types can i use for this?
the eq unmanged code is :
char* name = NULL;
f1(&name);
printf("%s",name);
i do not know how to use the marshal types for this situation?
thanks in advance
^-^
@|@
- redCat
|
|
|
|
|
Hello everybody, I am a newcomer and I would like to ask:
What is the relation between MFC and C++/CLI?
At first I was interested in MFC but I figured out that programming with C++/CLI is a lot easier.Is it necessary to learn MFC to make a decent application?Can I use both MFC and C++/CLI to make a programm, or there are other C++/CLI libraries that I can use instead of MFC?
|
|
|
|
|
I'll try to keep my answers simple:
Lord_Vader wrote: What is the relation between MFC and C++/CLI?
There really isn't any relation between the two. Depending on how you look at it, but MFC is a class library that wraps up Win32 API. Also, it is a Windows programming model that supports document-view architecture. On the other hand, C++/CLI is the CLI extension of C++; it is a language. The .NET Framework 2.0 built on C++/CLI has provided some libraries, but it doesn't have any mature architecture yet (as MFC does).
Lord_Vader wrote: Is it necessary to learn MFC to make a decent application?
No, you can build decent applications without MFC.
Lord_Vader wrote: Can I use both MFC and C++/CLI to make a programm,
To some degree, yes, but it usually creates unnecessary complexity.
Lord_Vader wrote: or there are other C++/CLI libraries that I can use instead of MFC?
.NET Framework does have such libraries as GDI+, DirectX, etc. It also has primitive event model to help. However, .NET Framework lacks a Window programming model/architecture like MFC yet. At the current state, .NET has barely set up a generic programming model, but it evolves quickly. I expect to see more support from future versions of .NET.
Hope this answers your questions.
- It's easier to make than to correct a mistake.
|
|
|
|
|
If you look at the top of your program window, there is an icon, and the window title. I am trying to set that icon for my program, but I have not been able to find out how to do it. I have tried various solutions and they have not worked, so if anyone could point me in the right direction it would be most appreciated.
Thanks,
Bob X
-- modified at 17:37 Thursday 8th June, 2006
[edit] I have got the icon on the title bar of my program now working, but when I look at the program's .exe file, The icon which is displayed there has not changed. Does anyone know of a way to change that icon? Thanks [/edit]
-- modified at 11:12 Friday 9th June, 2006
[clarification] I am programming using managed c++.net and I am not programming using a windows form application [/clarification]
|
|
|
|
|
Can you not just replace one .ico file with another? Your requirements may be different than mine, but I've done it this way for years (and it always works).
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thanks for replying and giving me a serious answer.
I am not sure what you are referring to though. I don't have a .ico file in my project and when I go into the properties of the completed executable, I am not able to change the icon.
I'm also not sure how are changing the icon. If you would be able to explain it would be appreciated.
Thanks
|
|
|
|
|
I was referring to replacing the .ico file itself. Use Windows Explorer for this.
However, I know nothing of Managed C++ so the whole concept/environment is foreign to me. You may very well not have any .ico files as part of your project.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
You are referring to replacing the default icon that windows uses when compiling programs?
How would I do what you are suggesting?
|
|
|
|
|
Can you navigate to your project's folder and search for any .ico file(s)?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|