|
Hi Ursus,
i went to the site but it does not have much information. I really dont know where these functions are defined.
it seems there is a problem when one develops managed c++ applications.
ve
|
|
|
|
|
As you no doubt know, new and delete are C++ language keywords. And, if you are writing a filter in DirectShow, which is an unmanaged library, you shouldn't be getting that error for any reason that I can imagine. It doesn't make sense. Are you using the /clr switch?
I really can't imagine why that is happening, except that your error is SO HUMONGEOUSLY STUPID, that the compiler doesn't know which possible error message of thousands to send.
I hope that you have a sense of humor. I do stuff like that all the time (I'll forget something REALLY obvious and basic), and, I get the most ridiculous error messages. You know something is seriously wrong, but, the specifics are a mystery,...and, then, it dawns on you.
You'll figure it out, I'm sure.
|
|
|
|
|
well i need to figure it out. yes i agree that the error is very stupid. i looked up the code i am just stuck up with this error. I am getting any idea why i am gettting this error.
ve
|
|
|
|
|
Just in case you didn't get this on MSFN,...
Hi eligeti vinod,
It's me, ursus zeta, from CodeProject. I googled your Link error code and discovered that you've posted all over the Internet. And I can't seem to get into the CodeProject for some reason,...
Anyway, after rereading your C++ command Line and Linker options, I noticed that you used the "/clr" switch, making your DirectShow filter DLL a managed .NET DLL.
I don't know if you are aware of it, but, the DirectShow object libriaries are 'unmanaged' COM libraries; .NET and COM types are NOT compatible. I assumed you were aware of this when I responded to your original post.
When using COM components in .NET applications, the correct technique is to use System.Runtime.Interop which manages the data exchange between the two entities. The COM Interop creates wrappers for all COM types so that they are usable in a .NET environment.
In your case, I think that you want to create an application that is unmanaged (by the Common Language Runtime); in other words, a Win32 application.
Review the Samples that accompany the C++ DirectShow SDK, and you will see that they do not use the /clr switch.
This is from the DirectShow FAQ at the MSDN site:
Will DirectShow ever be accessible through managed code?
There are no current plans to implement a "Managed DirectShow" platform. You can use COM interop to create DirectShow client applications in managed code, but creating filters that depend on the Common Language Runtime (CLR) is not recommended for performance reasons.
|
|
|
|
|
one question. is it not possible to call managed .NET code from directX filters which r unmanaged. Well actually my filter is whut i copied from the pushource filter of the sample provided by the directx sdk 2003. when i created the project i checked Console Application(this i suppose is .net) and not Win32 Console application and then changed to dll option.
i commented all lines of using statements which uses the managed code and still it gives me the same error.
Can you tell me how i can disable /clr option?
|
|
|
|
|
Happy Friday! Gurus,
I am trying to use the logics from Intel OpenCV DLLs, which were originally compiled by MSVC++ 6. From C# or ASP.NET Apps, when I was trying to add reference to these DLLs (i.e. cv096.dll or cxcore096.dll), I got this error:
“A reference to ‘D:\Programs\OpenCV\bin\cv096.dll’ could not be added. This is not a valid assembly or COM component. Only assemblies with extension ‘dll’ and COM components can be referenced. Please make sure it is a valid assembly or COM component.”
Note: The source code of Intel OpenCV DLLs is open source. I can open this source code project in either MSVC++ 6 or VS.NET 2003.
Question: How can I use these DLLs in .NET environment, preferably in ASP.NET and C# projects?
Thanks with a million
Khang
|
|
|
|
|
|
As mentioned in the previous post, you can't add a reference to the DLL since it's neither a .NET assembly, nor exposing COM interfaces -- when you add a reference to a COM DLL VS.NET just generates a .NET P/Invoke wrapper around it so you can use it without declaring things yourself.
Again, you can either go down the route of writing DllImport & P/Invoke stubs (although if you're using reasonably complicated data structures this can be time consuming unless someone else has already converted them).
Alternatively, you can use the (rather cool in my opinion) It Just Works functionality within MC++. Effectively you write a .NET wrapper around the functionality exposed by the Intel libraries by linking etc. as you would with MSVC++6. Now, I'm a little rusty on this, I've not done any MC++/interop code for a good while now, but it should be relatively straightforward. Effectively you compile your assembly with the /CLR compiler switch, this in turn generates managed code, including the P/Invoke code that would otherwise be up to you to write in C#. Of course, you'll need to make sure you link with the libraries, and include the headers.
If you get stuck with that I'm sure people will be able to give you more detailed instructions.
--
Paul
MS Messenger: paul -at- oobaloo-co-uk
|
|
|
|
|
Paul, thank you so much for your very descriptive and helpful insights. I really appreciate your spent time for thinking and writing it up. Wish you a beautiful Spring season.
Again, Thanks
Khang
|
|
|
|
|
Hi!
I'm facing a problem with my mixed-mode plugin-dll and hope that somebody has an idea how to solve it.
The DLL is exporting several functions to a host application. Inside these functions, I'm using some managed classes to perform the functionality. Some of these managed classes are embedded in my own assemblies and the DLL has to find them at run-time.
It works when my assemblies are located in the sample path the host application resides in, but I need to put them in the path where my plugin-dll is located (I'm not allowed to install dlls into the host application's path).
But then, the CLR throws FileNotFoundExceptions when trying to load one of my classes. Even changing the current directory to my plugin's location didn't work.
I guess I could strongname my assemblies and put them into the GAC, but I'd rather not (now), because I'm not sure how this could influence my other components which are using the same assemblies.
Is there any other way to make the CLR find the assemblies in a given path?
TIA,
mav
|
|
|
|
|
Since no-one is answering and I've found a working way I thought I'd share the information in case anyone actually uses the search function
Adding a ResolveAssembly event handler for the current AppDomain works.
That way I get notified whenever an assembly is about to be loaded and I can determine the path it gets loaded from.
mav
|
|
|
|
|
I'm trying to output a list to a printer using borland C++. I'm a beginner and can't figure how to do it. Another thing is that its a network printer. Please help me output this line:
"Game 1 vs Game 2"
"Jim vs Dorine"
Please please help!
|
|
|
|
|
Borland does not support managed C++.
There are, however, a number of articles on this site about printing that should point you in the right direction. The network printer thing is irrelevant, the driversd hide that detail from your code.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
i want to save my data from SQL database to XLS file, i.e. row by row, how can i proceed on this
nishant
|
|
|
|
|
This has nothing to do with MFC and, I suspect, nothing to do with managed C++.
First of all, you need to read your data from your database ( do you mean SQL Server, or just a db that supports SQL ( all of them ) ? ). then you need to load Excel as a COM object and control it to push the data into a sheet and save it. There's plenty of info on the latter on the web, and probably more info on the former, given that it's a realitively elementary task. Try the C++ forum, and try google.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
this is a two part question. Are overloaded operators inherited? can someone give me an example using managed c++ for the plus and minus operators?
|
|
|
|
|
1. Yes, I reckon they are
2. I doubt managed extensions make any changes to the standard implimentation found in most C++ textbooks and online.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
since i can inherit overloaded operators could you give me an example using the plus operator?
|
|
|
|
|
|
I searched through many of the "chat" programs provided on this site, but could not find any that were simple enough, and a lot even used a windows interface. What I want to know how to do, is to make a simple server and a client using a terminal window. All I basically want it to do is this:
SERVER::
>Runs on a hardcoded ip adress and port (for simplicity) and can handle multiple clients.
>Also, needs to somehow keep track of the IP+ports of the users who are logged on. (maybe a string array would work well)
CLIENT::
>Whenever you run the Client, it connects to the hardcoded IP+port.
>As soon as you logon, the server sends you some simple message like "Hello"
>Then, you put in the nickname you want to use.
>Then you enter the chat room, and whatever you type in, the server sends to all the other Clients. like this "MyName> hello chat clients"
Also, if you could, please keep this to as few includes as possible, as far as I can tell, you really only need <iostream>or<stdio> and "winsock2.h". Also, please keep it to standard datatypes (int char string etc.)
Thank you for helping me with this project.
|
|
|
|
|
So basically you don't want anything too fancy, or your teacher will know you didn't do your homework ? Nice try. Given that you've asked in the wrong forum ( or are you learning Managed C++ ? ), I guess you're not the most attentive guy, which probably accounts for your not being able to do your own homework.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
check out "Network Development Kit 2" which can be found on this site.
|
|
|
|
|
Wow Christian...why would I even be in a class where I would program a server. Anyway, this is just for my own use, and the simplicity is just for easier understanding.
|
|
|
|
|
Hey Aaron, can I please have the link to the Network Development Kit 2.
|
|
|
|
|