|
Hello Andre,
I have just tried this with VS.NET 2002 and 2003. I constructed a VS.NET 2002 project using the CollectionBase class and it failed to compile.
Then I opened the project in VS.NET 2003 and it compiled successfully!!!
Please look for an upgrade route now to avoid headache.
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
Here's some of my code:
...<br />
BtCard = socket(AF_BTH, SOCK_STREAM, BTHPROTO_RFCOMM);<br />
if(WSAGetLastError() == 10047)<br />
{<br />
cout << "Address family not supported by protocol family!" << endl;<br />
goto GetOut;<br />
}<br />
...
The socket function call above gives me the error message listed.
Checked the help documentation. Here's what "they" says on the use of the function:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/bluetooth/bluetooth/bluetooth_and_socket.asp[^]
Me, wrong!?! Nah, you just need to change your thinking to make me right.
|
|
|
|
|
Hello Aaron,
Please try the Visual C++ forum for API/VC++/MFC questions. This forum is for MC++.
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
Is this possible ?
I'm trying to use a TabControl and TabPage.
I can place the TabControl, and a couple of TabPage, and single items in the TabPage
Here, m_pManagerPage and m_pOperationPage are Form, that I wish to Add to the m_pOperationTabPage (instead of m_pButton1).
The Question is, Can a Form like a modeless dialog within a dialog (like in MFC), that can be placed within another Form ?
m_pTabControl = new TabControl;
m_pButton1 = new Button;
m_pButton1->Text = S"Text";
m_pButton1->Size = System::Drawing::Size( 70, 25 );
m_pButton1->Location = Point( 10, 10 );
m_pManagerTabPage = new TabPage( S"Manager" );
m_pOperationTabPage = new TabPage(S"Command" );
m_pTabControl->TabPages->Add( m_pManagerTabPage );
m_pTabControl->TabPages->Add( m_pOperationTabPage );
m_pOperationPage = new OperationPage();
m_pOperationPage->Hide();
m_pManagerPage = new ManagerPage();
m_pManagerPage->Hide();
m_pOperationTabPage->Controls->Add ( m_pButton1 );
m_pTabControl->SelectedIndexChanged += new EventHandler(this, &FloatingWindow::ChangePage );
Controls->Add( m_pTabControl );
Thanks.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
For your needs, I think UserControl will do. However, it is possible to place a form in a form. This key is setting the TopLevel property to false before adding and making sure it is visible.
It will even appear in the Designer, just that the TopLevel part will be deleted in the designer.
The following is a complete source which will compile to display a form in a form, try it...
#pragma once
namespace MustGo2
{
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
public __gc class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
}
protected:
void Dispose(Boolean disposing)
{
if (disposing && components)
{
components->Dispose();
}
__super::Dispose(disposing);
}
private: System::Windows::Forms::Form* panel1;
private:
System::ComponentModel::Container * components;
void InitializeComponent(void)
{
this->panel1 = new System::Windows::Forms::Form();
this->panel1->TopLevel = false;
this->SuspendLayout();
this->panel1->AutoScaleBaseSize = System::Drawing::Size(5, 12);
this->panel1->ClientSize = System::Drawing::Size(248, 198);
this->panel1->FormBorderStyle = System::Windows::Forms::FormBorderStyle::Fixed3D;
this->panel1->Location = System::Drawing::Point(16, 16);
this->panel1->Name = S"panel1";
this->panel1->Visible = true;
this->AutoScaleBaseSize = System::Drawing::Size(5, 12);
this->ClientSize = System::Drawing::Size(292, 266);
this->Controls->Add(this->panel1);
this->Name = S"Form1";
this->Text = S"Form1";
this->ResumeLayout(false);
}
};
}
What I did is to place a planel using the Designer and then replaced it with Form class in the code
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
Long time listener, first time caller.
I'm breaking up a large application into some DLLs, and I'm having trouble with some dialogs. The DLLs are linked to the app implicitly, and use MFC in a shared DLL (in debug).
The problem is that dialogs internal to the DLL don't appear when I call DoModal(). By tracing the code, I've found that it can't load the dialog template, so the dialog fails to load. I've searched MSDN, but I haven't found anything that deals with dialog resources in an implicitly linked DLL.
What am I doing wrong? Do I have to do something to export the dialog template (and any other resources) when I compile, or do I need to do something in the linking application?
Thanks in advance!
-Aaron
|
|
|
|
|
Hello Aaron,
Please try this forum for VC++/MFC questions. This forum is for MC++.
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
Paul is right you are on the wrong board.
I suggest you repost on "Visual C++" board after you have read the article "Screen Event Recorder DLL/Application", on codeproject, and look at the code to see if it provides an answer to your question.
Trust in the code Luke. Yea right!
|
|
|
|
|
Hi all
I am looking for a good article(s) that explains how to use .NET component (even UI) in MFC dll or MFC app.
|
|
|
|
|
|
Thanks Nish, I already checked it. Can I use the same idea to call Windows Form component from MFC application (as View)????
|
|
|
|
|
fnaddaf wrote:
Can I use the same idea to call Windows Form component from MFC application (as View)????
If you want to use a .NET Forms control as an MFC view there is a sample in the VC++ 2003 beta CDs. It's not easy and involves a lot of round-about stuff. I wouldn't recommend it. I also saw a similar article by Chris Sells on the web - don't remember the URL. I think it was Kannan K who told me about it, you could try searching for it. Unless you really want to use Forms inside a view you are better off using MFC for the GUI. maybe you can pop-up a Form for data-entry. Anyway good luck.
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
Thanks a lot Nish,
|
|
|
|
|
|
Chris Sells and I are writing an article right now for MSDN that is a complete WinForms with MC++ for the MFC Programmer. It includes how to access windows forms controls from MFC.
----------------------------
Sam Gentile
Microsoft .NET Consultant
http://samgentile.com
Read my blog at http://dotnetweblogs.com/sgentile/
|
|
|
|
|
Thanks Sam, nice to see you hear in CP
I've been reading your blogs for quite some time.
I hope to see more articles from you on MC++ and COM/Interop.
regards
Kannan
|
|
|
|
|
Are there predefined images for toolbars and menu items that we can use ? A bit like the default ones that are used for default MFC application (save, load, ... )
For using in Managed C++ .net Forms application.
Thanks.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
Look in the Common7\Graphics directory of your VS.NET installation directory. Use the bitmaps and set the mask to System.Drawing.Color.Silver .
Reminiscent of my younger years...
10 LOAD "SCISSORS"
20 RUN
|
|
|
|
|
I don't have that directory or anything looking like Graphics, the only images that I found were the ones in the different samples.
Anyway, for now, it's not that important, will change and/or use other custom made images.
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
It was an option while you were setting up Visual Studio. You may want to change your setup options from Add/Remove Programs for Visual Studio and have them installed. They come in handy.
Another way is to use ildasm.exe to dump the IL and resources (everything in the assembly referenced in the assembly manifest) into a directory for the major assemblies like System.dll, System.Design.dll, System.Drawing.dll, and System.Windows.Forms.dll. There's a lot of goodies in there!
Reminiscent of my younger years...
10 LOAD "SCISSORS"
20 RUN
|
|
|
|
|
I'm trying to use a form I created in C# in a VC++ program I am creating. (Descriptive subject, no?) I have the C# compiling into a DLL and ... well that's about as far as I can get. I've done some reseach in the MSDN, and it shows how to use console classes, but nothing about how to use a form created in C#. I don't have the code on this computer, but the method I found I was trying last was using the following code (Close as I can 'member)
#using <mscordb.dll>//However main CLR dll is spelled.
#using "MyCSharpDLL.dll"
using namespace MyCSForm;//I tried it with and without this
//line and it didn't work either way, so I show it.
That's about where I get to. I also try to create an object of the class in the name space using either
MyForm Form1;
OR
MyCSForm::MyForm Form1;
Depending on if I use the "using namespace MyCSForm;" line or not.
I have also tried to using a slightly more complex method, one that is used to load functions from a DLL. I use that method to pull things out of a C++ dll that uses dllexport to say what comes out. That method can load the C# DLL but I can't figure out what I would be trying to load from it. Tried and failed to do the form, and main and even the namespace. None worked. At least I don't know how to get them to work.
Any help would be appreciated and if you have question I will answer them to the best of my abilities. And if I am going all wrong on how to load a DLL made in C# into C++, please point me in the right direction. Thanks.
Note: I'm sorry if I seem to be flooding the forum, but I'm not sure which of the three (Visual C++, Managed C++, C#) I am posting this in would be the best place for it. Since it deals with all three of them, I believe.
Thank you again for any help.
The wisest of the wise may err. - Aeschylus
I'm at home right now.
|
|
|
|
|
Do you want to use the C# form in MC++ or standard C++ application?
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
This would be in a standard CV++ application.
The wisest of the wise may err. - Aeschylus
Codito Ergo Sum - (I code, therefor I am)
|
|
|
|
|
Then you can only use it as an "ActiveX" control, through the COM Callable Wrapper - CCW. There is MFC sample in the MSDN demonstrating using the WinForm as MFC View.
You can also read this MSDNMag artcle, which has a sample putting .NET control in MFC dialog.
You can use the Type Library Exporter tool (tlbexp.exe) to generate the type libraries or the other tools and classes provided by the .NET Framework.
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
Hi!
I'd like to use localized resources in my managed C++ project. The System that is available in e.g. C# (resx - localized satelite dlls) is exactly what I am looking for, so it would be nice to use it. However, vc++.net 2002 does not seem to support this natively. I can only add the "good ol'" .rc files.
How can I use resx files in my project? Do I have to write them manually, precompile them with resgen and then link them manually to my mc++ code?
Will VC++.net 2003 support resx-files natively?
Thanks in advance.
Andre (VizOne) Loker
|
|
|
|