I have a native dll with some code that I want to leverage from managed C# applications.
So I wrote a C++/CLI class library to implement an wrapper assembly.
This works well but it creates a maintenance issue.
In the C# client project, I added a reference to my wrapper assembly and whenever I build the client project, the assembly dll gets copied to the build target folder.
However the dependent native dll does not get copied.
So my question is, how do I include the native dll in the wrapper assembly dependency so that they are both copied when the client project is built.
Am getting 'An unhandled exception of type 'System.Runtime.InteropServices.SEHException' occurred in CallingExe.exe
Additional information: External component has thrown an exception.' error when i try to call a dll generated with C# in my MFC code.
Have successfully generated the .tlb file using RegAsm.exe and also installed it using gacutil. both these were successfull. Have attached my code for reference.
I have a high configurable pc with MS-Office 2010 package, i have implemented one application(in c++/cli) which will write plenty of data in no'of excel sheet(single workbook)so after writing in 8 sheets suddenly it pop-ups one error message saying"Excel cannot complete this task with available resources Choose less data or close other applications". Task Manager tells me I have plenty of resources left. Does anyone have any ideas as to what might be happening and how to fix it?
Note: I can't reproduce it again since application will do lot of process(almost 4days) to generate 8 sheets
Given that it is 4 days to generate the 8 sheets, it is my guess that you have a memory leak or a resource/handle leak. I know you say that Task Manager says you have plenty of resources left, but this really sounds like a leak of some kind.
I would start by double checking the freeing of every resource you allocate. Make sure they are freed in a timely manner also.
Hi David, now i realized that i am not saving the excel file till completion of the report generation so what i am suspecting, each excel sheet will have maximum rows 1048576 that means
1048576 * 8 = 8388608 rows of data(this data is a huge) it holding on RAM. Now what i will do i will save the excel file for each 5 sheets completion and continue to generate report.
In this application i am also using number of Dictionary objects, so i will also take care to freed these objects as per you suggestion.
I have a set of project folders which are compilable using make files and as of now i am compiling using nmake at command prompt.. i want the entire folder structure to be in a project or a solution file has to be built so that i can compile like a regular Project and must be able to place breakpoint in VS6.0 pls help
PS: Code is in plain C and C++ and NO MFC Used ...
I have a legacy C++ native code application that implements a class hierachy with some inheritance.
I have to re-implement the application within a managed framework.
TI would like to reuse the unmanged class hierarchy from the managed application and still benefit from the polymorphism built in to my unmanaged class hierarchy.
Do I have to write a C++/CLI wrapper for each unmanaged class in the hierarchy and duplicate the inheritance structure within the wrappers?
Assuming that you really do need to expose the full class hierarchy as managed types to managed code then yes, I think you're left duplicating the hierarchy with wrapper ref classes.
If the client managed application is also guaranteed to be C++/CLI (and not C#) it could #include the native class hierarchy intact and use it directly. If you want to allow C# then I'd use wrapper classes with the PIMPL idiom.
Also, hopefully your native classes don't use multiple inheritance since a managed class can only have one non-interface base class.
In my linker I get an error:
[bcc32 Error] Unit1.cpp(109): E2316 'GetScanline' is not a member of 'TBitmapData' Full parser context Unit1.cpp(42): parsing: void _fastcall TForm1::Button1Click(TObject *)
But I can clearly see it here Embarcadero API TBitmapData
Actually I have only 3 methods in TBitmapData - Pitch, GetPixel and PixelFormat. That is strange.
What should I do to use GetScanline?
I use Embarcadero RAD Studio XE3. And Firemonkey.