|
Set some Button.DialogResult value for those buttons that should close the dialog and return something.
|
|
|
|
|
Recently i have converted my project to support Common Language Runtime Support (/clr).
After this i notice linking takes long time.
Can we reduce this speed issue?
|
|
|
|
|
I'm very interested in hearing about any solutions you might find. I have a very large MFC application where I want to use .NET WPF.
I have been told that one should not enable the CLR switch for an entire project, but only for the source files that need to interact with .NET code.
Also did the linker time become slow by just enabling the CLR switch, or are you comparing linker times in VC6 with VS2005/VS2008 ?
|
|
|
|
|
No. After CLR conversion only i takes long time to link.
|
|
|
|
|
You could use #pragma unamanged[^] at the top of your unamanaged source files.
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Yes. Isn't always such a shock at what useful things one finds in the documentation. It's almost like it would be a good idea to constantly be using it.
|
|
|
|
|
They should have called it #pragma fast_linking then.
|
|
|
|
|
I'm porting a WindowsControlLibrary solution from DotNet2003 to 2005 and I get the following error
Error 1 error C2691: 'Mcs600CTL::Mcs600CTLControl::flotArray' : a managed array cannot have this element type c:\work\net2005\mcs600ctl\Mcs600CTLControl.h 148
this use to compile on 2003 without any problems
typedef float flotArray __gc[];
public: __event void Mcs600_Raw_Spektra_Ready( flotArray mySpektra); line 148
I also get this error
Error 2 error C2664: 'Mcs600CTL::Mcs600CTLControl::raise_Mcs600_Raw_Spektra_Ready' : cannot convert parameter 1 from 'float __gc[]' to 'Mcs600CTL::Mcs600CTLControl::flotArray __gc[]' c:\work\net2005\mcs600ctl\Mcs600CTLControl.h 1002
__raise Mcs600_Raw_Spektra_Ready(sampleSpectrum); Line 1002
regards,
-dan
|
|
|
|
|
You already have a thread for this question here[^]
Why are you starting new ones when you have not even replied to the people that were helping you in the first thread. That is not really how this site rolls, I suggest you get your act together if you want people from this site to help you.
|
|
|
|
|
Wow dude - that thread you linked to is so old I can't even view the responses.
How did you find that?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Easily[^]
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
He was joking. He was the guy replying to the thread.
|
|
|
|
|
|
I see Diplomacy is not one of your strong suites!!
|
|
|
|
|
It's called tough love. If you want the help, you need to follow the protocol.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Member 2021022 wrote: I see Diplomacy is not one of your strong suites!!
Really? That's what you are going with? You are the guy that has misused the site and you are going to talk about diplomacy. I see Logic is not one of your strong suites.
|
|
|
|
|
Member 2021022 wrote: I'm porting a WindowsControlLibrary solution from DotNet2003 to 2005
The first thing I'd do is stop using the old syntax...otherwise it's not really a port...
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Is there porting guide you can direct me to that has examples of the newer syntax?
regards,
-dan
|
|
|
|
|
Member 2021022 wrote: Is there porting guide
No. And if there was one it wouldn't be provided by Microsoft and it wouldn't be located on MSDN and you certainly could not find it using Google. Do you have to have someone wipe your arse for you? Just trying some more of that thar diplormacy thang.
|
|
|
|
|
|
This was extremely useful. Thanks
-dan
|
|
|
|
|
Hello,
I am using C++/CLI and I am trying to use the function SaveFileDialog but when I run the application in Debug mode when the function ShowDialog()is called I get the error:
"An unhandled exception of type 'System.Threading.ThreadStateException' occurred in System.Windows.Forms.dll
Additional information: Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it. This exception is only raised if a debugger is attached to the process."
And the program quit.
In Release mode the functions SaveFileDialog and OpenFileDialog looks like to work properly.
Can anybody help me wirh this error?
Thank you
|
|
|
|
|
Exception message: Current thread must be set to single thread apartment (STA) mode before OLE calls can be made.
[STAThread]
int main()
{
return 0;
}
Eslam Afifi
|
|
|
|
|
And if I have no main?
I have a dll with an exported function.
When you call this function a Windows Form is opened. In this Windows Form I am trying to add a button "Save File" and "Load File" but here is where I get the exception.
Thank you for you answer
|
|
|
|
|
I think you must either make the windows forms STA or run your dll code in a separate STA thread.
var thread = new Thread(() => { new SaveFileDialog().ShowDialog(); });
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
Eslam Afifi
|
|
|
|