|
PLEASE stop repeatedly posting this question.
There's no managed C++ in VC6 so you're posting in the WRONG PLACE!
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I have created and maintain a VC++ .NET 2005 project that creates a dll for SQL server 2000/2005 extended stored proc.
For now it recomplies the source files(originally written in VC++ 6.0) but it required by me to use the existing COM dll written in VS6 from VC++ .NET 2005.
Is it even possible to call Com dll from VC++ .NET 2005?
If yes how can I do that?
I used to program in .NET but haven't done any intensive programming in years, so please if I ask stupid questions.
Please feel free to ask any other info.
Thanks in advance for your help.
-Amit
|
|
|
|
|
amalhotr wrote: Is it even possible to call Com dll from VC++ .NET 2005?
Yes.
amalhotr wrote: I used to program in .NET but haven't done any intensive programming in years
Ok, but are you an experienced C++ developer? If not then you are not prepared to do COM development in C++. First one learns C++, then one learns other things like how to do Win32 COM development.
amalhotr wrote: so please if I ask stupid questions.
There is no such thing as a stupid question. However there are questions posted into the wrong forum. This forum is about doing managed development for the .NET platform using C++/CLI. That does not appear to be what your question is about.
For native C++ questions there is the Visual C++ / MFC forum
For COM questions there is the COM forum
Either one of those would probably have been a more appropriate forum for your question.
led mike
|
|
|
|
|
Thanks for your help.
I'll post it in COM forum.
|
|
|
|
|
Please Guide I command "Update" Sql2000 in VC++6.0.
thanks very much
|
|
|
|
|
I have the same question as the guy below this form, but my question has to do with MDIparents and childs. I followed a guide that told you how to, but I kept getting errors everytime I built it.
http://www.functionx.com/vcnet/Lesson07.htm[^]
I used this guide, but it gave me errors saying its a mix between Managed and nonManaged C++.
I'm new to MDIParents+childs and was wondering if i can get some help with this.
And when i used what you told the guy below me i got these 2 errors.
System.InvalidOperationException: Starting a second message loop on a single thread is not a valid operation. Use Form.ShowDialog instead.
System.InvalidOperationException: Form that is already visible cannot be displayed as a modal dialog box. Set the form's visible property to false before calling Show.
I did what it said both times, but still got same problem.
modified on Sunday, August 24, 2008 11:02 PM
|
|
|
|
|
I don't know what you already tried to do.
But I think it is quite easy to add a MDI child form.
In the MDI-Parent, set IsMdiContainer = true.
And to create a new Child (e.g. from a event handler
within the MDI-Parent):
Child^ child = gcnew Child();
child->MdiParent = this;
child->Visible = true; Alex
|
|
|
|
|
Hi, I need use two forms in application. Is some easy way exists? I do that in Delphi, but in C++/CLI Win Form app is something understandable. I was googling for some easy practise, but not found it.
Is there something who help me with piece of code for two forms?
|
|
|
|
|
you can use multiple forms in C++/CLI. Just right click on your project and click "Add new Item..."
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Sure, but I cant use (in example) in Form1 ->
Form1.Visible = true; OK
Form2.Show = true; it doesnt know Form2
(I maybe use :: )
I must include something to Form1?
|
|
|
|
|
You can create 2 separate forms just as teejayem suggested, but if you want them completely independent of each other (i.e. Form2 is not a child of Form1), then you need to modify your <project_name>.cpp file that opens your main form. This file contains your main loop, and probably has a line like
Application::Run(gcnew Form1());
You would need to change this to create your Form1 and Form2 objects, show them, and then start your application. You might need a DoEvents loop, but there might be a way around that.
Dybs
|
|
|
|
|
You have to include the form2.h in your form1.h file for you to be able to use it
#include "Form2.h"
also "Show" isn't a property, it is a method. You shouldn't be trying to assign a boolean to it
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Thank you, it works, but there is still little problem.
Form1::Visible = false;<br />
<br />
<br />
Form2->Show();
|
|
|
|
|
I'm guessing that is because your varaible name is the same as your class name. so the compiler is thinking your trying to call a static method. Change your variable name to something more unique
System::Windows::Forms::Form^ myFrm2 = gcnew System::Windows::Forms::Form()
myFrm2->Show()
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Oh, thank you for your help. I was googling with "c++\cli" AND "#include"Form2.h"" and I found solution. It was that what you wrote. Same name Form2. THANK YOU
modified on Sunday, August 24, 2008 1:43 PM
|
|
|
|
|
I need a simple example on how to use OpenFileDialog(). I don't want to extend it or enhance it (I did search for articles), just use it. Even after searching the entire Visual Studio directory, I cannot find the right files to include so that the compile stops telling me that OpenFileDialog is an undeclared identifier.
Do you have a link that will help me out?
Thank you.
Thanks for your time
|
|
|
|
|
example
to use this class you need to include the System.Windows.Forms assembly and add the namespace on top of your .h
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Hello teejayem,
I feel like there are too many questions to ask. I check your example link, but Microsoft leaves so much out and is so different from my code that I don’t understand it.
RE: to use this class you need to include the System.Windows.Forms assembly and add the namespace on top of your .h
Does this mean to put the below at the top of my .h file?
#include “System.Windows.Forms”
using System.Windows.Forms
The on button function in my code, created by VS, starts like this:
void Ctest1Dlg::OnBnClickedSelectLogFileButton()
{
And does not look anything like the example code:
void button1_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ )
{
I read about the ^ character and still don’t make any sense of that.
I wonder why we need more obscure characters in C++. It seems like we are trying to turn C++ into APL.
And just to be certain, I am using Visual Studio 2008 under Windows XP Home.
Thanks for your time
|
|
|
|
|
"RE: to use this class you need to include the System.Windows.Forms assembly and add the namespace on top of your .h"
you need to add the namespace like:
using namespace System::Windows::Forms;
"I read about the ^ character and still don’t make any sense of that."
"In C++/CLI the only type of pointer is the normal C++ pointer, and the .NET reference types are accessed through a "handle", with the new syntax ClassName^ instead of ClassName*"
Source[^]
"I wonder why we need more obscure characters in C++. It seems like we are trying to turn C++ into APL."
Hopefully you are talking about C++/CLI and not pure C++! You cannot use managed classes in a pure C++ application.
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
bkelly13 wrote: I wonder why we need more obscure characters in C++. It seems like we are trying to turn C++ into APL.
C++/CLI should be treated as a separate language.
C++ is still C++. No obscure characters have been added.
Are you sure C++/CLI is what you want to use? There's also
a way to use the open file common dialog from native C++.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hello Mark,
RE: Are you sure C++/CLI is what you want to use? There's also
a way to use the open file common dialog from native C++.
No, I am not sure at all I want to mess with this. I activated Help from my Visual Studio to find out how to open a dialog for opening a file. I wound up here, but I am not at all sure where I want to be.
Thanks for your time
|
|
|
|
|
|
Good information. I had not found that.
Thank you for posting this.
Thanks for your time
|
|
|
|
|
Please Guide Connect Sqlserver with VC++6.0.
application is win32 consoleApplication
thanks very much
|
|
|
|
|
What have you tried coding so far? What exactly are you having trouble with?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|