|
Hello,
This is with regard to writing Forms controls using MC++.
Has anyone made any?
If so, what extra steps did they have to take?
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
These are the steps I have done right now :-
#using "..\testcontrol\Debug\testcontrol.dll"
....
using namespace testcontrol;
....
Then I have a member in my class as follows :-
Class1 *m_c;
This is all okay.
Now if I do this anywhere :-
m_c = new Class1();
I get this exception when I run it :-
System.IO.FileNotFoundException
Blast!!!!
It found the file alright!!!
Else how would it even compile properly
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Place testcontrol.dll in the output directory of the application which you are building.
|
|
|
|
|
Just did that Rama
Sucks huh?
I thought the #using would tell the blasted compiler to tell the blasted linker to look for it there
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
It's all assembly search policy. I dream to write an article on that. You should be glad that you are not writing the client app in C# in that case there are more interesting issues involoved - C# with MC++.
|
|
|
|
|
Rama Krishna wrote:
You should be glad that you are not writing the client app in C# in that case there are more interesting issues involoved - C# with MC++.
Not so glad anymore...
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Blasted DLL has to be in the same folder as the EXE
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Nish,
I use MC++ for all the projects and C# for Windows forms. Now when I use the C# DLL I need to make sure the DLL is in the compilers path and the exe path. I just change the output folder.
|
|
|
|
|
Albert Pascual wrote:
Now when I use the C# DLL I need to make sure the DLL is in the compilers path and the exe path. I just change the output folder
Yeah, sorta sucks!!!
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
WELL ! I JUST WANNA ASK ABOUT CREATING A SCOKET THROUGH CSocket CLASS
I TIRED THIS CODE (BELOW) BUT IT DIDNT WORKED OUT!
CODE:
CSocket *c = new CSocket();
c->Create(port) ;
it doesnt create a socket .
I EXPECT TO GET THE CODED PROCEDURE OF CREATING A SOCKET! IF ANY ONE CAN HELP ME
|
|
|
|
|
Ok In MC++ you can use TcpClient() TcpListener() and Socket()
Look at this samples by this nice guy called Albert Pascual
http://www.codeproject.com/managedcpp/howtoproxy.asp
and
http://www.codeproject.com/managedcpp/get_the_ip_out_tcpclient.asp
where you can use something like this to listen in a socket :
TcpListener * pTcpListener;
TcpListener = new TcpListener(80);
TcpListener->Start();
TcpClient * pTcpClient;
pTcpClient = m_TcpListener->AcceptTcpClient();
Al
|
|
|
|
|
Thanx for that i'll surely look into it
|
|
|
|
|
I have a C# dll and inside MC++ I tried to use it!
#using "mydell.dll"
I get this error:
fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 2844)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
|
|
|
|
|
Confirmed is a bug!!! NOW WHAT? Not work around? I am so mad!!!
BUG: "C1001 Internal Compiler" Error Message When You Compile Code with Typename Identifier
--------------------------------------------------------------------------------
The information in this article applies to:
Microsoft Visual C++ .NET (2002)
--------------------------------------------------------------------------------
SYMPTOMS
When you attempt to compile the sample code fragment from the "More Information" section of this article, you receive the following compiler error message:
t.cpp(16) : fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 2844)
CAUSE
This behavior occurs if a template class contains a derived member method as a typename identifier. The compiler error message occurs only when you compile the code in a Managed C++ project. You do not receive this error message when you use a native code compiler.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.
MORE INFORMATION
Steps to Reproduce the Problem
Create a new Managed C++ application, and then replace the default code with the following:
#include "stdafx.h"
class A {
public:
void FA();
int i;
};
class B : public A {
public:
virtual void FB();
int k;
};
template <typename f,="" const="" f="" pf="">
class CLockFunc0 {
public:
CLockFunc0() : m_pF(pF) {}
~CLockFunc0() {}
private:
F m_pF;
};
CLockFunc0<void (b::*)(),="" b::fb=""> t1;
Compile the program.
You receive the error message described in the "Symptoms" section of this article.
--------------------------------------------------------------------------------
|
|
|
|
|
After many hours I found the part of my code the crashes the compiler!
|
|
|
|
|
Give us the details Albert
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
I have received an email from MS letting me know its fixed in the next version of the compiler!
|
|
|
|
|
Albert Pascual wrote:
have received an email from MS letting me know its fixed in the next version of the compiler!
That's cool! I didnt think MS would this responsive
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
I am looking some clarifications for the use of IJW and p/Invoke.....
I have a DLL which is written in Visual C++ (NOT a COM component). I am planning to use that from Visual Basic.NET. Infact there is a VB code earlier written to call that DLL. Now the application is being rewritten in VB.NET and I want use that DLL. What are the ways I can use that DLL?
I found the following ways (I am not 100% what I found are correct or not)
1) Use P/Invoke in Visual Basic.NET and call the functions in the DLL
2) Recompile the C++ DLL using IJW switch so that it will be a managed one. Since my VB.NET code is a managed one, I can access that..Is this approach correct? or do I need to write wrappers over managed C++ obtained after compiling with IJW switch to use in VB?(I heard that after compiling with IJW you can use only with managed C++ and not with any code written using other languages like VB.NET or C#)
Whar is the performance difference between IJW and P/Invoke ?
Can anyone give me an answer?
Thanks in advance,
Madhu.
|
|
|
|
|
Madhu C wrote:
Recompile the C++ DLL using IJW switch so that it will be a managed one
Very confusing! What's an IJW switch?
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
He is talking about the /clr switch in C++ compiler options. (BTW. He posted the same question to DOTNET mailing list)
|
|
|
|
|
Rama Krishna wrote:
He is talking about the /clr switch in C++ compiler options
Oh! Thanks. That explains it
Rama Krishna wrote:
He posted the same question to DOTNET mailing list)
I am not a member there
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
I was talking about the /clr switch in C++ compiler options.
BTW I got some really good answers about IJW and P/Invoke from DOTNET mailing list.
Madhu.
|
|
|
|
|
Madhu _Cheriyedath wrote:
I was talking about the /clr switch in C++ compiler options.
Thanks.
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
I have a C# front end DLL with a namescape FrontEnd
From managed C++ I run the Dll and it works all good. Now I want to call a public function of one of the classes. In Managed C++ I have:
FrontEnd::MyClass * pMyclass;
That works fine but I cannot call any public class:
pMyclass::MypublicFunction(arg1, arg2);
Compiler error:
error C2039: MypublicFunction: is not a member of 'FrontEnd::pMyclass'
Any idea?
Al
|
|
|
|