How to use VC++.Net code in VC#.Net project?
-
Hello I have one VC++.Net project & want to use it in VC#.Net project. For that i add reference oc VC++ project & it is successfully added. But the problem is that in VC++ project there is no namespace & no class. All functions are globle. All are display in object browser. But no reference found in C# editor. plz help me. Regards
Divyang Mithaiwala
-
Hello I have one VC++.Net project & want to use it in VC#.Net project. For that i add reference oc VC++ project & it is successfully added. But the problem is that in VC++ project there is no namespace & no class. All functions are globle. All are display in object browser. But no reference found in C# editor. plz help me. Regards
Divyang Mithaiwala
If I am not mistaken, you are trying to use VC++ code in a C# Project! Right? Well, you simply can't do that? .NET has given us Language independence but not true Language Independence! I mean, you can't use VC++ code in a C# Environment. Got it? What you could so is, compile the functions from the VC++ project into a dll and then use it from the C# project. :) Hope this helps... --- With best regards, A Manchester United Fan The Genius of a true fool is that he can mess up a foolproof plan!
-
If I am not mistaken, you are trying to use VC++ code in a C# Project! Right? Well, you simply can't do that? .NET has given us Language independence but not true Language Independence! I mean, you can't use VC++ code in a C# Environment. Got it? What you could so is, compile the functions from the VC++ project into a dll and then use it from the C# project. :) Hope this helps... --- With best regards, A Manchester United Fan The Genius of a true fool is that he can mess up a foolproof plan!
Actually i am not trying to use code of VC++ in VC#. But i want to use function call of VC++ in VC#. Which is successfully done if project have namespace & class. But for my condition there is no namespace & no class in VC++ project. Regards,
Divyang Mithaiwala
-
Actually i am not trying to use code of VC++ in VC#. But i want to use function call of VC++ in VC#. Which is successfully done if project have namespace & class. But for my condition there is no namespace & no class in VC++ project. Regards,
Divyang Mithaiwala
Is the code you have written in VC++ managed? --- With best regards, A Manchester United Fan The Genius of a true fool is that he can mess up a foolproof plan!
-
Is the code you have written in VC++ managed? --- With best regards, A Manchester United Fan The Genius of a true fool is that he can mess up a foolproof plan!
VC++ project is Win32 console dll.
Divyang Mithaiwala System Engineer & Software Developer
-
VC++ project is Win32 console dll.
Divyang Mithaiwala System Engineer & Software Developer
Divyang Mithaiwala wrote:
VC++ project is Win32 console dll.
That's your problem. If you want to use a dll using Namespaces then the dll must be managed. If it is unmanaged then you will have to import the function of the dll using DLLImport. Check out articles related to calling Win32 APIs using C# in CP. Hope this helps...:) --- With best regards, A Manchester United Fan The Genius of a true fool is that he can mess up a foolproof plan!
-
Divyang Mithaiwala wrote:
VC++ project is Win32 console dll.
That's your problem. If you want to use a dll using Namespaces then the dll must be managed. If it is unmanaged then you will have to import the function of the dll using DLLImport. Check out articles related to calling Win32 APIs using C# in CP. Hope this helps...:) --- With best regards, A Manchester United Fan The Genius of a true fool is that he can mess up a foolproof plan!
Any other method to use it. Becoz when i use it as DLLImport then at run time it will give error that "Attempt to read or write protected memory". thanx.
Divyang Mithaiwala
-
Any other method to use it. Becoz when i use it as DLLImport then at run time it will give error that "Attempt to read or write protected memory". thanx.
Divyang Mithaiwala